This is mostly in reply to ââ¬Ålearning GTK+, parsingââ¬Â by statico, who unfortunately does not have comments enabled.
Personally, I make things easier on myself by using Markdown and SmartyPants. If you havenââ¬â¢t seen Markdown, youââ¬â¢re really missing out. It is the plaintext-to-HTML formatter to end all formatters. The syntax is as close to intuitive as it can possibly get; if youââ¬â¢ve ever seen plaintext email, youââ¬â¢ve basically seen Markdown, and the translation to HTML looks pretty much the way such a mail would reasonably look like if it had been authored as a web page.
Hooking Markdown into the browser, and in fact into any application that has text input widgets at all, is actually simpler than might at first appear: you just need xclip (or some equivalent, I suppose, if youââ¬â¢re not on X11). This little tool can dump any of the X11 selections, such as the clipboard, to its stdout
or slurp its stdin
into one of the selections.
Thus, I have this shell oneliner bound to a keyboard shortcut in my window manager:
xclip -o -sel clip | Markdown | SmartyPants -2 | xclip -sel clip
With that in place, I simply write my entries in a natural format, then I copy, hit a key, and paste, and there they are, turned to HTML and typographically smartened. Presto.
An advantage of this solution over many tools is that it will work for everything, regardless of whether Iââ¬â¢m using a webblogging tool, writing a comment on some foreign weblog, posting on PerlMonks, or anywhere else you can imagine. One keystroke, and there you go. No muss, no fuss.