Syntax highlighting broken.

Lukas Fleischer cgit at cryptocrack.de
Wed Aug 14 14:24:46 CEST 2013


On Wed, Aug 14, 2013 at 07:47:55AM -0400, Jason A. Smith wrote:
> On Wed, 2013-08-14 at 12:53 +0200, Lukas Fleischer wrote:
> > As you already said, it is an *example* script. It even includes a
> > comment mentioning that the CSS must be adapted when using that script:
> > 
> >     # Note: the highlight command (http://www.andre-simon.de/) uses css for syntax
> >     # highlighting, so you'll probably want something like the following included
> >     # in your css file (generated by highlight 2.4.8 and adapted for cgit):
> >     #
> >     # table.blob .num  { color:#2928ff; }
> >     # table.blob .esc  { color:#ff00ff; }
> >     # table.blob .str  { color:#ff0000; }
> >     # table.blob .dstr { color:#818100; }
> >     # table.blob .slc  { color:#838183; font-style:italic; }
> >     # table.blob .com  { color:#838183; font-style:italic; }
> >     # table.blob .dir  { color:#008200; }
> >     # table.blob .sym  { color:#000000; }
> >     # table.blob .kwa  { color:#000000; font-weight:bold; }
> >     # table.blob .kwb  { color:#830000; }
> >     # table.blob .kwc  { color:#000000; font-weight:bold; }
> >     # table.blob .kwd  { color:#010181; }
> > 
> > I don't know what all the fuss is about.
> 
> The fuss is because it was removed which broke what is currently the
> only was to achieve syntax highlighting for some. An easy way to restore
> the old working behavior would be preferable, without having to manually
> hack the default installed css. Manually editing a non-config file
> installed by a package is not the best way to go about doing things.

If the style sheet is a non-config file, how do you change the
appearance of the cgit site? Change the CSS in the source tree, commit
on a separate branch, recompile and reinstall?

To me, the cgit.css that gets installed when running `make install` is
just a default config file that needs to be adjusted depending on the
layout requirements and copied to a proper place. Hence, it is fine to
have a CSS that works with the default cgit and can easily be adjusted
to work with any non-default website layout or any non-default cgit
filters. If the default cgit.css ever gets updated, you can use a
default config merge tool like you do for config files of other software
packages.

> Another config option, which could be used to select an additional css
> to be used for syntax highlighting would be more useful, and could be
> used by any of the highlighting methods now supported.
> 
> > What we could do is add the style sheet back as a separate file and add
> > a commented out "@import" of that file to the main CSS. This might make
> > it a bit more convenient for administrators to reintroduce the colors. I
> > don't think it is absolutely needed, though, so this gets a +/-0 from
> > me.
> 
> Still would require manually hacking a non-config file from an installed
> rpm package for us. The next time this package gets updated, it is
> broken again unless we remember to hack the file after the package is
> updated.
> 
> 
> _______________________________________________
> CGit mailing list
> CGit at lists.zx2c4.com
> http://lists.zx2c4.com/mailman/listinfo/cgit


More information about the CGit mailing list