@@ -1,68 +0,0 @@
1−#!/bin/sh -e
2−# creates example page for pandoc
3−# argument #1 is the destination directory
4−# argument #2 is pandoc path
5−
6−DEST=$1
7−PROGPATH=$2
8−
9−NEWLINE='
10−'
11−EXAMPLES='HTML fragment:
12−pandoc README -o example0.html
13−Standalone HTML file:
14−pandoc -s -S README -o example0.html
15−HTML with smart quotes, CSS, and custom header and footer:
16−pandoc -s -S -c main.css -B header.html -A footer.html README -o example0.html
17−LaTeX:
18−pandoc -s README -o example0.tex
19−From LaTeX to markdown:
20−pandoc -s README.tex -o example0.txt
21−reStructuredText:
22−pandoc -s -w rst README -o example0.txt
23−Rich text format (RTF):
24−pandoc -s README -o example0.rtf
25−S5 HTML slide show (all in one file):
26−pandoc -s -m -i -w s5 S5DEMO -o example0.html
27−Docbook XML:
28−pandoc -s -S -w docbook README -o example0.db
29−Chunked XHTML via Docbook and the third-party `xmlto` tool:
30−xmlto xhtml example(-1).db -o example0/
31−Converting a web page to markdown:
32−html2markdown http://www.gnu.org/software/make/ -o example0.txt
33−From markdown to PDF:
34−markdown2pdf README -o example0.pdf
35−PDF with numbered sections and a custom LaTeX header:
36−markdown2pdf -N -C myheader.tex README -o example0.pdf'
37−
38−oldifs=$IFS
39−IFS=$NEWLINE
40−set -- $EXAMPLES
41−IFS=$oldifs
42−
43−cd $DEST
44−
45−echo '% Pandoc examples
46−
47−To see the output created by each of the commands below,
48−click on the name of the output file:
49−
50−'
51−num=0
52−while [ $# -gt 0 ]; do
53− description="$1"
54− lastnum=$num
55− num=$(($num + 1))
56− command=$(echo $2 | sed -e "s/0/$num/" -e "s/(-1)/$lastnum/")
57− firstpart=$(echo $command | sed -e 's/\(.*\) [^ ]* -o.*/\1/')
58− input=$(echo $command | sed -e 's/.* \([^ ]*\) -o.*/\1/')
59− output=$(echo $command | sed -e 's/.*-o \(.*\)/\1/')
60− echo "1. $description"
61− echo
62− echo " <code>$firstpart <a href=\""$input"\" title=\""View input file"\">$input</a> -o <a href=\""$output"\" title=\""View pandoc output"\">$output</a></code>"
63− echo $command >&2
64− result=$(PATH=$PROGPATH:$PATH $command) # run the command and create output file
65− shift
66− shift
67−done
68−