Markdown

May 2nd, 2009 | Categories: CLI, Linux, MacOSX | Tags:

It has taken me a while to find a quick and dirty method of taking notes electronically. Most document formats suck, and they'll bite me at one point or another, and LaTeX, while incredibly powerful for writing a book, is a bit of an overkill for shorter texts.

Enter Markdown. Quoting its maker, Markdown is

Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

If you've never seen a Markdown text, it is plain text with a few very simple formatting rules. Markdown's syntax is easy to learn, and makes the text look rather good in a plain text editor as well as converted to HTML or other formats.

Converting Markdown to …

Markdown isn't a one-way street beause, as it is plain text, it can quite easily be converted to other formats. Here are some methods:

  • Pandoc is a Haskell library/command-line utility for converting from one markup format to another. It reads Markdown (among other formats) and creates LaTeX, RTF, XML, ODT, and others. It is a bit of a PITA to install on Mac OS X (I tried compiling a late version and gave up after two hours, reverting to 0.46, which did compile), but it is really worth it. Its markdown2pdf program alone, is worth the effort. Pandoc 1.2 was trouble-free.

  • If you want a C library to parse Markdown files, use discount.

Markdown on Mac OS X

There are at least two plugins to add Quicklook support for Markdown files: the original by Phillip Toland calls in Perl to do the formatting, and a fork by Michael Dominic K which uses the discount C library to do the formatting. Both plugins are available as compiled binaries with source code if you need to "fix" it.

These plugins both allow me to locate a file with a .markdown extension in Mac OS X' Finder, press a space bar to see the formatted result:

Markdown is easy to "write", readable without special tools, good-looking when rendered into a different format, and all in all, a simple way of getting things done. I strongly recommend you have a look at it.

Read more

  1. September 20th, 2009 at 02:33
    Reply | Quote | #1

    Thanks for the mention. I would like to point out that the "official" QLMarkdown (i.e., the one that I maintain) currently uses discount as well. In fact, all of the changes in Michael Dominic K's fork have been merged into the official repo. I try to keep on top of user contributions.

  2. simon
    January 19th, 2010 at 17:50
    Reply | Quote | #2

    Any idea if there's a quicklook viewer for Multimarkdown?

  3. January 19th, 2010 at 17:53
    Reply | Quote | #3

    I don't know if there's a specific quicklook viewer for it, but have you tried the Markdown viewer?

3 trackbacks

  1. Jan-Piet Mens » ack! Pingback | 2009/09/19
  2. Jan-Piet Mens » Nobody is indispensable Pingback | 2009/09/29
  3. Jan-Piet Mens » A small gift Pingback | 2010/02/25