@@ -0,0 +1,43 @@
1+#!/bin/sh -e
2+# creates demo page for pandoc
3+# argument is the destination directory
4+
5+DEST=$1
6+
7+NEWLINE='
8+'
9+DEMOS='pandoc README -o demo0.html
10+pandoc -s -S README -o demo0.html
11+pandoc -s README -o demo0.tex
12+pandoc -s -w rst README -o demo0.txt
13+pandoc -s README -o demo0.rtf
14+pandoc -s -m -i -w s5 S5DEMO -o demo0.html
15+web2markdown http://www.gnu.org/software/make/ -o demo0.txt
16+markdown2pdf README -o demo0.pdf'
17+
18+oldifs=$IFS
19+IFS=$NEWLINE
20+set -- $DEMOS
21+IFS=$oldifs
22+
23+cd $DEST
24+PATH=../..:$PATH
25+
26+echo '% Pandoc demos
27+
28+To see the output created by each of the commands below,
29+click on the name of the output file:
30+
31+'
32+num=0
33+for command in "$@"; do
34+ num=$((num + 1))
35+ command=$(echo $command | sed -e "s/0/$num/")
36+ firstpart=$(echo $command | sed -e 's/\(.*\) [^ ]* -o.*/\1/')
37+ input=$(echo $command | sed -e 's/.* \([^ ]*\) -o.*/\1/')
38+ output=$(echo $command | sed -e 's/.*-o \(.*\)/\1/')
39+ echo "1. <code>$firstpart <a href=\""$input"\" title=\""View input file"\">$input</a> -o <a href=\""$output"\" title=\""View pandoc output"\">$output</a></code>"
40+ result=$($command) # run the command and create output file
41+ echo "Created $output." >&2
42+done
43+