Instiki 0.19 includes an itex2MML web service. The service is used by Instiki 0.19’s built-in WYSIWYG SVG-editor, to provide support for equations in SVG graphics. But it may have other uses, so it’s documented here.
The specification for the endpoint is as follows.
http://my.wiki.com/itexhttp://my.wiki.com/web_list .tex (mandatory):display (optional):inline or block. Defaults to inline if absent, or unrecognized.application/xml).<merror> element.
***
As an example, the request, to this site,
~~~~~
http://golem.ph.utexas.edu/wiki/itex?tex=\phi%2B\psi&display=block
~~~~~
returns
~~~~~{: lang=xml}
<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'><mi>ϕ</mi><mo>+</mo><mi>ψ</mi></math>
~~~~~
***
N.B.: itex's `\begin{svg}...\end{svg}` syntax allows one to insert essentially arbitrary foreign content into the equation. While we ensure that the MathML document that we return is well-formed, we *don't* promise that it conforms to any particular profile. You probably want to pass it through a white-list sanitizer, before using it.
Instiki's itex endpoint is realized as a [Rails Metal](http://weblog.rubyonrails.org/2008/12/17/introducing-rails-metal), so should be very efficient. It uses [Nokogiri](http://nokogiri.org/) as its XML parser.
:category: features