Here's a post about two very unlikely bed-fellows: Drupal and Markdown.
Drupal is a powerful CMS that I use on this site, even though it is sort of a kill-a-fly-with-a-bazooka solution, and has been a pretty continuous mind-fuck for me since I began flirting with it. From a non-developer point of view, 'flirting with Drupal' might be something akin to flirting with grizzly bear. It can be painful 1.
Markdown on the other hand, is a simple and light markup language somehow makes me feel really nice when I use it. You don't have to flirt with Markdown -- she's easy.
So for better or worse, 1rick.com uses Drupal -- at least for now. I like that Drupal lets me do fancy things like create sortable filters for my photo gallery 2 or my portfolio of writing samples, without the need for any difficult coding. Anyway, to make long story marginally less long, I recently discovered the Markdown Filters module and thought I'd add it to my Drupal install. I'm not really a fan of most of Drupal's input editors, but this one does work well. And I like having my content stored in Markdown as opposed to HTML.
And it's not just the regular flavor of Markdown. This is MultiMarkdown, which lets you do fun footnotes and tables. Right on brother! (flashes double-M gang signs).
So here's a quick 5-step overview of how to install the basic Markdown filter:
- Get the latest release for either Drupal 6 or 7 over at drupal.org/project/markdown.
- Extract it in your sites/all/modules folder
- Enable the module under /admin/build/modules (or admin/modules in D7)
- Under admin/settings/filters/ (or admin/config/content/formats/ in D7) check off Markdown under your desired input format. I did this for the Full HTML format, though you could use it for any.
- On that same page make sure that 'convert URLs into links is NOT checked.
Congratulations, you now can write Markdown in your Drupal text editor.
And now for some fancy buttons!
So now you have Markdown in Drupal. For me, because I usually write Markdown in an external editor (currently Textmate, with frequent snippets for stuff like footnotes and reference links) I don't really need to go any further 3. But surprisingly, this Markdown filter works really great with the BUEditor. So lets install that too and get some dedicated buttons in your editor for MultiMarkdown footnotes and tables:
- Like before, get the latest release of BUEditor, drop/extract it in your modules folder.
- Enable the module.
- Make sure you set the appropriate permissions for whoever you want to use the editor.
- Then install the Markdown editor for BUEditor module, and enable it.
- Go to the BUEditor settings (admin/settings/bueditor in D6, admin/config/content/bueditor in D7) and you should now see 'markdowneditor' added to the 'available editors' list. You can now enable the 'markdowneditor' for the desired user roles.
So now (in addition to regular markdown syntax) you can create really fun multimarkdown tables using the dedicated table button, as well as multimarkdown footnotes using the footnote button. Check the screenshots below.
That was a metaphor. I've never actually flirted with a grizzly bear. I'm Canadian, but not that Canadian. ↩
I really recommend Brett Terpstra's Text Expander snippets if you like to use Markdown in many applications. It's pretty handy, especially for reference links and footnotes. ↩