toland / qlmarkdown

QuickLook generator for Markdown files.
3.25k stars 142 forks source link

OS X 10.7.4 broken #13

Closed ngemily closed 12 years ago

ngemily commented 12 years ago

Hi, I'd love to have this plugin. I've tried

but QuickLook still shows the plaintext *.md

lukereative commented 12 years ago

I'm on 1.7.4 and it's working fine. Just making sure you ran the qlmanage -r command after putting it in the 'QuickLook' directory? Also if you have QLStephen (a plaintext quick look plugin) that it is not overriding QLMarkdown and making it display as plaintext.

ngemily commented 12 years ago

Yep, ran that from zsh And I do not have QLSteven

dbr commented 12 years ago

If you run the following, it will show you what Quicklook generators are registered, and what one is being used:

$ echo "* test" > test.md
$ qlmanage -p -d 1 test.md

You should see something like:

[DEBUG] Previewing file://localhost/Users/dbr/test.md. Content type UTI: net.daringfireball.markdown. Generator used: <QLGenerator /Users/dbr/Library/Quicklook/QLMarkdown.qlgenerator>

You can also change -d 1 to -d 4 and it lists all available QLGenerators, an what UTI they are registered for

ngemily commented 12 years ago

okay, it's trying to use the qlgenerator packaged with iA Writer

ngemily commented 12 years ago

Sweet Had to compile it myself from xcode for 64bit version but cool. I've replaced the iA Writer version with that. I didn't realize how to use debug mode earlier. Thanks for all the speedy help!

claf commented 12 years ago

Hi, It seems I'm having the same trouble with iA Writter qlgenerator. Just wondering how to choose the generator to use when multiple avaliable? @ngemily did you simply override iA Writer one with toland 's one?

ngemily commented 12 years ago

yup, I just replaced iA's files with toland's

dbr commented 12 years ago

If you want to keep iA's generator for other stuff, you could try editing it's Info.plist

Assuming it's an non-binary plist, opening it in a text-editor and remove the lines that look like these, leaving the extensions you still want iA to handle.

If it's a binary plist, you need to edit it with the Plist-editor application from Xcode

If the app bundle is signed, it might cause problems

Hm, I wonder if the location of the generators dictates priority? E.g if you put qlmarkdown in ~/Library/QuickLook and move iA's to /Library/QuickLook, will qlmarkdown override? Might be worth testing first (remembering to run qlmanage -r first)

claf commented 12 years ago

Thanks for the quick answer @ngemily

@dbr thanks for the tips, I did edit the Info.plist and removed the lines you mentioned, then qlmanage -r and killall Finder. Still iA Writer's QL generator used. Then I tried to move this generator to /Library/QuickLook having qlmarkdown in ~/Library/QuickLook/ and guess what, it works!

I'll go with this solution even if I think there should exist a way to "rank" qlgenerators when multiple available for a file type.

Thanks again!

dbr commented 12 years ago

Editing should have worked, but it's possible that qlmanage -r doesn't fully refresh it..

..but moving them around is a "better" (if not ideal) solution, as this StackOverflow answer confirms (the qlgenerators are ranked based on their location, and if there is multiple in the same location, the chosen one is kind of random)

claf commented 12 years ago

Thanks for this information!