Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Need help with syntax highlighting within cgit

by ron.savage (Novice)
on Oct 14, 2009 at 22:47 UTC ( #801231=perlquestion: print w/ replies, xml ) Need Help??
ron.savage has asked for the wisdom of the Perl Monks concerning the following question:

Hi Folks I'm trying to implement Perl syntax highlighting within cgit, after reading this fascinating post: http://www.cantrell.org.uk/david/journal/index.pl/id_cgit-syntax-highlighting. But the highlighter is not being called. Code is displayed as plain text, without e.g. line numbers. He's my cgitrc:
virtual-root=/cgit cache-root=/tmp/cgit/cache cache-size=1021 snapshots=tar.gz tar.bz zip enable-log-filecount=1 enable-log-linecount=1 summary-log=5 summary-branches=5 summary-tags=5 css=/cgit/cgit.css logo=/cgit/cgit.png max-repo-count=100 source-filter=/home/ron/bin/perl.hiliter.pl repo.url=Acute-ProcessPostScript repo.path=/home/ron/perl.modules/Acute-ProcessPostScript/.git repo.desc=Acute::ProcessPostScript # All following lines are 3 per module, as above.
Here's the hiliter (perl.hiliter.pl):
#!/usr/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 -nssc - +nnn" } else { system "cat -n"; }
David's code has -nss but perltidy, v20090616 only has ssc, so I assume that's what he meant. This option has no effect on my lack of highlighting. perl.hiliter.pl is executable:
507 ron@zephyr:~/httpd/prefork$ dir /home/ron/bin/perl.hiliter.pl -rwxr-xr-x 1 ron ron 207 2009-10-15 09:36 /home/ron/bin/perl.hiliter.p +l*
Changing it's permissions to 777 had no effect. I'm running cgit.cgi from Apache's cgi-bin/ dir. TIA. Ron

Comment on Need help with syntax highlighting within cgit
Select or Download Code
Re: Need help with syntax highlighting within cgit
by Khen1950fx (Canon) on Oct 14, 2009 at 23:42 UTC
    Stay with -nss. The -nss flag has to do with style sheets, while the -nssc flag refers to static side comments which isn't what you want here. You'd use -nss to create a web page without style sheets so that older browsers can display the syntax-coloring of the html.
      Hi Well, I'm confused. Perltidy doesn't have a -nss option, nor a -noss (guessing). And it makes no difference what I use there since the script isn't being called. And since I'm using FireFox 3.0.12, I'm not worried about the age of the browser. And I'm the only one with access to cgit. Cheers

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://801231]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2014-07-22 21:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (128 votes), past polls