Integrates GeSHi - the Generic Syntax Highlighter - into Nucleus CMS. GeSHi can highlight code from several programming languages.
| General Plugin info | |
|---|---|
| Current Version: | v0.1 |
| Download: | Download NP_GeSHi2_v01.zip |
| Code: | NP_GeSHi2_code |
| Demo: | Article with highlighted code |
| Forum Thread: | Thread 80622 |
Install the plugin:
Install the GeSHi library:
The GeSHi library must be downloaded separately from the GeSHi web site: http://qbnz.com/highlighter/
If you extract the GeSHi zip file from sourceforge.net you have serveral files in a folder geshi:
-geshi --contrib --doc --geshi -geshi.php
To use GeSHI you only need to copy:
-geshi --geshi -geshi.php
In the subfolder --geshi are the highlight definitions for serveral programming languages.
If you don’t won’t all you can save disk space by only copy the files for the languages you need (e.g. php.php).
GeSHi2 can hihglight code blocks with:
<pre class="languageName">...</pre>
E.g. for PHP code:
<pre class="php">...</pre>
GeSHi2 can also highlight inline code with
<code class="languageName">...</code>
E.g. for PHP code:
<code class="php">...</code>
The pre and code tags will replaced with div and span tags and the enclosed code will be highlighted with the GeSHi library.
You can add inline styles to the surrounding div and span tags of the highlighted code. E.g. if you wan’t a grey background for the code you can use these settings:
Change the Header for pre to
<div class="###language###" style="border:solid 1px #ccc; background-color:#eee; padding:2px 4px;">
change the Header for code to
<span class="###language###" style="background-color:#eee;">
You can see the effect of these setting in the demo: Article with highlighted code.
NP_GeSHi2 version 0.1 works with Nucleus CMS version 3.31 - 2007-11-28 kg