Friday, 13 February 2004


This weekend’s Herculean coding task: port Textile 2.0 syntax to Python. Mark Pilgrim ported the 1.0 syntax, but has since put the project aside due to limited time. The Perl module is 2260 lines, not including the POD-formatted docs (I guess I’ll have to make that a docstring), so my work is cut out for me.

Anyway, it’s a welcome distraction from job applications…

Wednesday, 25 February 2004

Another PyTextile 2 port

I see someone else is trying to make a Python port of the Textile 2 syntax. My approach so far has been a straight port of the Perl code by Brad Choate, with some minor tweaks (using urlparse and mimetypes, for example), rather than trying to hack Mark’s existing module.

Now that I’ve been hacking away for a week (and am about 700 lines away from being done—I just started on format_table, which looks downright nasty), I’m becoming convinced that the smarter plan would have been to write a lexer from scratch for the Textile markup, rather than trying to use the regex-happy approach Choate used (which works far, far better in Perl than in Python).