cmlenz@39: = Syntax Coloring of Source Code = cmlenz@39: Trac supports language-specific syntax highlighting of source code in [wiki:WikiFormatting wiki formatted] text and the [wiki:TracBrowser repository browser]. cmlenz@39: cmlenz@39: To do this, Trac uses external libraries with support for a great number of programming languages. cmlenz@39: cmlenz@39: Currently Trac supports syntax coloring using one or more of the following packages: cmlenz@39: cmlenz@39: * [http://people.ssh.fi/mtr/genscript/ GNU Enscript] cmlenz@39: * [http://silvercity.sourceforge.net/ SilverCity] cmlenz@39: cmlenz@39: 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`. cmlenz@39: cmlenz@39: When in use, Trac will automatically prioritize !SilverCity highlighting over Enscript if possible, (see note below). cmlenz@39: cmlenz@39: If neither package is available, Trac will display the data as plain text. cmlenz@39: cmlenz@39: '''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. cmlenz@39: cmlenz@39: === About SilverCity === cmlenz@39: !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. cmlenz@39: cmlenz@39: cmlenz@39: == Syntax Coloring Support == cmlenz@39: cmlenz@39: || || !SilverCity || Enscript || cmlenz@39: || Ada || || X || cmlenz@39: || Asm || || X || cmlenz@39: || * ASP || X || X || cmlenz@39: || * C || X || X || cmlenz@39: || * C++ || X || X || cmlenz@39: || * Java || || X || cmlenz@39: || Awk || || X || cmlenz@39: || CSS || X || || cmlenz@39: || Diff || || X || cmlenz@39: || Eiffel || || X || cmlenz@39: || Elisp || || X || cmlenz@39: || Fortran || || X || cmlenz@39: || Haskell || || X || cmlenz@39: || HTML || X || X || cmlenz@39: || IDL || || X || cmlenz@39: || Javascript || X || X || cmlenz@39: cmlenz@39: || m4 || || X || cmlenz@39: || Makefile || || X || cmlenz@39: || Matlab || || X || cmlenz@39: || Objective-C|| || X || cmlenz@39: || Pascal || || X || cmlenz@39: || * Perl || X || X || cmlenz@39: || * PHP || X || X || cmlenz@39: || PSP || X || || cmlenz@39: || Pyrex || || X || cmlenz@39: || * Python || X || X || cmlenz@39: || * Ruby || X || X (1) || cmlenz@39: || Scheme || || X || cmlenz@39: || Shell || || X || cmlenz@39: || SQL || X || X || cmlenz@39: || Troff || || X || cmlenz@39: || TCL || || X || cmlenz@39: || Tex || || X || cmlenz@39: || Verilog || || X || cmlenz@39: || VHDL || || X || cmlenz@39: || Visual Basic |||| X || cmlenz@39: || VRML || || X || cmlenz@39: || XML || X || X || cmlenz@39: cmlenz@39: ''(*) Supported as inline code blocks in [wiki:WikiFormatting Wiki text] using WikiProcessors.'' cmlenz@39: cmlenz@39: ''(1) Ruby highlighting is not included in the Enscript distribution. Highlighting rules for Ruby can be obtained from: http://neugierig.org/software/ruby/ cmlenz@39: cmlenz@39: == Extra Software == cmlenz@39: * GNU Enscript -- http://people.ssh.fi/mtr/genscript/ cmlenz@39: * !SilverCity -- http://silvercity.sf.net/ cmlenz@39: cmlenz@39: ---- cmlenz@39: See also: WikiProcessors, WikiFormatting, TracWiki, TracBrowser