From 3c9fd01ad8fc4d4c555bdde1d28a97e57c51af0c Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Fri, 29 Dec 2006 21:25:13 +0000 Subject: + Renamed web/demos.sh to mkdemos.sh + Added parameter for directory containing executables + Changed arithmetic statement for portability. + Modified Makefile accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@315 788f1e2b-df1e-0410-8736-df70ead52e1b --- web/demos.sh | 46 ---------------------------------------------- web/mkdemos.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 46 deletions(-) delete mode 100644 web/demos.sh create mode 100644 web/mkdemos.sh (limited to 'web') diff --git a/web/demos.sh b/web/demos.sh deleted file mode 100644 index bd87151d5..000000000 --- a/web/demos.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -e -# creates demo page for pandoc -# argument is the destination directory - -DEST=$1 - -NEWLINE=' -' -DEMOS='pandoc README -o demo0.html -pandoc -s -S README -o demo0.html -pandoc -s -S -c main.css -B header.html -A footer.html README -o demo0.html -pandoc -s README -o demo0.tex -pandoc -s README.tex -o demo0.txt -pandoc -s -w rst README -o demo0.txt -pandoc -s README -o demo0.rtf -pandoc -s -m -i -w s5 S5DEMO -o demo0.html -html2markdown http://www.gnu.org/software/make/ -o demo0.txt -markdown2pdf README -o demo0.pdf -markdown2pdf -C myheader.tex README -o demo0.pdf' - -oldifs=$IFS -IFS=$NEWLINE -set -- $DEMOS -IFS=$oldifs - -cd $DEST -PATH=../..:$PATH - -echo '% Pandoc demos - -To see the output created by each of the commands below, -click on the name of the output file: - -' -num=0 -for command in "$@"; do - 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/') - output=$(echo $command | sed -e 's/.*-o \(.*\)/\1/') - echo "1. $firstpart $input -o $output" - result=$($command) # run the command and create output file - echo "Created $output." >&2 -done - diff --git a/web/mkdemos.sh b/web/mkdemos.sh new file mode 100644 index 000000000..e33c464f8 --- /dev/null +++ b/web/mkdemos.sh @@ -0,0 +1,48 @@ +#!/bin/sh -e +# creates demo page for pandoc +# argument #1 is the destination directory +# argument #2 is the directory containing pandoc, html2markdown, markdown2pdf + +DEST=$1 +PROGPATH=$2 + +NEWLINE=' +' +DEMOS='pandoc README -o demo0.html +pandoc -s -S README -o demo0.html +pandoc -s -S -c main.css -B header.html -A footer.html README -o demo0.html +pandoc -s README -o demo0.tex +pandoc -s README.tex -o demo0.txt +pandoc -s -w rst README -o demo0.txt +pandoc -s README -o demo0.rtf +pandoc -s -m -i -w s5 S5DEMO -o demo0.html +html2markdown http://www.gnu.org/software/make/ -o demo0.txt +markdown2pdf README -o demo0.pdf +markdown2pdf -C myheader.tex README -o demo0.pdf' + +oldifs=$IFS +IFS=$NEWLINE +set -- $DEMOS +IFS=$oldifs + +cd $DEST +PATH=$PROGPATH:$PATH + +echo '% Pandoc demos + +To see the output created by each of the commands below, +click on the name of the output file: + +' +num=0 +for command in "$@"; do + 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/') + output=$(echo $command | sed -e 's/.*-o \(.*\)/\1/') + echo "1. $firstpart $input -o $output" + result=$($command) # run the command and create output file + echo "Created $output." >&2 +done + -- cgit v1.2.3