I use cvs.drupal.org a lot to quickly look up stuff in other people's code, as well as to browse revisions etc. Enabling/adding code highlighting would make it much easier to navigate the content of the files. According to the ViewVC website, there are two options: 1) Highlight, or 2) GNU Enscript. I don't have any familiarity or preference towards either one, as long as they let me (and others) have syntax highlighting when viewing sources at cvs.drupal.org. :)

Comments

gerhard killesreiter’s picture

Project: Drupal.org site moderators » Drupal.org infrastructure

Interesting idea, Narayan, do you have an opinion on this?

add1sun’s picture

Just giving a ping to the idea because it would definitely be nice but I don't know what the backend tech. ramifications are. I do a *lot* of quick check of code online but often rue the code highlighting (lack thereof).

jpoesen’s picture

ViewVC 1.1 apparently plays nice with pygments, an open source syntax highlighter that seems way ahead of both Highlight and Enscript. Projects using it on their site include Trac and GitHub.

D.o. is on ViewVC 1.0.5 so we'd need to upgrade first.

Pygments supports many programming languages, template languages and other markup - the most useful for our purposes probably being:

  • php, javascript, html, css
  • bash, diff, gettext (.po files)
  • xml, sql

Quick setup pointers (unverified but should be generally correct):

Install python-pygments with apt-get/emerge/... or with easy_install, then:

In viewvc.conf:

# make sure other highlighting engines are disabled
use_enscript = 0
use_highlight = 0

# enable pygments
use_pygments = 1

Project site: http://pygments.org/

Freso’s picture

The mere fact that it is written in Python, gives it a plus from me. I'm already looking into writing a Drupal-specific lexer for it... :p

add1sun’s picture

Status: Active » Fixed

The recent move and update has added this for us nicely. Closing.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.