|
Parameters | Accepted Values | Description | Default | Since |
---|---|---|---|---|
(body of plugin) | Code to be displayed | |||
caption |
text | Code snippet label. | 1 | |
colors |
text | Any supported language listed at http://codemirror.net/mode/. Pref feature_syntax_highlighter must be true for this to have any effect | 17 | |
wrap |
(blank) 1 0 |
Wrap lines of code which do not fit in the display box's width. Enabling avoids overflow or hidden line ends. | 1 | |
theme |
default| 3024-day| 3024-night| abbott| abcdef| ambiance-mobile| ambiance| ayu-dark| ayu-mirage| base16-dark| base16-light| bespin| blackboard| cobalt| colorforth| darcula| dracula| duotone-dark| duotone-light| eclipse| elegant| erlang-dark| gruvbox-dark| hopscotch| icecoder| idea| isotope| juejin| lesser-dark| liquibyte| lucario| material-darker| material-ocean| material-palenight| material| mbo| mdn-like| midnight| monokai| moxer| neat| neo| night| nord| oceanic-next| panda-syntax| paraiso-dark| paraiso-light| pastel-on-dark| railscasts| rubyblue| seti| shadowfox| solarized| ssms| the-matrix| tomorrow-night-bright| tomorrow-night-eighties| ttcn| twilight| vibrant-ink| xq-dark| xq-light| yeti| yonce| zenburn | Any supported theme listed at https://codemirror.net/demo/theme.html | 17 | |
ln |
(blank) 1 0 |
Show line numbers for each line of code. | 1 | |
rtl |
(blank) 1 0 |
Switch the text display from left to right, to right to left (left to right by default) | 1 | |
mediawiki |
(blank) 1 0 |
Encloses the code in an HTML code tag, for example: <code>user input<code> | 0 | 8.3 |
To activate syntax highlighting and enjoy most of the options (lines number, colors, etc), the Code editor (CodeMirror) feature must be enabled at Control Panels > Editing and Plugins > General Settings (tab) > Features (pane)
.
See the list of CodeMirror supported languages that can be used for the colors
parameter.
scss
. This code:
{CODE(colors="php")} <?php $menu = $menubar->getHomeMenu(); if($menu->link != "") { print "\t<td width=\"7%\" valign=\"top\">\n"; $menu->printMenu(); print "\t</td>\n"; } {CODE}
Would produce:
<?php $menu = $menubar->getHomeMenu(); if($menu->link != "") { print "\t<td width=\"7%\" valign=\"top\">\n"; $menu->printMenu(); print "\t</td>\n"; }
Tiki syntax is supported too.
This code:
{CODE(colors="tiki")} {img attId="57|58|59" desc="desc" alt="Sample Images" thumb="y" stylebox="float: left; margin-right:10px"} {CODE}
Would produce:
{img attId="57|58|59" desc="desc" alt="Sample Images" thumb="y" stylebox="float: left; margin-right:10px"}
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.
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.
Once you have you copy of Geshi, you should place it in your own tiki's lib/geshi/ directory, so that once placed there the folder structure is something like:
./lib/geshi/contrib/ ./lib/geshi/docs/ ./lib/geshi/geshi/ ./lib/geshi/geshi.php
You could alternatively install the stable version of GeSHI with the Debian/Ubuntu package php-geshi
(check if the version of the package is fresh enough for your needs, compared to the latest stable from their website or subversion repository).
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 colors
parameter.