Document mdwn_itex plugin.
authorW. Trevor King <wking@drexel.edu>
Mon, 4 Oct 2010 18:13:41 +0000 (14:13 -0400)
committerW. Trevor King <wking@tremily.us>
Sun, 13 Jan 2013 12:10:56 +0000 (07:10 -0500)
doc/ikiwiki/itex.mdwn [new file with mode: 0644]
doc/plugins/mdwn_itex.mdwn [new file with mode: 0644]

diff --git a/doc/ikiwiki/itex.mdwn b/doc/ikiwiki/itex.mdwn
new file mode 100644 (file)
index 0000000..7d128a4
--- /dev/null
@@ -0,0 +1,10 @@
+[[!meta robots="noindex, follow"]]
+
+[itex][] is a math markup language that resembles LaTeX.  You can
+translate itex to MathML with tools such as [itex2MML][].  The
+[[plugins/mdwn_itex]] plugin can be used to automatically convert
+embedded itex to MathML for pages that otherwise use the [[markdown]]
+markup language.
+
+[itex]: http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html
+[itex2MML]: http://golem.ph.utexas.edu/~distler/blog/itex2MML.html
diff --git a/doc/plugins/mdwn_itex.mdwn b/doc/plugins/mdwn_itex.mdwn
new file mode 100644 (file)
index 0000000..e9636b9
--- /dev/null
@@ -0,0 +1,67 @@
+[[!template id=plugin name=mdwn core=0 author="[[W. Trevor King]]"]]
+[[!tag type/format]]
+
+This plugin lets ikwiki convert files with names ending in
+`.mdwn_itex` to html.  It uses the [[ikiwiki/markdown]] minimal markup
+language with embedded [[ikiwiki/itex]].  The itex portion of the
+processing is handled by [itex2MML][], which converts the itex to
+[MathML][].  The markdown portion of the processing is handled by the
+[[mdwn]] plugin, so alternative markdown implementations are supported
+by configuring that plugin.
+
+In order to generate valid pages with MathML, you'll need to patch your
+templates to use an appropriate `DOCTYPE`:
+
+    diff -ru /usr/share/ikiwiki/templates/page.tmpl .ikiwiki/templates/page.tmpl
+    --- /usr/share/ikiwiki/templates/page.tmpl 2010-09-30 08:58:51.000000000 -0400
+    +++ .ikiwiki/templates/page.tmpl   2010-09-30 09:10:02.000000000 -0400
+    @@ -1,8 +1,12 @@
+     <TMPL_IF HTML5><!DOCTYPE html>
+     <html>
+    -<TMPL_ELSE><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+    -<html xmlns="http://www.w3.org/1999/xhtml">
+    +<TMPL_ELSE><?xml version="1.0" encoding="UTF-8"?>
+    +<!DOCTYPE html PUBLIC
+    +    "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
+    +    "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
+    +<html xmlns="http://www.w3.org/1999/xhtml"
+    +      xmlns:math="http://www.w3.org/1998/Math/MathML"
+    +      xmlns:svg="http://www.w3.org/2000/svg">
+     </TMPL_IF>
+     <head>
+     <TMPL_IF DYNAMIC>
+
+To setup the plugin, add config options along the lines of:
+
+    # plugins to add to the default configuration
+    add_plugins => [qw{ ... mdwn_itex ...}],
+    # plugins to disable
+    disable_plugins => [qw{... htmlscrubber htmltidy ...}],
+
+    # location of template files
+    templatedir => '/path/to/patched/templates',
+
+    # mdwn_itex plugin
+    # path to the itex2MML binary
+    itex2mml => '/usr/local/bin/itex2MML',
+    # autonumber display equations?
+    itex_num_equations => 1,
+
+Create new files with the `.mdwn_itex` extension, and start
+including itex:
+
+    Euler's identity
+
+    \[ e^{i \pi} + 1 = 0 \]
+
+    has lots of fun constants: $e$, $i$, $\pi$, $1$, and $0$.
+
+The [[htmlscrubber]] and [[htmltidy]] plugins must be disabled because
+otherwise they [strip][scrubber_strip] [out][tidy_strip] the MathML
+markup.
+
+[itex2MML]: http://golem.ph.utexas.edu/~distler/blog/itex2MML.html
+[MathML]: http://www.w3.org/Math/
+[scrubber_strip]: http://ikiwiki.info/todo/svg/
+[tidy_strip]: http://lists.w3.org/Archives/Public/html-tidy/2006JanMar/0052.html