- Copy the phplighter folder to your website's sites/all/modules or sites/yoursite.com/modules directory.
- Download the PHPLigther package from https://github.com/brandonwamboldt/phplighter inside the module folder. You will have something like sites/all/modules/phplighter/PHPligther
Instead of download a zip, you can just clone the entire repository:
git clone git://github.com/brandonwamboldt/PHPLighter.git
- Enable the phplighter.module on the Modules page.
- Go to Configuration > Text formats. For each format you wish to add Code Filter to:
- Click the "configure" link.
- Under "Enabled filters", check the Code Filter checkbox.
- Under "Filter processing order", rearrange the filtering chain to resolve any conflicts. For example, to prevent invalid XHTML in the form of
<p><div class="phplighter">make sure "Code filter" comes before the "Convert line breaks into HTML" filter.
- Click the "Save configuration" button.
- (optionally) Edit your theme to provide a div.phplighter style for blocks of code
- (optionally) You can configure which theme use for this module by adding a custom CSS directly your settings.php file, i.e:
$conf['phplighter_theme'] = 'sites/all/themes/yourtheme/phplighter.css';
or using one of the provided by the PHPLighter package:
$conf['phplighter_theme'] = 'sites/all/modules/phplighter/PHPLighter/css/twilight.css';