summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2013-10-23 15:58:04 (GMT)
committer Jaromil <jaromil@dyne.org>2013-10-23 15:58:04 (GMT)
commit2c49ecfb7b27bc678268b8eb6d21552a4c588f77 (patch)
treef430730cc683e4467daa97884c5be2450ca2c3ca
parent2644da1645c3a10616e101bbcfcf966c4fb4733b (diff)
supports more markdown parsers
-rwxr-xr-xrender11
1 files changed, 9 insertions, 2 deletions
diff --git a/render b/render
index 0d66466..9e790de 100755
--- a/render
+++ b/render
@@ -126,11 +126,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
@@ -341,4 +348,4 @@ done
notice "Website refreshed."
-{ test "$DIR" = "." } || { sleep 10 } \ No newline at end of file
+{ test "$DIR" = "." } || { sleep 10 }