supports more markdown parsers

This commit is contained in:
Jaromil 2013-10-23 17:58:04 +02:00
parent 8e433fe0d0
commit 5eefb1bb96
1 changed files with 9 additions and 2 deletions

11
render
View File

@ -117,11 +117,18 @@ render_html() {
# check which markdown parser is available in PATH
command -v markdown > /dev/null
if [ "$?" = "0" ]; then parser=markdown
else command -v multimarkdown > /dev/null
if [ "$?" = "0"]; then parser=multimarkdown; fi
fi
for i in $mds; do
md=`basename $i`
newtemp="tmp.$RANDOM"
cat $tmp | awk '
/^'"$md"'/ { system("cat '"$md"' | markdown"); next }
/^'"$md"'/ { system("cat '"$md"' | '"$parser"'"); next }
{ print $0; }' > $newtemp
rm $tmp; tmp=$newtemp
done
@ -357,4 +364,4 @@ done
notice "Website refreshed."
{ test "$DIR" = "." } || { sleep 10 }
{ test "$DIR" = "." } || { sleep 10 }