cseverino / qlcolorcode

Automatically exported from code.google.com/p/qlcolorcode
0 stars 0 forks source link

Add Quick Look Support for Apache Configuration Files (.htaccess) #56

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I would like to see Quick Look support added for Apache Configuration files, 
most notably 
.htaccess:

    1) Name of Language: Apache Configuration Syntax
    2) File Extensions: .htaccess, .httpd, .conf
    3) Website: http://httpd.apache.org/docs/2.2/mod/quickreference.html

Quick Look recognizes files ending with .httpd, thanks to the built-in language 
support in 
Highlight:

    Highlight Supported Hanguages (httpd: Apache Config)
    http://www.andre-simon.de/doku/highlight/en/highlight_langs.html

However, neither qlcolorcode nor Quick Look previews files ending in .htaccess, 
despite 
following the FAQ advice and by adding a section in my 
~/Library/QuickLook/QLColorCode.qlgenerator/Contents/Info.plist

qlmanage -p .htaccess 2>&1 | grep 'Generator used'
qlmanage[605:5307] [QL] Previewing .htaccess. Content type UTI: public.data. 
Generator used: 
None
qlmanage[605:5e07] [QL] Thumbnailing .htaccess -- (512 x 512). Content type 
UTI: public.data. 
Generator used: None

<dict>
    <key>UTTypeConformsTo</key>
    <array>
        <string>public.source-code</string>
    </array>
    <key>UTTypeDescription</key>
    <string>Apache Configuration File</string>
    <key>UTTypeIdentifier</key>
    <string>com.apple.traditional-mac-plain-text</string>
    <key>UTTypeTagSpecification</key>
    <dict>
        <key>public.filename-extension</key>
        <array>
            <string>htaccess</string>
        </array>
    </dict>
</dict>

BBEdit and TextMate are two of the most popular programs that can support 
.htaccess files -- 
see:

Apache Configuration Language Module for BBEdit
http://daringfireball.net/projects/apacheconfig/

Original issue reported on code.google.com by r...@ryanjbonnell.com on 22 Dec 2009 at 3:50

GoogleCodeExporter commented 8 years ago
htaccess is the name of a hidden file, not a file extension. 
The leading "dot" signifies hidden. 

I too want a QuickLook solution for htaccess hidden files. 
However, my attempt did not work either, when I added the following key to 
Info.plist (UTI="public.data" based on Get Info for .htaccess; filename 
extension blank). Any other ideas?

        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.data</string>
            </array>
            <key>UTTypeDescription</key>
            <string>htaccess</string>
            <key>UTTypeIdentifier</key>
            <string>public.data</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string></string>
                </array>
            </dict>
        </dict>

Original comment by jonesl...@gmail.com on 27 Oct 2010 at 9:03

GoogleCodeExporter commented 8 years ago
I could do this by editing
1. Contents/Info.plist: added <string>public.data</string> under the array of 
<key>LSItemContentTypes</key> 
2. Contents/Resources/override/config/filetypes.conf: added $ext(httpd)=conf 
htaccess

Hope this helps.

Original comment by kohei.yo...@gmail.com on 3 Sep 2011 at 6:45