To do this, Trac uses external libraries with support for a great number of programming languages.

5

6

Currently Trac supports syntax coloring using one or more of the following packages:

7

8

* [http://www.codento.com/people/mtr/genscript/ GNU Enscript]

9

* [http://silvercity.sourceforge.net/ SilverCity]

10

11

To activate syntax coloring, simply install either one (or more) of these packages. No additional configuration is required, however to modify the colors, have a look at `trac/htdocs/css/code.css`.

12

13

When in use, Trac will automatically prioritize !SilverCity highlighting over Enscript if possible, (see note below).

14

15

If neither package is available, Trac will display the data as plain text.

16

17

'''Note:''' Enscript supports a greater number of languages, however !SilverCity is generally faster since it is a library and isn't executed in an external process.

18

19

=== About SilverCity ===

20

!SilverCity uses the lexer from [http://www.scintilla.org/ Scintilla]. Scintilla supports more languages than !SilverCity implements. If you want to add a language to !SilverCity supported by Scintilla, it's not very difficult. See [http://projects.edgewall.com/trac/wiki/SilverCityAddLanguage SilverCityAddLanguage] for some information how.