Comment on my encoding wrapper for itex2MML in the Markdown/itex post.
authorW. Trevor King <wking@drexel.edu>
Thu, 23 Feb 2012 18:41:16 +0000 (13:41 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 23 Feb 2012 18:48:15 +0000 (13:48 -0500)
posts/mdwn_itex.mdwn_itex

index 45c1f99c5671ae859b42f000c2315f9d9661a336..50b54dcf0a1f700d9d5307210af2c51dd6ec725c 100644 (file)
@@ -10,6 +10,14 @@ here in case other ikiwiki users find this useful.
   (`mdwn_itex.patch` against Jason's version).
 * Patch your ikiwiki [templates][] to use a `DOCTYPE` supporting
   MathML (`mdwn_itex-templates.patch`).
+* Create a script wrapping `itex2MML` for escaping UTF-8 (which may
+  confuse the Markdown engine):
+
+        #!/bin/sh
+
+        # convert all output to numbered entities
+        /usr/bin/itex2MML "${@}" | perl -e 'use MathML::Entities; print name2numbered($_) while(<>);' | python -c 'import sys; sys.stdout.write(unicode(sys.stdin.read(), encoding="utf-8").encode("ascii", "xmlcharrefreplace"))'
+
 * Add config options along the lines of:
 
         # plugins to add to the default configuration
@@ -22,7 +30,7 @@ here in case other ikiwiki users find this useful.
 
         # mdwn_itex plugin
         # path to the itex2MML binary
-        itex2mml => '/usr/local/bin/itex2MML',
+        itex2mml => '/path/to/your/wrapper/itex2MML.sh
         # autonumber display equations?
         itex_num_equations => 1,