sbarex / SourceCodeSyntaxHighlight

Quick Look extension for highlight source code files on macOS 10.15 and later.
GNU General Public License v3.0
2.89k stars 72 forks source link

Support .cfg, .strings, .stringsdict, .inf, .class file #29

Closed i0ntempest closed 4 years ago

i0ntempest commented 4 years ago

mdls outputs: .strings

kMDItemContentType     = "com.apple.xcode.strings-text"
kMDItemContentTypeTree = (
    "public.item",
    "public.text",
    "public.data",
    "com.apple.xcode.strings-text",
    "public.content"
)

.stringsdict

kMDItemContentType     = "com.apple.xcode.strings-dictionary"
kMDItemContentTypeTree = (
    "public.item",
    "com.apple.property-list",
    "public.data",
    "com.apple.xcode.strings-dictionary"
) 

You'll need plutil as a preprocessor to decompile binary plists in the above extensions, so highlight can deal with them as xml: /usr/bin/plutil -convert xml1 -o - ${target} .cfg (There might be a dynamic type for this if you don't have bbedit installed)

kMDItemContentType     = "com.barebones.bbedit.ini-configuration"
kMDItemContentTypeTree = (
    "public.source-code",
    "public.data",
    "public.plain-text",
    "public.item",
    "public.content",
    "public.text",
    "com.barebones.bbedit.ini-configuration"
)

.inf is already supported but not highlighted, it should use ini syntax. .class files need a preprocessor or quicklook with display a blank page. javap -c ${target} can show byte code of a .class file. Info.plist in my fork of QLColorCode contains more extensions if you want to take a look. Thanks in advance.

sbarex commented 4 years ago

Thanks. On the next release I will support these file format

sbarex commented 4 years ago

I have added the support for .strings, .cfg, .ini on the last release (1.0.b20). Also the support for .class file is enhanced.

i0ntempest commented 4 years ago

Thanks for the update. What's the reason for not supporting *.stringsdict though?

sbarex commented 4 years ago

oh sorry... I forgot it! Support added on beta 21.