2007-01-10 03:33:33 +01:00
|
|
|
% Pandoc examples
|
|
|
|
|
|
|
|
To see the output created by each of the commands below,
|
|
|
|
click on the name of the output file:
|
|
|
|
|
|
|
|
1. HTML fragment:
|
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc @@README@@ -o @@example1.html@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-07-12 07:08:20 +02:00
|
|
|
2. Standalone HTML file:
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc -s @@README@@ -o @@example2.html@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-07-14 08:28:09 +02:00
|
|
|
3. HTML with smart quotes, table of contents, CSS, and custom footer:
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc -s -S --toc -c @@pandoc.css@@ -A @@footer.html@@ @@README@@ -o @@example3.html@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
|
|
|
4. LaTeX:
|
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc -s @@README@@ -o @@example4.tex@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
|
|
|
5. From LaTeX to markdown:
|
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc -s @@example4.tex@@ -o @@example5.text@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
|
|
|
6. reStructuredText:
|
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc -s -w rst --toc @@README@@ -o @@example6.text@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
|
|
|
7. Rich text format (RTF):
|
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc -s @@README@@ -o @@example7.rtf@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
|
|
|
8. S5 HTML slide show (all in one file):
|
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc -s -m -i -w s5 @@S5DEMO@@ -o @@example8.html@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
|
|
|
9. DocBook XML:
|
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc -s -S -w docbook @@README@@ -o @@example9.db@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-07-21 17:52:50 +02:00
|
|
|
Chunked XHTML via DocBook and [xmlto]:
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ xmlto xhtml -m @@config.xsl@@ @@example9.db@@ -o @@example9/@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-07-21 17:52:50 +02:00
|
|
|
10. Man page:
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc -s -w man @@pandoc.1.md@@ -o @@example10.1@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-07-21 17:52:50 +02:00
|
|
|
11. ConTeXt:
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ pandoc -s -w context @@README@@ -o @@example11.tex@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-07-21 17:52:50 +02:00
|
|
|
PDF via pandoc and ConTeXt's `texexec`:
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ texexec --pdf @@example11.tex@@ # produces @@example11.pdf@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-07-21 17:52:50 +02:00
|
|
|
12. Converting a web page to markdown:
|
2007-01-10 03:33:33 +01:00
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ html2markdown @@http://www.gnu.org/software/make/@@ -o @@example12.text@@
|
2007-07-15 05:14:05 +02:00
|
|
|
|
2007-07-21 17:52:50 +02:00
|
|
|
13. From markdown to PDF:
|
2007-07-15 05:14:05 +02:00
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ markdown2pdf @@README@@ -o @@example13.pdf@@
|
2007-07-15 05:14:05 +02:00
|
|
|
|
2007-07-21 17:52:50 +02:00
|
|
|
14. PDF with numbered sections and a custom LaTeX header:
|
2007-07-15 05:14:05 +02:00
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
@ markdown2pdf -N -C @@myheader.tex@@ @@README@@ -o @@example14.pdf@@
|
2007-01-10 03:33:33 +01:00
|
|
|
|
|
|
|
[xmlto]: http://cyberelk.net/tim/xmlto/
|
|
|
|
|
2007-08-26 18:05:24 +02:00
|
|
|
15. A simple wiki program using [HAppS](http://happs.org) and pandoc:
|
2007-09-02 16:53:28 +02:00
|
|
|
[pandocwiki](http://pandocwiki.googlecode.com/svn/trunk/)
|
2007-08-26 18:05:24 +02:00
|
|
|
|
2007-09-15 03:53:49 +02:00
|
|
|
16. A web application that converts web pages to any of eight different
|
|
|
|
formats: [html2x](html2x.html).
|
|
|
|
|
2007-12-04 05:14:38 +01:00
|
|
|
17. TeX math in HTML:
|
|
|
|
|
2008-01-23 03:17:42 +01:00
|
|
|
@ pandoc @@math.text@@ -s -o @@mathDefault.html@@
|
|
|
|
@ pandoc @@math.text@@ -s -m -o @@mathAsciimathml.html@@
|
|
|
|
@ pandoc @@math.text@@ -s --mimetex=/cgi-bin/mimetex.cgi -o @@mathMimetex.html@@
|
|
|
|
@ pandoc @@math.text@@ -s --gladtex -o mathGladtex.htex
|
2007-12-04 05:14:38 +01:00
|
|
|
@ gladtex @@mathGladtex.htex@@ # produces @@mathGladtex.html@@
|
|
|
|
|