Monday, October 14 in 2024
LEPTON CMS
Modul: FrontEnd CodeHighlighting (incl. x_find_class 0.1.6)
Author: Dietrich Roland Pehlke
Nick: aldus
Version: 0.1.7.4
State: Alpha
License: GNU - General Public License
Platform: 2.7
Last info: 2009-07-20
Rating:
54.0
541 votes
1 2 3 4 5
Download: here
Forum: here
Description: Based on an idea from Stefek for a simple modul for
including the google-code-prettyfy (http://code.google.com/p/google-code-prettify/)
this modul came up with a simple and easy way to do it.

Once you have installed the modul you only have to place this snipp of code inside your template:

if (function_exists("find_my_class") ) {
$path_to_js = WB_URL."/modules/fe-codehighlight/prettify.js";
$path_to_css = WB_URL."/modules/fe-codehighlight/prettify.css";
ob_start();
page_content();
$content = ob_get_contents();
ob_end_clean();
find_my_class($content, "pre", "prettyprint", $path_to_css, $path_to_js);
}


If you have to display code (php, js, c/++) on your page you only have to take
care about to place it inside at < pre class="prettyprint"> ... < /pre>" tag.

Info: Known issures:

- If you have already installed the "x_find_class"-modul you will have to deinstalled it before installing this one to avoid any conflicts.
If you have already a page that makes use of the "find_my_class" function it will not hurt anything; you can just keep it as it is.
See also: x_find_class

A very simple example



 /**
 *	You may use the following variable for debugging by setting it to true.
 */
$debug = false;
if (true == $debug ) {
	ini_set('display_errors', 1);
	error_reporting(E_ALL);
}