Blogging with Emacs and Haskell, part Zero

Since I started using WordPress to host my blog, I’ve generally been fairly pleased with it. Its killer feature has to be Akismet, the built-in spam filter. Akismet has so far killed over 18,000 spam comments for me, or roughly 300 per day in the two months since I switched from Blosxom to WordPress. Perhaps one in fifty spam comments make it through Akismet’s filters, at which point they’re easily dealt with via the web interface. So Akismet makes the difference between manageable comments and having to turn them off entirely.

One substantial aspect of WordPress that I’ve been displeased with is, surprisingly, its support for writing articles. The “WYSIWYG” JavaScript editor repeatedly loses my formatting, and is slow and unresponsive besides. The “plain” editing interface isn’t much better for me; I like to put code snippets in my blog entries, and it doesn’t deal well with these. And the internal text formatting flow is baroque.

Fortunately, WordPress provides a remote API via XML-RPC, so it’s possible to avoid its authoring interface entirely. My goal is to be able to write something like plain text from within Emacs, and have it turn into a nicely formatted blog posting with a minimum of fuss.

To this end, I spent a couple of hours putting together a small “blog helper” in Haskell. It uses John Gruber’s Markdown tool to turn plain text or literate Haskell source into a blog entry, and uses WordPress’s XML-RPC interface to publish it for me.

I’m writing this article as a Markdown-formatted file within Emacs, and publishing it with a few keystrokes. Excellent! Over the next few articles, I’ll detail how I did this.

Posted in haskell, web
One comment on “Blogging with Emacs and Haskell, part Zero
  1. Ramūnas says:

    There is Haskell library/tool for makrdown conversion, it might be esier to use from Haskell program:

    http://sophos.berkeley.edu/macfarlane/pandoc/

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>