new sed for md to html

This commit is contained in:
tengel 2024-03-20 11:13:10 -05:00
parent 4408c4c97f
commit 488f7cd5b9

View file

@ -23,12 +23,7 @@ for file in ./src/*.md; do
_TITLE=$(grep -m1 "^# " "$file" | sed -r 's/# //') _TITLE=$(grep -m1 "^# " "$file" | sed -r 's/# //')
# [foo](foo.md) -> [foo](foo.html) # [foo](foo.md) -> [foo](foo.html)
# sed -i -r 's/(\[.*?\])\((.*?)\.md\)/\1(\2.html)/' "$file" sed -i -E 's/(\[[^)]*\])\((([^.]*\.)*)md\)/\1(\2html)/g' $file
# sed does not support non-greedy (.*?) like perl, we have to hack it
sed -i -r \
-e ':loop' \
-e 's/(\[.*\])\((.*)\.md\)/\1(\2.html)/g' \
-e 't loop' $file
pandoc -s \ pandoc -s \
-f gfm+gfm_auto_identifiers-ascii_identifiers \ -f gfm+gfm_auto_identifiers-ascii_identifiers \