CodeColorer is a syntax highlighting plugin which allows to insert code snippets into blog posts. Supports color themes, code in RSS, comments.
<code lang="lang">code</cc>syntax to insert code snippet into the post (you could skip
lang="lang", in this case code would be in CodeColorer's code block, but without syntax highlighting). Also you can use
[cci lang="lang"]code[/cci]to format inline code (see the "inline" option description).
To insert code snippet into your post (or comment) you should use
<code lang="lang">code</cc> syntax. Starting
from version 0.6.0 you could specify additional CodeColorer options inside
[cc lang="php" tab_size="2" lines="40"] // some code [/cc]
Note: You should always use double quotes or single quotes around the parameter value. Boolean values could be passed using string true or false, on or off, number 1 or 0.
Starting from CodeColorer 0.8.6 you can use short codes to insert code
snippets. The short code in common looks like
[ccM_LANG], where LANG is
your programming language, and M is the one or more of following modes:
Small letter means enabled, capital – disabled. Examples:
PHP code with links enabled and line numbers disabled:
[cclN_php] echo "hello" [/cclN_php]
Already escaped HTML code:
Ruby code without wrapping having tab size equal to 4:
[ccW_ruby tab_size="4"] attr_accessor :title [/ccW_ruby]
More examples could be found on the CodeColorer Examples page. You can find modes explained below.
[will be treated as encoded (in this example as
You can use special tag
[cci] instead of
[cc] to force inline mode:
[cci lang="php"]some code[/cci]
Most of these parameters could be configured via the CodeColorer options page.
To insert example of CodeColorer short codes you can use something like this:
[cce_bash] &#91;cc lang="html"] <title>CodeColorer short code colorized</title> &#91;/cc] [/cce_bash]