mirror of https://github.com/dyne/webnomad.git
supports more markdown parsers
This commit is contained in:
parent
8e433fe0d0
commit
5eefb1bb96
11
render
11
render
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Reference in New Issue