UserGuide: SyntaxHighlighter plugin

This revision is from 2009/09/13 21:44. You can Restore it.

SyntaxHighlighter plugin is based on GeSHi.


{syntax php}
foreach($_REQUEST as $key => $value)

will produce:

PHP (plain)
  1. foreach($_REQUEST as $key => $value)
  2. unset($$key);

Of course, you can use a lot of other languages than PHP, check plugins/SyntaxHighlighter directory for full list. Note that name of the language corresponds to the filename, e.g. you must use "java5" because file is named "java5.php". LionWiki version of GeSHi is a little bit stripped of obscure languages. If you need some language present in original GeSHi package but not in LionWiki's, then simply copy desired language file to the plugins/SyntaxHighlighter directory.


You can set three things on the top of the plugins/wkp_SyntaxHighlighter.php: line numbers, plain text link and language name. GeSHi is however much much more powerful, you can set additional settings in the plugins code.

Firefox bug and line numbers(Edit)

Firefox and other Gecko based browsers suffer from bug which makes copy&paste of code with line numbers almost unusable. To overcome this, you can either turn off the line numbers or use the "plain text link" which leads to the plain text version of the source code which is possible to copy to clipboard in Firefox.