This article originally appeared in TidBITS on 2013-01-17 at 9:08 a.m.
The permanent URL for this article is:
Include images: Off

Enable Quick Look for Markdown Files

by Adam C. Engst

We rely on Markdown-formatted text files for TidBITS articles, but one of the slight annoyances of doing so has been that we haven’t been able to use Quick Look to glance at the contents of an article, even though it’s just text. Luckily, this is a solved problem (and the solution isn’t even new — it’s just that I finally got around to looking for it).

Said solution is Phil Toland’s free QLMarkdown [1] generator, which has worked perfectly in my testing. To be recognized as Markdown by QLMarkdown, files need to have one of the following filename extensions: .markdown, .mdown, .md, .mdml, .mdwn, .mkd, or .mmd.

[image link] [2]

To install QLMarkdown, download the latest version [3] (currently 1.3), expand it, and copy the QLMarkdown.qlgenerator file to either ~/Library/QuickLook (to make it available to just your user) or to /Library/QuickLook (to make it available to all users). Remember that if you’re using OS X 10.8 Mountain Lion or 10.7 Lion, you’ll need to hold down Option and choose Go > Library in the Finder to reveal the user’s hidden Library folder (for details, see “Dealing with Lion’s Hidden Library [4],” 20 July 2011).

If you don’t like the look of the text in the previews, you can change nearly everything by modifying the built-in CSS stylesheet. Follow these steps:

  1. Control-click the QLMarkdown.qlgenerator file and choose Show Package Contents.

  2. Navigate to /Contents/Resources.

  3. In a text editor like BBEdit or TextWrangler, open styles.css, make your desired changes (I chose a different font and increased the font size), and save. In my testing, there was no need to do anything else to have the new styles honored — just preview another file to see them.