@@ -8,17 +8,29 @@ PROGPATH=$2
88
99NEWLINE='
1010'
11−EXAMPLES='pandoc README -o example0.html
11+EXAMPLES='HTML fragment:
12+pandoc README -o example0.html
13+Standalone HTML file:
1214pandoc -s -S README -o example0.html
15+HTML with smart quotes, CSS, and custom header and footer:
1316pandoc -s -S -c main.css -B header.html -A footer.html README -o example0.html
17+LaTeX:
1418pandoc -s README -o example0.tex
19+From LaTeX to markdown:
1520pandoc -s README.tex -o example0.txt
21+reStructuredText:
1622pandoc -s -w rst README -o example0.txt
23+Rich text format (RTF):
1724pandoc -s README -o example0.rtf
25+S5 HTML slide show (all in one file):
1826pandoc -s -m -i -w s5 S5DEMO -o example0.html
27+Docbook XML:
1928pandoc -s -w docbook README -o example0.db
29+Converting a web page to markdown:
2030html2markdown http://www.gnu.org/software/make/ -o example0.txt
31+From markdown to PDF:
2132markdown2pdf README -o example0.pdf
33+Using a custom LaTeX header to change the font style of the PDF:
2234markdown2pdf -C myheader.tex README -o example0.pdf'
2335
2436oldifs=$IFS
@@ -35,14 +47,20 @@ click on the name of the output file:
3547
3648'
3749num=0
38−for command in "$@"; do
50+while [ $# -gt 0 ]; do
51+ description="$1"
52+ command="$2"
3953 num=$(($num + 1))
4054 command=$(echo $command | sed -e "s/0/$num/")
4155 firstpart=$(echo $command | sed -e 's/\(.*\) [^ ]* -o.*/\1/')
4256 input=$(echo $command | sed -e 's/.* \([^ ]*\) -o.*/\1/')
4357 output=$(echo $command | sed -e 's/.*-o \(.*\)/\1/')
44− echo "1. <code>$firstpart <a href=\""$input"\" title=\""View input file"\">$input</a> -o <a href=\""$output"\" title=\""View pandoc output"\">$output</a></code>"
58+ echo "1. $description"
59+ echo
60+ echo " <code>$firstpart <a href=\""$input"\" title=\""View input file"\">$input</a> -o <a href=\""$output"\" title=\""View pandoc output"\">$output</a></code>"
4561 echo $command >&2
4662 result=$(PATH=$PROGPATH:$PATH $command) # run the command and create output file
63+ shift
64+ shift
4765done
4866