diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | web/mkdemos.sh (renamed from web/demos.sh) | 8 |
2 files changed, 7 insertions, 5 deletions
@@ -344,7 +344,7 @@ make_page:=./$(MAIN) -s -B $(web_src)/header.html \ -H $(web_src)/css cleanup_files+=$(web_dest) website: $(web_dest) -$(web_dest)/: $(MAIN) html +$(web_dest)/: $(MAIN) html -rm -rf $(web_dest) ( \ mkdir $(web_dest); \ @@ -369,7 +369,7 @@ $(web_dest)/: $(MAIN) html cp $(web_src)/S5DEMO $(web_dest)/ ; \ cp $(web_src)/header.html $(web_dest)/ ; \ cp $(web_src)/footer.html $(web_dest)/ ; \ - sh $(web_src)/demos.sh $(web_dest) | \ + sh $(web_src)/mkdemos.sh $(web_dest) $(abspath .) | \ $(make_page) > $(web_dest)/demos.html; \ ) || { rm -rf $(web_dest); exit 1; } diff --git a/web/demos.sh b/web/mkdemos.sh index bd87151d5..e33c464f8 100644 --- a/web/demos.sh +++ b/web/mkdemos.sh @@ -1,8 +1,10 @@ #!/bin/sh -e # creates demo page for pandoc -# argument is the destination directory +# argument #1 is the destination directory +# argument #2 is the directory containing pandoc, html2markdown, markdown2pdf DEST=$1 +PROGPATH=$2 NEWLINE=' ' @@ -24,7 +26,7 @@ set -- $DEMOS IFS=$oldifs cd $DEST -PATH=../..:$PATH +PATH=$PROGPATH:$PATH echo '% Pandoc demos @@ -34,7 +36,7 @@ click on the name of the output file: ' num=0 for command in "$@"; do - num=$((num + 1)) + num=$(($num + 1)) command=$(echo $command | sed -e "s/0/$num/") firstpart=$(echo $command | sed -e 's/\(.*\) [^ ]* -o.*/\1/') input=$(echo $command | sed -e 's/.* \([^ ]*\) -o.*/\1/') |