git.iko.soy/typeable/pandoc
on master help sign in
+ Renamed web/demos.sh to mkdemos.sh
3c9fd01fiddlosopher
Makefile+2−2
@@ -344,7 +344,7 @@ make_page:=./$(MAIN) -s -B $(web_src)/header.html \
344 -H $(web_src)/css
344 -H $(web_src)/css
345cleanup_files+=$(web_dest)
345cleanup_files+=$(web_dest)
346website: $(web_dest)
346website: $(web_dest)
347−$(web_dest)/: $(MAIN) html
347+$(web_dest)/: $(MAIN) html
348 -rm -rf $(web_dest)
348 -rm -rf $(web_dest)
349 ( \
349 ( \
350 mkdir $(web_dest); \
350 mkdir $(web_dest); \
@@ -369,7 +369,7 @@ $(web_dest)/: $(MAIN) html
369 cp $(web_src)/S5DEMO $(web_dest)/ ; \
369 cp $(web_src)/S5DEMO $(web_dest)/ ; \
370 cp $(web_src)/header.html $(web_dest)/ ; \
370 cp $(web_src)/header.html $(web_dest)/ ; \
371 cp $(web_src)/footer.html $(web_dest)/ ; \
371 cp $(web_src)/footer.html $(web_dest)/ ; \
372− sh $(web_src)/demos.sh $(web_dest) | \
372+ sh $(web_src)/mkdemos.sh $(web_dest) $(abspath .) | \
373 $(make_page) > $(web_dest)/demos.html; \
373 $(make_page) > $(web_dest)/demos.html; \
374 ) || { rm -rf $(web_dest); exit 1; }
374 ) || { rm -rf $(web_dest); exit 1; }
375
375
web/demos.sh → web/mkdemos.shrenamed+5−3
@@ -1,8 +1,10 @@
1#!/bin/sh -e
1#!/bin/sh -e
2# creates demo page for pandoc
2# creates demo page for pandoc
3−# argument is the destination directory
3+# argument #1 is the destination directory
4+# argument #2 is the directory containing pandoc, html2markdown, markdown2pdf
4
5
5DEST=$1
6DEST=$1
7+PROGPATH=$2
6
8
7NEWLINE='
9NEWLINE='
8'
10'
@@ -24,7 +26,7 @@ set -- $DEMOS
24IFS=$oldifs
26IFS=$oldifs
25
27
26cd $DEST
28cd $DEST
27−PATH=../..:$PATH
29+PATH=$PROGPATH:$PATH
28
30
29echo '% Pandoc demos
31echo '% Pandoc demos
30
32
@@ -34,7 +36,7 @@ click on the name of the output file:
34'
36'
35num=0
37num=0
36for command in "$@"; do
38for command in "$@"; do
37− num=$((num + 1))
39+ num=$(($num + 1))
38 command=$(echo $command | sed -e "s/0/$num/")
40 command=$(echo $command | sed -e "s/0/$num/")
39 firstpart=$(echo $command | sed -e 's/\(.*\) [^ ]* -o.*/\1/')
41 firstpart=$(echo $command | sed -e 's/\(.*\) [^ ]* -o.*/\1/')
40 input=$(echo $command | sed -e 's/.* \([^ ]*\) -o.*/\1/')
42 input=$(echo $command | sed -e 's/.* \([^ ]*\) -o.*/\1/')