UserGuide: SyntaxHighlighter plugin

SyntaxHighlighter plugin is based on GeSHi.

Use(Edit)

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

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.

Configuration(Edit)

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.

Download and installation(Edit)

Script plugin is not a part of official LionWiki distribution. Extract the archive to plugins/ directory and that's it.

  • SyntaxHighlighter 1.0 - for LionWiki >= 3.0.8 and <= 3.1.2
  • SyntaxHighlighter 1.1 - for LionWiki >= 3.2beta
    • Biggest change is support for caching and updated GeSHi
  • SyntaxHighlighter 1.1.1 - for LionWiki >= 3.2beta
    • Fix for bug which caused that displaying of "plain view" could be sometimes wrong
    • It's necessary to delete the content of cache directory, i.e. var/plugins/SyntaxHighlighter
  • SyntaxHighlighter 1.1.2 - new version of GeSHi and fix for codes at the start of the page