Loading...

All project content is available for reading, but you need to be a member of the project for Subversion checkout of source code, or to create/modify any information.
Login if you are a member. Apply here to request membership (open to all).

Syntax Highlighting and Coloring

Language-specific syntax highlighting of source code in wiki formatted text and the repository browser is supported.

Source Browser

In the source browser the syntax highlighting is automatic, and based on the file extension for each file.

Usage for inclusion in Wiki text

Syntax coloring is supported in pre-formatted text by using #! in the first line to indicate text format (mime type), and it calls the corresponing formatter to output the correctly highlighted text.

Examples

Python

{{{
#!python
def my_procedure(name):
    print "Have a nice day, " + name + "."
}}}

Produces the following output:

def my_procedure(name):
    print "Have a nice day, " + name + "."

CSS

{{{
#!text/css
.code-block span {
 font-family: monospace;
}
}}}

Produces the following output:

.code-block span {
 font-family: monospace;
}

Supported code

List of supported types:

MIME TypesExtensions
application/javascriptjs
application/pdfpdf
application/postscriptps
application/rss+xmlrss
application/rtfrtf
application/x-cshcsh
application/x-shsh
application/x-troffnroff roff troff
application/x-yamlyaml yml
application/xsl+xmlxsl
application/xslt+xmlxslt
image/svg+xmlsvg
image/x-iconico
model/vrmlvrml wrl
text/csscss
text/htmlhtm html
text/plainAUTHORS COPYING ChangeLog INSTALL README RELEASE TXT text txt
text/x-actionscriptas
text/x-adaada
text/x-asmasm
text/x-aspasp
text/x-awkawk
text/x-c++hdrH HH c++hdr hh hpp
text/x-c++srcC C++ CC c++ c++src cc cpp
text/x-chdrchdr h
text/x-common-lispcl lisp
text/x-csharpC# c# cs csharp
text/x-csrcc csrc xs
text/x-diffdiff patch
text/x-eiffele eiffel
text/x-elispel elisp
text/x-erlangerl hrl
text/x-fortranf fortran
text/x-haskellhaskell hs
text/x-idlidl
text/x-infinf
text/x-inicfg ini
text/x-javajava
text/x-kshksh
text/x-lualua
text/x-m4m4
text/x-mailmail
text/x-makefileGNUMakefile Makefile make makefile mk
text/x-objcm mm objc
text/x-ocamlml mli ocaml
text/x-pascalpas pascal
text/x-perlPL perl pl pm
text/x-phpphp php3 php4
text/x-psppsp
text/x-pyrexpyrex pyx
text/x-pythonpy python
text/x-rfcrfc
text/x-rstrst
text/x-rubyrb ruby
text/x-schemescheme scm
text/x-sqlsql
text/x-tcltcl
text/x-textex
text/x-textiletextile txtl
text/x-trac-wikiwiki
text/x-vbabas vb vba
text/x-verilogv verilog
text/x-vhdlvhd vhdl
text/x-zshzsh
text/xmlascx asmx aspx config csproj disco map master mxml resx sitemap wsdl xml

If you need highlighting for other types of files, then please ContactUs.