aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-12-04 04:14:38 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-12-04 04:14:38 +0000
commit702bb474503dadb8a8fc061b4bc43d81e3d2da0b (patch)
treec6ee0aaa3f2ce4cb10e9adedf64b35a88ea364b4
parent6cfe6c250a836b7de7349f931ecb6520681a6af7 (diff)
downloadpandoc-702bb474503dadb8a8fc061b4bc43d81e3d2da0b.tar.gz
Added new HTML math demos to website. Revamped mkdemos.pl for simplicity.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1139 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--web/demos40
-rw-r--r--web/math.txt17
-rwxr-xr-xweb/mkdemos.pl13
3 files changed, 49 insertions, 21 deletions
diff --git a/web/demos b/web/demos
index 840d55c8a..ba3428c42 100644
--- a/web/demos
+++ b/web/demos
@@ -5,67 +5,67 @@ click on the name of the output file:
1. HTML fragment:
-@ pandoc README -o example1.html
+@ pandoc @@README@@ -o @@example1.html@@
2. Standalone HTML file:
-@ pandoc -s README -o example2.html
+@ pandoc -s @@README@@ -o @@example2.html@@
3. HTML with smart quotes, table of contents, CSS, and custom footer:
-@ pandoc -s -S --toc -c pandoc.css -A footer.html README -o example3.html
+@ pandoc -s -S --toc -c @@pandoc.css@@ -A @@footer.html@@ @@README@@ -o @@example3.html@@
4. LaTeX:
-@ pandoc -s README -o example4.tex
+@ pandoc -s @@README@@ -o @@example4.tex@@
5. From LaTeX to markdown:
-@ pandoc -s example4.tex -o example5.text
+@ pandoc -s @@example4.tex@@ -o @@example5.text@@
6. reStructuredText:
-@ pandoc -s -w rst --toc README -o example6.text
+@ pandoc -s -w rst --toc @@README@@ -o @@example6.text@@
7. Rich text format (RTF):
-@ pandoc -s README -o example7.rtf
+@ pandoc -s @@README@@ -o @@example7.rtf@@
8. S5 HTML slide show (all in one file):
-@ pandoc -s -m -i -w s5 S5DEMO -o example8.html
+@ pandoc -s -m -i -w s5 @@S5DEMO@@ -o @@example8.html@@
9. DocBook XML:
-@ pandoc -s -S -w docbook README -o example9.db
+@ pandoc -s -S -w docbook @@README@@ -o @@example9.db@@
Chunked XHTML via DocBook and [xmlto]:
-@ xmlto xhtml -m config.xsl example9.db -o example9/
+@ xmlto xhtml -m @@config.xsl@@ @@example9.db@@ -o @@example9/@@
10. Man page:
-@ pandoc -s -w man pandoc.1.md -o example10.1
+@ pandoc -s -w man @@pandoc.1.md@@ -o @@example10.1@@
11. ConTeXt:
-@ pandoc -s -w context README -o example11.tex
+@ pandoc -s -w context @@README@@ -o @@example11.tex@@
PDF via pandoc and ConTeXt's `texexec`:
-@ texexec --pdf example11.tex --result example11.pdf
+@ texexec --pdf @@example11.tex@@ # produces @@example11.pdf@@
12. Converting a web page to markdown:
-@ html2markdown http://www.gnu.org/software/make/ -o example12.text
+@ html2markdown @@http://www.gnu.org/software/make/@@ -o @@example12.text@@
13. From markdown to PDF:
-@ markdown2pdf README -o example13.pdf
+@ markdown2pdf @@README@@ -o @@example13.pdf@@
14. PDF with numbered sections and a custom LaTeX header:
-@ markdown2pdf -N -C myheader.tex README -o example14.pdf
+@ markdown2pdf -N -C @@myheader.tex@@ @@README@@ -o @@example14.pdf@@
[xmlto]: http://cyberelk.net/tim/xmlto/
@@ -75,3 +75,11 @@ click on the name of the output file:
16. A web application that converts web pages to any of eight different
formats: [html2x](html2x.html).
+17. TeX math in HTML:
+
+@ pandoc @@math.txt@@ -s -o @@mathDefault.html@@
+@ pandoc @@math.txt@@ -s -m -o @@mathAsciimathml.html@@
+@ pandoc @@math.txt@@ -s --mimetex=/cgi-bin/mimetex.cgi -o @@mathMimetex.html@@
+@ pandoc @@math.txt@@ -s --gladtex -o mathGladtex.htex
+@ gladtex @@mathGladtex.htex@@ # produces @@mathGladtex.html@@
+
diff --git a/web/math.txt b/web/math.txt
new file mode 100644
index 000000000..aa52eae5e
--- /dev/null
+++ b/web/math.txt
@@ -0,0 +1,17 @@
+% Pandoc math demos
+
+$a^2 + b^2 = c^2$
+
+$v(t) = v_0 + \frac{1}{2}at^2$
+
+$\gamma = \frac{1}{\sqrt{1 - v^2/c^2}}$
+
+$\exists x \forall y (Rxy \equiv Ryx)$
+
+$p \wedge q \models p$
+
+$\Box\diamond p\equiv\diamond p$
+
+$\int_{0}^{1} x dx = \left[ \frac{1}{2}x^2 \right]_{0}^{1} = \frac{1}{2}$
+
+$e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = \lim_{n\rightarrow\infty} (1+x/n)^n$
diff --git a/web/mkdemos.pl b/web/mkdemos.pl
index a56a8dc06..17a965703 100755
--- a/web/mkdemos.pl
+++ b/web/mkdemos.pl
@@ -14,13 +14,16 @@ while (<IN>) {
my $firstchar = substr ($line,0,1);
if ( $firstchar eq '@' ) {
my $command = substr ($line,4);
- print STDERR "$command";
- system "$command";
+ my $commandExec = $command;
+ $commandExec =~ s/[#].*$//g; # strip off comments
+ $commandExec =~ s/@@//g; # strip off hotlink markers
+ print STDERR "$commandExec";
+ system "$commandExec";
$line = $command;
$line =~ s/-/\-/;
- $line =~ s/ ([A-Za-z0-9_:\/]+(\.|\/)[a-zA-Z0-9.\/]*|README|S5DEMO)/ <a href="$1">$1<\/a>/g;
- $line =~ s/-/\\-/g;
- $line =~ s/^(.*)$/ <code>$1<\/code>/g;
+ $line =~ s/@@([^@]*)@@/<a href="$1">$1<\/a>/g;
+ $line =~ s/-/\\-/g; # to prevent smart dashes!
+ $line =~ s/^(.*)$/ <pre><code>$1<\/code><\/pre>/g;
if ( $line =~ /(example\d+\.html)<\/a><\/code>/m ) {
$line .= "\n (View [`$1` as a web page]($1).)\n";
}