- Download and unpack plugin files to wp-content/plugins/codecolorer directory.
- If you have not used CodeColorer early, rename wp-content/plugins/codecolorer/codecolorer.css.in to wp-content/plugins/codecolorer/codecolorer.css.
- Enable "CodeColorer" plugin on your Plugins page in Site Admin.
- Go to the Options/CodeColorer page in Site Admin and change plugin's options as you wish.
- Use [cc lang="lang"]code[/cc] or <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 block, but without syntax highlighting).
- Have fun!
Syntax
To insert code snippet into your post (or comment) you should use [cc lang="lang"]code[/cc] or <code lang="lang">code</cc> syntax. Starting from version 0.6.0 you could specify additional CodeColorer options inside [cc] tag:
[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, number 1 or 0.
Possible parameters:
- lang (string) -- source language.
- tab_size (integer) -- how many spaces would represent TAB symbol.
- line_numbers (boolean) -- when true line numbers will be added.
- no_links (boolean) -- when false keywords will be represented as links to manual.
- lines (integer) -- how many lines would be block height without scroll.
- line_height (integer) -- line height in pixels to calculate block size.
All of these parameters could be configured via the CodeColorer options page.