Clicky

birnle
I like the searchable text preview window. But it seems not to work for markdown (.md) files as though they are pure text files. Is it possible to get text preview for markdown files?

birnle
0 0
houdah
Hi!

The text preview – for most files – relies on Spotlight importer plug-ins to extract file contents. Such importers are included with the system and installed with third party applications.

Please check which importer plug-in is used for .md files on your Mac:

1. Open /Applications/Utilities/Terminal.app
2. Type: “mdimport -d 4 “ (without the quotes, but with the trailing space)
3. Drag a .md file to the Terminal window. This will append its path to the above command
4. Hit Return

The mdimport command will index the file and output information about the process. Towards the end of the output you should find “kMDItemTextContent”. This is the text extracted from the file. This will be indexed by Spotlight and be searcheable. It is also the same text shown in the HoudahSpot Text Preview.

Scroll to the top of the mdimport output. It should says something like:

(Import.Debug:1338) file:/Users/…/README.md plugin:file:///System/Library/Spotlight/RichText.mdimporter/ /System/Library/Spotlight/RichText.mdimporter

I.e. on my Mac the Apple-provided RichText.mdimporter is used to process .md files. It manages to extract text content.

Best,

Pierre Bernard
Houdah Software s.à r.l.

Houdah Software s. à r. l.
https://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Advanced file search utility
Tembo: Easy and effective file search
0 0
birnle
Thank you for your fast answer!

I get a different "(Import.Debug:1338)" message:

Imported '/Users/…/test.md' of type 'net.daringfireball.markdown' with no plugIn.

And there is no kMDItemTextContent …

How can I associate .md files with the RichText.mdimporter (I have it in my /System/Library folder!)?

birnle
0 0
houdah
In the output of mdimport, what do kMDItemContentTypeTree and kMDItemKind look like?

Try installing the free trial of http://marked2app.com
Does this change kMDItemContentTypeTree?

Best,

Pierre Bernard
Houdah Software s.à r.l.

Houdah Software s. à r. l.
https://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Advanced file search utility
Tembo: Easy and effective file search
0 0
birnle
I have found an easy solution: On http://brettterpstra.com/2011/10/18/fixing-spotlight-indexing-of-markdown-content/ Brett Terpstra describes how to get md file contents into Spotlight. You just need to download his Markdown Spotlight Plugin, unzip it to ~/Library/Spotlight/ and write/copy one terminal command to the Terminal. Now  it works!

Thank you for your lightning fast help! [smile] And thank you, Brett, if you read this!

birnle
0 0