After getting Gitosis set up on my Hackintosh, I set up gitweb as well. But vanilla gitweb is really ugly; it’s almost as bad as sitting at a console typing the git commands manually. So I spent a good day or so trying to tweak gitweb to work with SyntaxHighlighter. For the longest time, SyntaxHighlighter simply would not work on any page at all. After prodding for a while, I finally figured out that it was due to gitweb.cgi returning the content-type as “application/xhtml+xml” instead of “text/html”.
Click here to see a sample gitweb repository with SyntaxHighlighter enabled. Navigate around the projects, and click any of the language specific blob links (.c, .cs, etc) to see the new highlighting.
// This is SyntaxHighlighter, and
// it now works in gitweb!
Head over to my GitHub repository to get my git fork with the tweaked gitweb and instructions!
P.S. This was my first time hacking at Perl. I feel violated.
P.P.S. The Perl brush is intentionally disabled. It is a little buggy.