[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cgit syntax highlight request

From: Ian Kelling
Subject: Re: cgit syntax highlight request
Date: Fri, 28 Apr 2023 17:45:02 -0400
User-agent: mu4e 1.9.0; emacs 29.0.50

Bob Proulx <> writes:

> [[PGP Signed Part:Undecided]]
> Savannah Users,
> A user on IRC (daviid) has requested that cgit on Savannah be modified
> to perform syntax highlighting by default on the various source page
> display pages.
> I did some research into this topic of cgit syntax highlighting.  It
> seems there are two popular ways to enable syntax highlighting in
> cgit.  One uses the Python "Pygments" and one uses the standalone
> "highlight" utility.
> On IRC there were various comments about pygments and previous
> security vulnerabilities it has been through.  The other option using
> "highlight" I note is packaged for Debian and therefore if any
> security vulnerabilities were found that the security channel would
> normally provide a patch which would be quickly installed on our
> systems.  Therefore in my opinion using "highlight" would be the best
> option.

I agree. I actually got a patch into git for it's gitweb interface so
that it uses highlight as it's syntax highlighter. I think it used
pygments before, I can't remember for sure. Anyways, I did it because
highlight detected bash scripts and highlighted them, whereas the
previous highlighter did not.

> I tried it with both dark and light themes and it seems acceptable in
> either.  Which is important to me personally as I almost always use a
> dark theme when possible.
> Personally I rather prefer the non-colorized display.  Colors are one
> of those bike-shed items that everyone wants to be different.
> Therefore the common ground is often the no-color option.  I much
> prefer if people clone to their own sandbox and then they can use
> their own preferences for all bike-shed things like colors and fonts.
> But this is a shared resource and everyone is using it as a commons
> area.  I will bring the topic up for discussion.
> What is the opinion of the group at this time?  Should we enable
> syntax color highlight in cgit by default?

I'd prefer colorized output, but, first you should check the resource
use. When I made the git change, I found that highlight and pygments (i
think) had roughly equivalent performance, but I was surprised how much
cpu time they took up. So, I suggest check the page load time difference
for a few files: the extra time will be 100% cpu use of a forked

> Should we leave color as
> it is now without?  Should we try it for a time period and see how it
> is received?  What would the users like to see here?
> Bob
> [[End of PGP Signed Part]]

reply via email to

[Prev in Thread] Current Thread [Next in Thread]