( dkgeshi documentation )

Installation and usage

Documentation has been updated on 01/31/2008

Description

dkGeshiPlugin (old sfGeshiPlugin) wraps the PHP library GeSHi to silently integrates it in symfony.

To use dkGeshi, you should always make an external link to the branch of current stable GeSHi version. to view all branches, please look at the link plugin source code

Branches names are made of {symfony-version}.{geshi-version}.{subrelease}

Installation

To install dkGeshiPlugin, you'll have to use the symfony-project.org repository. If your project does not use SVN, check it out by using the following in your project base directory.

svn checkout http://svn.symfony-project.com/plugins/dkGeshiPlugin/branches/1.0.1_0_7_20.0 plugins/dkGeshiPlugin

If your project is already using SVN, you can automatise the update process by using the svn:externals property.

svn propedit svn:externals plugins

Add the following line:

dkGeshiPlugin http://svn.symfony-project.com/plugins/dkGeshiPlugin/branches/1.0.1_0_7_20.0

Now it will update the plugin everytime you do a svn update, and you should do one right now to grab the plugin code.

You can notice that I'm now using branches, so if i do some experiments that break everything, it wont be updated in your project.

Usage

dkGeshi usage is super simple, so the following two lines will be sufficient for you to understand everything.

$highlighter = new dkGeshi('<?php echo "Hello World"; ?>', 'php');
echo $highlighter->parse_code();

The dkGeshi::getLanguages() static method now allows you to get an associative array of language identifier => human readable language name. This method is not built in the original GeSHi library, and needs symfony libraries to work.

You can view all available languages (and even write your owns) in the %SF_ROOT_DIR%/plugins/dkGeshiPlugin/geshi/ directory. Every other details you might want to know are in the original link GeSHi documentation