I'm at work on a MW extension that, among other things, uses LaTeXML [1]
to make XHTML from full LaTeX documents. One feature is the option to
render the equations in MathML, which requires the skins to be patched so
that they output the page as Content-type: application/xhtml+xml instead
of text/html.
Attached is a patch for the skins directory that allows changing the
Content-type dynamically. After applying this patch, if any code sets the
global $wgServeAsXHTML to true, the page will be output with the xhtml+xml
content type. This seems to work fine with the existing MW XHTML pages.
This has been done before, for instance in the ASCIIMath4Wiki extension
[2]. I don't want to change the Content-type unconditionally, though,
only some of the time, so that we can serve texvc-style images to browsers
or users that don't like the modified content type.
It should be possible to use this patch without breaking any existing
systems (unless someone else's extension happens to use the same global
variable name, I guess).
The patch is made on the 1:1.13.3-1ubuntu1 mediawiki package (from Ubuntu
9.04), and only modifies Monobook.php and Modern.php. There are other
skins in my installation here, but they don't seem to work very well and I
didn't see where to make the change.
Is there a better way to make MathML work in MW? Might this option be
included in a future MW release? Any feedback or alternative suggestions
is welcome.
Lee Worden
McMaster University Dept of Biology
[1]
http://dlmf.nist.gov/LaTeXML/
[2]
http://www.mediawiki.org/wiki/Extension:ASCIIMath4Wiki
ps. I'm not sure if this list accepts attachments - if not I'll be happy
to send it to people on request.