Plugin Code | |
This wiki plugin is used to display any source code (including wiki syntax) on a page without it being processed. The code is displayed in a gray box in a fixed-width monospaced font. A title can be added to the box and line numbers added. Syntax highlighting is also available, since Tiki7 using CodeMirror and using GeSHi before that. Note about Wiki Argument Variables Wiki argument variables like {{page}} will be interpreted inside any wiki plugin or wiki syntax. To display a wiki argument variable you can escape the first bracket using the np (non parseable) tag: ~np~{~/np~{page}} .
|
Parameters | |||||||||||||||||||||||||||||||||||||||||||||
Display code with syntax highlighting and line numbering. Introduced in Tiki 1. Go to the source code Preferences required: wikiplugin_code
|
Syntax highlighting | |
To activate syntax highlighting and enjoy most of the options (lines number, colors, etc), the Code editor (CodeMirror) feature must be enabled at See the list of CodeMirror supported languages that can be used for the Tip If you need a mode that keeps tab spacing, you can use, for instance, mode scss . |
Example | |
PHP with line numbers | ||
This code: Copy to clipboard
Would produce: Copy to clipboard
|
Tiki syntax highlighting | |
Tiki syntax is supported too.
Copy to clipboard
Would produce: Copy to clipboard
|
Legacy GeSHi Documentation (deprecated in Tiki8) | |
[+] Starting in Tiki7, CodeMirror was added as experimental for Syntax Highlighting, and in Tiki8, it became the default syntax highlighting. Geshi is no longer supported. Note For the color highlighting to work for php when GeSHi is not installed and you are using Tiki6 or earlier versions, it's important to include the php tag at the beginning. |
Installing GeSHi | |
Since GeSHi has been licensed under GPL - which is incompatible with Tiki's LGPL license - the administrator will need to manually download a copy of GeSHI. It appears the project now uses GitHub for the repository.
Copy to clipboard
You could alternatively install the stable version of GeSHI with the Debian/Ubuntu package |
Supported languages | |
To be certain which languages your installation of GeSHi covers, check the language files in directory where GeSHi was installed. See the this GitHub repository language folder for example. The exact name of the language file (without the .php extension) is used to specify the language in the |
Related pages | |
Aliases | |