File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -38,16 +38,29 @@ TUTORIAL_DST="$DOCS_SOURCE_DIR/tutorial.md"
3838 done < " $TUTORIAL_SRC "
3939} > " $TUTORIAL_DST "
4040
41- # === Copy and transform README.md into index.md ===
41+ # === Copy and transform README.md into index.md (with admonition fix) ===
4242README_SRC= " $TMP_DIR /amago-crr_k/README.md"
4343INDEX_DST= " $DOCS_SOURCE_DIR /index.md"
4444
4545{
4646 found_title=false
4747 while IFS= read -r line; do
48+ # Rewrite title to "# Home"
4849 if ! $found_title && [[ " $line " =~ ^# ]]; then
4950 echo " # Home"
5051 found_title= true
52+ continue
53+ fi
54+
55+ # Replace GitHub-style admonitions with MyST blocks
56+ if [[ " $line " =~ ^\[ ! TIP\] ]]; then
57+ echo ' ```{tip}'
58+ echo " ${line/ \[ ! TIP\] / } " | sed ' s/^ *\*NOTE*[:]* *//'
59+ echo ' ```'
60+ elif [[ " $line " =~ ^\[ ! WARNING\] ]]; then
61+ echo ' ```{warning}'
62+ echo " ${line/ \[ ! WARNING\] / } " | sed ' s/^ *//'
63+ echo ' ```'
5164 else
5265 echo " $line "
5366 fi
You can’t perform that action at this time.
0 commit comments