I hate composing anything longer than a couple of paragraphs in an online HTML editor. Specifically, I hate writing posts for this blog online. I’d much rather write in Vim and upload HTML. But I don’t want to compose in raw HTML either.
I use reStructuredText (reST), an unobtrusive plaintext markup language popular in the Python world. reST can generate HTML, LaTeX, native PDF, ODF, and other formats. The picture at right shows a draft of this document in MacVim; reST is, as you can see, quite readable (though I work with a larger font). I use restview to preview the HTML locally and Pygments for syntax highlighting of code. Vim has its own syntax highlighting for reST and I’ve developed a set of keyboard macros for my own use.
The weak link in this scheme is posting to the blog. Right now, I have a little wrapper that generates HTML, extracts the body, and copies it to the pasteboard (clipboard). I then manually paste that into a raw HTML textarea in the blog’s editor. Someday, I have to adapt mtsend or Firedrop2 to make this less painful. Or I could hack dasBlog to support reST in IronPython, or switch over to a blog that supports reST natively. Someday.
For a long time, I used VST (Vim reStructuredText) to generate HTML from reST. As I began using Python more and more, I realized that I was far better off with the real thing, which is well designed and quite fast. The VimL scripting language is not that good and VST pushes it to its limits.
As of the recent Python 2.6 release, all the official Python documentation is in reST format. Sphinx is a documentation build system that wraps a collection of reST documents into a larger navigable entity.
There are many other lightweight markup languages, such as Textile, Markdown, and AsciiDoc. No doubt they have their strengths, but I now have a significant investment in reST and it’s well supported by the Python community.