views:

422

answers:

2

I typically use the .markdown or .md extension for markdown documents. Unfortunately spotlight refuses to index them unless they have the .txt file extension.

I've seen a possible solution involving editing Info.plist files on the textmate blog. Is there a better way?

Update: I just discovered QuickLook generator for Markdown files which adds spotlight support and nice HTML quicklook previews. It works a treat!

+2  A: 

You'll have to write a Spotlight importer. There's an Xcode project template that will set the basic stuff up for you and get you started; I think there's also a developer example.

Your importer will need a UTExportedTypeDeclarations section in its Info.plist that describes a Uniform Type Identifier for markdown files with you path extension. Then it's just a matter of having your importer pass Spotlight the appropriate data for a markdown file.

Chris Hanson
A: 

You could write a Importer, but there's an easier way. Markdown is just text, which Spotlight handles. If you give your markdown files the extension ".txt", Spotlight will pick them up.

In my case, I just named mine all to end with ".mdwn.txt" and taught emacs' markdown-mode to activate for files matching this extension.

bendin