Thoughtful, detailed coverage of the Mac, iPhone, and iPad, plus the best-selling Take Control ebooks.

Enable Quick Look for Markdown Files

Send Article to a Friend

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 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.


To install QLMarkdown, download the latest version (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,” 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.

 

READERS LIKE YOU! Support TidBITS by becoming a member today!
Check out the perks at <http://tidbits.com/member_benefits.html>
Special thanks to Richard Funke, Lou Plummer, Doug Holmes, and
jrhardin@mindspring.com for their generous support!
 

Comments about Enable Quick Look for Markdown Files

marshall  An apple icon for a Friend of TidBITS 2013-01-17 09:55
Sweet! Thanks!
Steve Nicholson  2013-01-17 12:34
Love it. I always tell myself I should use Markdown more.
John Crosby  2013-01-18 19:21
FYI, Fletcher Penny has a useful one for MultiMarkdown, which would work for straight Markdown as well.

http://fletcherpenney.net/multimarkdown/download/
Johnny  2013-01-19 00:38
iA Writer is also available on the Mac App Store and installs a Markdown QuickLook generator by default. It's not free, but it's a beautiful and simply crafted all that I use every day.
> ...Phil Toland, who has also created a Markdown parser in C, which I gather is relatively unusual.

It's true that the parser QLMarkdown uses is written in C, but it's actually Discount by David Parsons (http://www.pell.portland.or.us/%7Eorc/Code/markdown/). John Gruber's original markdown implementation was in Perl, but there are now many options in a number of different languages.
Adam Engst  An apple icon for a TidBITS Staffer 2013-01-20 16:23
Whoops - my mistake in attribution. I'll just remove that bit, since it's not really important anyway.