Install CodeHighlighter

Installed CodeHighlighter plugin. Worked great.

Usage

  1. Put the code snippet to pre tag.
  2. Add the lang attribute to the pre tag like the following. <pre lang="cpp">
  3. 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">
  4. If you do not add lang attribute, the pre tag is handled normally.
  5. 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; }
  6. 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
This entry was posted in wordpress. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.