[Top][All Lists]

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

Re: [Savannah-hackers-public] cgit syntax highlight request

From: Corwin Brust
Subject: Re: [Savannah-hackers-public] cgit syntax highlight request
Date: Sat, 29 Apr 2023 12:26:43 -0500

On Fri, Apr 28, 2023 at 4:45 PM Ian Kelling <> wrote:
> 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

Thanks for looking into 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 also agree.

> >
> > 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
> process.

+1 for all of this.  Especially, I also like colors and will pay CPU
loads some attention, if we start giving them.

> > 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?
> >

My preference is to enable this on an experimental basis, watching it
closely when we turn it on and, perhaps, taking discussing further
analysis and thoughts regularly, such as as a standing point at the
volunteer meeting for a few occurrences (ie, until terminated or
deemed stable).

> > Bob
> >
> > [[End of PGP Signed Part]]

reply via email to

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