Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

March 21, 2005

New itexToMML for WordPress 1.5

WordPress 1.5 has been out for a month or so, and it finally makes using my itexToMML plugin practical. A certain amount of hacking of the WordPress source code is still required, but it’s pretty manageable.

The required patches can be applied with a simple

patch < WordPress1.5_math.patch

Here’s what they do:

  • wp-blog-header.php is patched to send the correct MIME-type to MathML-capable browsers.
  • wp-includes/functions-formatting.php is patched so that wp-texturize plays nice with MathML.
  • wp-content/plugins/textile1.php is patched so that the Textile filter plays nice with MathML. Markdown works just fine as-is.
  • wp-content/themes/default/header.php and wp-content/themes/classic/header.php are patched to send out an XML declaration and the correct XHTML+MathML DOCTYPE to capable browsers. If you use another theme, you’ll have to patch it on your own.

I also decided to dispense with the “deprecated” my-hacks.php file and set the allowed XHTML+MathML tags directly in the plugin. In fact, that’s the only change to the plugin itself.

If you’re running WordPress 1.5, you can

  1. install the itex2MML commandline utility,
  2. install the plugin,
  3. apply the patches,

and be running a MathML-capable blog in minutes.

Having said that, you’re still probably better-off installing MovableType. After you’ve played around a bit with a basic MathML-capable installation, you’re going want to start converting XHTML+MathML named entities to NCRs on output. You’re going to want to start adding things like comment-validation, per-post and per-comment selectable text filters and so forth. MT is still far-and-away the better platform to build on for this sort of “advanced” weblog functionality. But competition is good. And WordPress is a very nimble competitor…

Posted by distler at March 21, 2005 11:07 AM

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/537

6 Comments & 0 Trackbacks

Re: New itexToMML for WordPress 1.5

Pretty neat.  Might I ask what prompted you to integrate itexToMML with WordPress?

Posted by: Aankhen on March 26, 2005 12:27 AM | Permalink | Reply to this

Why WordPress

Because there are people who are reluctant to use MovableType (inexpensive, but non-free software), who would be happy to use WordPress (GPL’ed) to run their MathML-enabled blogs.

If my knowledge of PHP were more extensive, I would consider hacking on WordPress to bring it up to the level of functionality that can be achieved currently with MovableType.

As it happens, I’m more fluent in Perl, and certain crucial ingredients, like the W3C Validator are written in Perl.

Posted by: Jacques Distler on March 26, 2005 10:10 AM | Permalink | PGP Sig | Reply to this

Re: Why WordPress

Ah, I was actually just wondering what the immediate cause was — whether it was a case of hacking the WP source as a side effect of something else, or you actively set out to do it, or… um… a gun was held to your head. :-)

Posted by: Aankhen on March 26, 2005 11:58 PM | Permalink | Reply to this

Re: Why WordPress

When you develop a piece of software, there’s sort of a moral obligation to update it from time to time. Especially since WordPress 1.5 fixes the bugs in 1.2 which made the previous version of my plugin unusable.

I’d been meaning to do this ever since WordPress 1.5 came out. It only took me a month to get around to it.

Posted by: Jacques Distler on March 27, 2005 12:46 AM | Permalink | PGP Sig | Reply to this

Re: Why WordPress

Oops.  My mistake.  Didn’t realise it was an update. :-)

Posted by: Aankhen on March 27, 2005 2:10 PM | Permalink | Reply to this

Re: New itexToMML for WordPress 1.5

The changes to Wordpress 2.0.x which enable itextoMML to work can be found here.

Posted by: Frederick Leitner on February 25, 2006 8:04 AM | Permalink | Reply to this

Post a New Comment