CGIT is a free and simple webby front-end to let people browse your git repository without having to check out a copy of your code to their machine. I chose to use it because it's dead simple - build a single CGI, put it somewhere that your web sewer can read it, and write a simple config file. Job done, no complicated libraries to build, it Just Works. And because it's written in C, it's fast and consumes few resources.
It doesn't do syntax highlighting when displaying code. But it does have a facility to run any blobs of code through a filter before displaying them, so you can easily put your own filter in place to do the highlighting for you. To configure it, simply put something like this:
source-filter=/web/www.cantrell.org.uk/cgit/highlighter
in your /etc/cgitrc. And the script reads:
#!/usr/local/bin/perl use warnings; use strict; my $file = shift; if($file =~ /\.(p[ml]|t)$/i) { system "/usr/local/bin/perltidy -html -st -ntoc -npod -pre -nss -n +nn" } else { system "cat -n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Syntax highlighting in CGIT
by doug (Pilgrim) on Aug 17, 2009 at 17:31 UTC | |
by DrHyde (Prior) on Aug 18, 2009 at 09:39 UTC | |
|
Re: Syntax highlighting in CGIT
by Bloodnok (Vicar) on Aug 17, 2009 at 13:17 UTC | |
|
Re: Syntax highlighting in CGIT
by bduggan (Pilgrim) on Aug 21, 2009 at 18:06 UTC |