Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add syntax highlighting #127

Open
foliovision opened this issue Aug 31, 2021 · 4 comments
Open

Feature Request: Add syntax highlighting #127

foliovision opened this issue Aug 31, 2021 · 4 comments

Comments

@foliovision
Copy link

foliovision commented Aug 31, 2021

QuickLookStephen has been very helpful in allowing me to preview XMP files which Affinity Photo (Serif) was hijacking without providing a Quick Look parser.

What would make me very, very happy would be to enjoy syntax highlighting for these XMP files. XMP is an XML based language so the code library is probably built into the OS.

I'd be open to installing a separate plugin for XMP with code highlighting if that's what it takes. I could partially sponsor an enhancement of QuickLookStephen to include code highlighting for the plain text and code files shown, based on file extension.

State of the Art

A Markdown QuickLook preview plugin I use chooses to interpret the Markdown before previewing the document. HTML QuickLook preview is similar: interpreted version, not highlighted code. Javascript and CSS files on my computer are just shown as plain text with no highlighting (perhaps thanks to QuickLookStephen, I don't have a vanilla install handy to compare).

QLColorCode looks promising but when I installed it, instead of getting syntax highlighted CSS and JS files, text preview was completely disabled and I only received an icon and recommendation to open the file in BBEdit.

QLColorCode-icon-view-1

QLColorCode-icon-view-2

XMP continued to offer text previews. I was prepared to add "com.seriflabs.xmp" as an ID in QLColorCode but I expect that would just kill text previews for QLColorCode. Removed QLColorCode and flushed QuickLook and am back to text previews at least. I also took a look at TextMate syntax highlighting but again removing QuickLookStephen managed to kill text preview completely and send me back to icons. That included moving the TextMate TextMateQL.qlgenerator to ~/Library/QuickLook and reinitiating QuickLook with qlmanage -r, qlmanage -r cache and restarting the Finder.

Someone who understands QuickLook as well as the QLStephen team will have to look into syntax highlighting as it doesn't appear to work out of the box in OS X 10.14.6 with any of the existing patches. I'm grateful to have QuickLookStephen plain text preview!

@sbarex
Copy link

sbarex commented Sep 17, 2021

Hi, my app support many syntax highlight. At the moment do not handle the xmp format, but it wouldn't be hard for me to support it

@foliovision
Copy link
Author

Hi @sbarex. Thanks for letting me know about SourceCodeSyntaxHighlighting. For the foreseeable future, I've got Macs on High Sierra and Mojave. I only have one on Catalina and it's a test device. Perhaps you could add an XMP module for SourceCodeSyntaxHighlighting which could easily be adapted to QLStephen as you seem to be familiar with the code for QLStephen as well.

@sbarex
Copy link

sbarex commented Sep 19, 2021

Hi @foliovision, the qlstephen generator is designed to handle text files without syntax highlight.

Since you still use the old versions of macOS then you can try the QLColorCode to preview source files which should be compatible with your system.

I don't know if it handles xmp files.

@foliovision
Copy link
Author

Thanks @sbarex. Apparently SourceCodeSyntaxHighlight has much better Big Sur and Monterrey support. I've decided to jump in with the M1 Pro MBP which are Monterey minimum as finally Apple has a laptop which is capable, has a decent keyboard, reasonable number of ports and doesn't run the fans all the time. SourceCodeSyntaxHighlight runs as a background app to avoid most of the permissions issues related to extensions. There are some very detailed instructions on installation and use on recent OS as well as very active development.

Big thanks to all of QLColorCode, QLStephen and SourceCodeSyntaxHighlight developers for making it possible to better use the macOS Finder as a developer and/or pro user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants