Edgewall Software

Changes between Version 8 and Version 9 of 0.12/TracSyntaxColoring


Ignore:
Timestamp:
Jul 16, 2012, 9:16:12 PM (12 years ago)
Author:
trac
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • 0.12/TracSyntaxColoring

    v8 v9  
    1 ** Note: this page was used to prepare the 0.12 version of wiki:/TracSyntaxColoring, see now directly that toplevel page **
     1** Note: this page documents the 0.12 version of Trac, see [[0.11/TracSyntaxColoring]] if you need the previous version **
    22= Syntax Coloring of Source Code =
     3[[TranslatedPages]]
    34Trac supports language-specific syntax highlighting of source code within wiki formatted text in [WikiProcessors#CodeHighlightingSupport wiki processors] blocks and in the [TracBrowser repository browser].
    45
     
    3132[[KnownMimeTypes]]
    3233
     34Note that the rich content may be directly //rendered// instead of syntax highlighted. This usually depends on which auxiliary packages are installed and on which components are activated in your setup. For example a `text/x-rst` document will be rendered via `docutils` if it is installed and the `trac.mimeview.rst.ReStructuredTextRenderer` is not disabled, and will be syntax highlighted otherwise.
     35
     36In a similar way, a document with the mimetype `text/x-trac-wiki` is rendered using the Trac wiki formatter, unless the `trac.mimeview.api.WikiTextRenderer` component is disabled.
     37
     38HTML documents are directly rendered only if the `render_unsafe_html` settings are enabled in the TracIni (those settings are present in multiple sections, as there are different security concerns depending where the document comes from). If you want to ensure that an HTML document gets syntax highlighted and not rendered, use the `text/xml` mimetype.
     39
     40If mimetype such as 'svn:mime-type' is set to 'text/plain', there is no coloring even if file is known type like 'java'.
    3341
    3442=== List of Languages Supported, by Highlighter #language-supported
     
    4452|| C#              ||                 ||  ✓ ^[#a1 (1)]^  ||  ✓  ||
    4553|| C++             ||  ✓              ||  ✓              ||  ✓  ||
     54|| CMake           ||  ?              ||  ?              ||  ✓  ||
    4655|| Java            ||  ✓ ^[#a2 (2)]^  ||  ✓              ||  ✓  ||
    4756|| Awk             ||                 ||  ✓              ||     ||
     
    96105''[=#a2 (2)] since Silvercity 0.9.7 released on 2006-11-23
    97106
    98 ''[=#a3 (3)] By default `.m` files are considered Objective-C files. In order to treat `.m` files as MATLAB files, add "text/x-matlab:m" to the "mime_map" setting in the [wiki:TracIni#mimeviewer-section "[mimeviewer] section of trac.ini"].
     107''[=#a3 (3)] By default `.m` files are considered Objective-C files. In order to treat `.m` files as MATLAB files, add "text/matlab:m" to the "mime_map" setting in the [wiki:TracIni#mimeviewer-section "[mimeviewer] section of trac.ini"].
    99108
    100109== Extra Software ==
    101  * GNU Enscript -- http://directory.fsf.org/GNU/enscript.html
    102  * GNU Enscript for Windows -- http://gnuwin32.sourceforge.net/packages/enscript.htm
    103  * !SilverCity -- http://silvercity.sf.net/
    104  * Pygments -- http://pygments.org/
     110 * GNU Enscript http://directory.fsf.org/GNU/enscript.html
     111 * GNU Enscript for Windows http://gnuwin32.sourceforge.net/packages/enscript.htm
     112 * !SilverCity http://silvercity.sf.net/
     113 * **Pygments — http://pygments.org/**
    105114
    106115----