Installed CodeHighlighter plugin. Worked great.
Usage
- Put the code snippet to pre tag.
- Add the lang attribute to the pre tag like the following.
<pre lang="cpp">
- Add the lineno attribute to the pre tag after the lang tag like the following if you want to display line numbers. The number in the lineno tag becomes a start line number. There is no default value for the start line number. So you must supply the value to the lineno tag.
<pre lang="cpp" lineno="1">
- If you do not add lang attribute, the pre tag is handled normally.
- If you want to have border, add the style like the following to your .css file.
pre { border: 1px dotted #ccc; padding: 0.2em 0.5em; }
- You can use following languages in lang.
actionscript, ada, apache, asm, asp, bash, c, c_mac, caddcl, cadlisp, cdfg, cpp, csharp, css, delphi, html4strict, java, javascript, lisp, lua, mpasm, nsis, objc, oobas, oracle8, pascal, perl, php, python, qbasic, sas, smarty, vb, vbnet, visualfoxpro, xml