git.iko.soy/typeable/pandoc
on master help sign in
More Changes to website target. Moved to a templating system

for the examples page. git-svn-id: https://pandoc.googlecode.com/svn/trunk@487 788f1e2b-df1e-0410-8736-df70ead52e1b

commite7dabc9dd0ed0bb2578677e893d7479ddbd2d1c6 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateWed 10 Jan 2007, 02:33 (20 years ago) parent8d4a1ed
4 files changed+93−70
web/Makefile+2−2 web/demos+64 web/mkdemos.pl+27 web/mkdemos.sh−68
web/Makefile+2−2
@@ -10,8 +10,8 @@ clean:
1010 for file in $(ALL); do rm $$file; done; \
1111 rm -r example*;
1212
13−examples.txt : $(PANDOC_DEPS) mkdemos.sh
14− ./mkdemos.sh . $(PANDOC_PATH) > $@
13+examples.txt : $(PANDOC_DEPS) mkdemos.pl
14+ PATH=$(PANDOC_PATH):$$PATH ./mkdemos.pl demos $@
1515
1616%.html : %.txt $(PANDOC_DEPS)
1717 $(MAKEPAGE) $< > $@
web/demosnew file+64
@@ -0,0 +1,64 @@
1+% Pandoc examples
2+
3+To see the output created by each of the commands below,
4+click on the name of the output file:
5+
6+1. HTML fragment:
7+
8+@ pandoc README -o example1.html
9+
10+2. Standalone HTML file:
11+
12+@ pandoc -s -S README -o example2.html
13+
14+3. HTML with smart quotes, CSS, and custom header and footer:
15+
16+@ pandoc -s -S -c main.css -B header.html -A footer.html README -o example3.html
17+
18+4. LaTeX:
19+
20+@ pandoc -s README -o example4.tex
21+
22+5. From LaTeX to markdown:
23+
24+@ pandoc -s README.tex -o example5.txt
25+
26+6. reStructuredText:
27+
28+@ pandoc -s -w rst README -o example6.txt
29+
30+7. Rich text format (RTF):
31+
32+@ pandoc -s README -o example7.rtf
33+
34+8. S5 HTML slide show (all in one file):
35+
36+@ pandoc -s -m -i -w s5 S5DEMO -o example8.html
37+
38+9. DocBook XML:
39+
40+@ pandoc -s -S -w docbook README -o example9.db
41+
42+10. Chunked XHTML via DocBook and [xmlto]:
43+
44+@ xmlto xhtml example9.db -o example10/
45+
46+11. ODF (open document format) via DocBook and [docbook2odf]:
47+
48+@ docbook2odf --input-file example9.db --output-file example11.odf
49+
50+12. Converting a web page to markdown:
51+
52+@ html2markdown http://www.gnu.org/software/make/ -o example12.txt
53+
54+13. From markdown to PDF:
55+
56+@ markdown2pdf README -o example13.pdf
57+
58+14. PDF with numbered sections and a custom LaTeX header:
59+
60+@ markdown2pdf -N -C myheader.tex README -o example14.pdf
61+
62+[xmlto]: http://cyberelk.net/tim/xmlto/
63+[docbook2odf]: http://open.comsultia.com/docbook2odf/
64+
web/mkdemos.plnew file+27
@@ -0,0 +1,27 @@
1+#!/usr/bin/perl -w
2+# first argument is input filename - a demo template.
3+# second argument is output filename.
4+
5+my $infile=$ARGV[0];
6+my $outfile=$ARGV[1];
7+
8+open( IN, "< $infile" );
9+open( OUT, "> $outfile" );
10+
11+while (<IN>) {
12+
13+ my $line = $_;
14+ my $firstchar = substr ($line,0,1);
15+ if ( $firstchar eq '@' ) {
16+ my $command = substr ($line,4);
17+ print STDERR "$command";
18+ system "$command";
19+ $line = $command;
20+ $line =~ s/-/\-/;
21+ $line =~ s/ ([A-Za-z0-9_:\/]+(\.|\/)[a-zA-Z0-9.\/]*|README|S5DEMO)/ <a href="$1">$1<\/a>/g;
22+ $line =~ s/-/\\-/g;
23+ $line =~ s/^(.*)$/ <code>$1<\/code>/g;
24+ }
25+ print OUT $line;
26+
27+}
web/mkdemos.shdeleted−68
@@ -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−