Changes between Version 8 and Version 9 of 0.12/TracSyntaxColoring
- Timestamp:
- Jul 16, 2012, 9:16:12 PM (12 years ago)
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 ** 2 2 = Syntax Coloring of Source Code = 3 [[TranslatedPages]] 3 4 Trac supports language-specific syntax highlighting of source code within wiki formatted text in [WikiProcessors#CodeHighlightingSupport wiki processors] blocks and in the [TracBrowser repository browser]. 4 5 … … 31 32 [[KnownMimeTypes]] 32 33 34 Note 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 36 In 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 38 HTML 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 40 If mimetype such as 'svn:mime-type' is set to 'text/plain', there is no coloring even if file is known type like 'java'. 33 41 34 42 === List of Languages Supported, by Highlighter #language-supported … … 44 52 || C# || || ✓ ^[#a1 (1)]^ || ✓ || 45 53 || C++ || ✓ || ✓ || ✓ || 54 || CMake || ? || ? || ✓ || 46 55 || Java || ✓ ^[#a2 (2)]^ || ✓ || ✓ || 47 56 || Awk || || ✓ || || … … 96 105 ''[=#a2 (2)] since Silvercity 0.9.7 released on 2006-11-23 97 106 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"]. 99 108 100 109 == Extra Software == 101 * GNU Enscript --http://directory.fsf.org/GNU/enscript.html102 * GNU Enscript for Windows --http://gnuwin32.sourceforge.net/packages/enscript.htm103 * !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/** 105 114 106 115 ----