Thursday, October 29, 2009

Markdown: Web Dingus

I used to do the curly quotes, em-dashes, paragraphs, bulleted lists, and really all the HTML on this blog completely manually because it offered a great deal of precision over using Blogger’s built-in editor. Unfortunately, maintaining pure HTML that way is error prone and leads to a lot of extra edits. A recent question asked by Cory Docotorow on Twitter led me to wondering if there was a better way.

As it turns out, there is. At least there is for me. One answer that was posed for Cory—which I doubt would satisfy his 300K request—is Daring Fireball: Markdown Web Dingus. If you set the Filter to Both and Results to Source & Preview, it’ll spit out the magic formatted code.

I’d heard of Markdown before. It’s a simplified markup language that I didn’t see much use for until I found out Dingus combined it with the conversion of regular quotes and double-dashes to HTML. That makes for a killer combination and highly useful.

There are a few snags for me though. There isn’t a way (so far as I can tell) to tell Dingus to assign a style to a given paragraph, so it’s a little Tag-centric instead of CSS-centric. Most experts seem to agree that formatting should all be Style-sheet oriented, and I’ve been doing it that way myself for a few years. So, that’s not entirely convenient. An interesting example of this is what happens when you want to double-space between lines in a list. It inserts paragraph tags inside the LI tags. Eww.

Markdown also dislikes putting text in the heading of any sort of list. I have the choice of not putting a heading there, or of adding it manually. Not the worst choice in the world, but I do this frequently and the added complexity isn’t a positive thing.

Minor complaints aside, I’m quite happy with it. It saves me a theoretical 30 minutes when posting a 1000 word story, and 10-15 minutes plus minor after-the-fact edits on 500 word essays. Because of the Tag-centricism, I still have to do some tinkering with Bedtime Stories for the ADD, but it’s nothing too bad.

If you want to use curly quotes, real em-dashes, and so on in your blog, this is the stuff for you. If you’re wondering why you would care about all that, I’m really sorry for boring you with this post. Basically, it makes everything look more like a proper book or magazine would. Many office suites will do the conversions automatically, but you can’t copy-paste direct into HTML and get consistent results. Even if you could, it wouldn't be appropriately standards-compliant and so it would likely break at some point in the future.

No comments: