Quantcast
Channel: teideal glic deisbhéalach » web
Viewing all articles
Browse latest Browse all 6

Blogging with Emacs and Haskell, part Zero

$
0
0

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.


Viewing all articles
Browse latest Browse all 6

Trending Articles