Markdown is a somewhat geeky text to html markup language developed by John Gruber. Actually Markdown is also a Perl script that uses regular expressions to convert text marked up with Markdown to html. I’m writing this piece in TextWrangler. When I’ve spell checked it, I’ll go the the #! menu and select Markdown.pl from the Unix Filters sub-menu. A second later the article will be formatted in HTML, ready to paste into Ecto, a desktop blogging client, for posting.
Now Ecto has built in Rich Text editing. WordPress on which this blog is running has a built in WYSIWYG editing. I’m covered twice for text formatting. Why should I bother pre-formatting my text with Markdown.
Now I would like to say that I prefer the clean markup that Markdown produces, which is much less verbose than that produced by either of the other options. And that is true as far as it goes. I try to be picky about clean code and absolutely standards compliant web pages. I’m not fanatic about it though. Honestly, mostly there is good enough for me. My templates validate and if the text thrown in by a WYSISWYG editor is a little funky, I’m not going to lose any sleep. Anyway, that’s reason number one.
What’s more important to me is that Markdown is a much faster faster way to write. By knowing a handful of Markdown tags I can format my text totally from the keyboard. Actually, the most common tags like those for paragraph and lists work automatically with line breaks or manual bulleting or numbering.
Things like headings are a simple matter of throwing in a pound sign or coming back and underlining the text with an equals sign. Precede a block of text with a greater than sign and you have a blockquote, and so on. This isn’t a tutorial. There is thorough documentation at the website.
As a Perl script, Markdown can be run from the menu of either BBEdit or it’s free little brother, TextWrangler. It might be possible to run it in other editors that execute shell scripts. I haven’t checked.
It is also possible to run either Markdown or Textile as an OS X service. That would allow you to write in TextEdit or another OS X Services aware application.
Markdown plugins are also available for major blogging systems like WordPress and Movable Type and content management systems like Mambo and many others. For me it’s just faster to type the text in TextWrangler, convert it and send it to Ecto (Services again) to post.
If you want to try it out, Gruber has provided a web dingus that will run the script and spit out the coded text.
Markdown started out as a Perl script to implement Textile, a Humane Text Generator, which is the brain child of Dean Allen. And Markdown will accept Textile syntax. However, Markdown has added some formatting conventions that Textile doesn’t recognize. Some people love Textile. I learned Markdown first and developed some non-Textile standard habits. Textile is also available as a plugin for most blogging and Open Source CMS’s.
Markdown will also work in conjunction with SmartyPants, which turns plain text punctuation into “typographically correct” text with “curly quotes” elipses and more. It too works in BBEdit or TextWrangler or as a plug-in to many blogging systems. It is nice but I’m boring enough to not care much.
If you feel like mixing HTML in with your Markdown, no problem. Markdown is smart enough to honor your code. Mostly. Always double check.