From: Tim Pope Date: Mon, 26 Jul 2004 02:16:55 +0000 (+0000) Subject: Added enscript hack for cvsweb X-Git-Url: http://git.tpope.net/?p=tpope-extra.git;a=commitdiff_plain;h=4c2d2e5111e5fe30a46c8406af1d7aef1031c1e8 Added enscript hack for cvsweb --- diff --git a/enscript/enscript.pl b/enscript/enscript.pl new file mode 100755 index 0000000..1253b27 --- /dev/null +++ b/enscript/enscript.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w +# $Id$ +# -*- perl -*- vim: ft=perl sw=4 sts=4 + +# This purpose of this script is to let enscript decide how to highlight a +# file when called by cvsweb, despite cvsweb's retarded insistance on making +# the decision itself. Presumably, it can be adapted to work with viewcvs as +# well, which has the same problem. + +# To use it, first tell cvsweb in cvsweb.conf to use this script for enscript: +# $CMD{enscript} = search_path('enscript.pl'); +# +# Then, to the contents of %enscript_types, add +# ' ' => qr/./o +# which forces cvsweb to always call enscript.pl. + +use strict; + +for(my $i=0;$i<=$#ARGV;$i++) { + $ARGV[$i] = "--highlight" if $ARGV[$i] =~ m/^--highlight= *$/; +} + +exec "/usr/bin/enscript", @ARGV; diff --git a/enscript/enscriptrc b/enscript/enscriptrc new file mode 100644 index 0000000..d8cc9dd --- /dev/null +++ b/enscript/enscriptrc @@ -0,0 +1,4 @@ +# On Debian, put the contents of this file in /var/www/.enscriptrc. This will +# override the default states configuration file. + +StatesConfigFile: /var/www/.enscript/hl/enscript.st