From Textile to Markdown

You probably remember by now my blog’s woes with the piece of crap that goes for a blog engine I’m using right now. Since enough people asked me to please not kill the blog, and since I would like, if I keep the blog around, to keep it up to date (if it were to go stale forever I would proceed with my idea of killing it altogether, and maybe make a book out of it), I’m looking in what options I got.

The options for me are either to move to a different blog engine altogether, or to just cut features out of the currently-running version of Typo to remove the errors and the stuff I don’t need. Please do not try to suggest me to use a static generator as I don’t care about it: I want to be able to edit my blog online, and I want to be able to have comments. And I’m not going to maintain two different pieces of software to maintain a static engine and a comment system, and no I’m not going to use Disqus or similar. Full stop.

Whichever way it goes, one thing that I need to change is the text format the posts are written in. Right now most of it is written in Textile. I’m not sure if the choice was simply due to Markdown sucking at the time, or this being the format used by Serendipity that I was using before. In any case, Textile lost the text format war and everything is Markdown nowadays. So I changed the settings for the new posts and I’m writing them in Markdown. The problem is converting the old posts.

Now thankfully I’ve already been pointed at pandoc which is a great tool… but its support for Textile, like most platforms, is not really perfect. For instance, lists are not properly converted; bullet lists are only evaluated correctly if the line does not start with a space (even though the Ruby gem for Textile supports it starting with space), and image URLs, which are expressed between exclamation marks, are matched across lines, making a mess of posts where more than one exclamation mark is present.

I can probably work those two issues around during the conversion (I already have a script that can pass all the posts through pandoc to convert them to Markdown), but there are bound to be more issues.. which means I’ll have to go through all my posts (or most of them at least) to make sure that my posts have been converted correctly. Is anybody with a liking for Haskell willing to fix these smaller issues for me?

Hopefully, I’ll soon be able to stop relying on Textile, and the multiple text filters are going to be the first thing I get rid of in Typo, as their execution requires database access for no good reason…

Exit mobile version