Building a Programmers Blog: Markdown

Out of the box, Drupal supports both partial and full HTML as input formats. Writing HTML markup for your blog isn't that difficult - but it does take both care and time.

Markdown, as popularized by the StackOverflow family of websites, is a simple text based way of writing for the web.

Series Content

Why use Markdown?

Markdown is Portable: I can write Markdown anywhere. Sometimes I use Microsoft Word, sometimes OneNote, sometimes a text editor. I've written some blog entries on my phone - and I'm not talking one of your new fangled smart phones, just a simple old Nokia, and even a few on an old Z88 laptop.

Markdown is concise: One problem I found when writing blog entries in HTML was that they became difficult for me to read - the HTML markup kept getting in the way of the message itself. One area where this is particularly evident is with lists, both bulleted and numbered. Markdown improves on HTML by being extremely concise, allowing you to concentrate on your message rather than the mechanics of presentation.

Markdown is easy to learn: This might seem like a minor point - after all, as a developer you're already likely to know HTML. Chances are, though, that you can pick up most of what you need to make effective use of Markdown in 10 minutes or less - it's really that simple.

Installing Markdown

After downloading the latest version of Markdown (from Drupal.Org/project/markdown), upload the \markdown\ folder to your Drupal installation. Log on as an Administrator, go to the Modules page and activate the Markdown module.

The next step is to put the input filter to good use. Go to Site Configuration and Input Formats and add a new input format.

Name the new input format "Markdown" and turn on the input filters you want used. Obviously, you'll want to check Markdown; Line Break Converter and URL Filter are useful as well. When you're finished, press Save Configuration. Don't forget to grant access to the relevant roles (at the top of the dialog) if you are setting up a multiuser site.

Once the input format has been created, you may want to make it the default format, available to everyone.