1. What is Highlight?
Highlight is a plugin for IncPlugins for programming languages source code highlighting.
2. Highlight installation
Download the latest Highlight release. It comes with IncPlugins Pro. Unzip it to any temporary directory. Copy highlight.php to your IncPlugins directory. Add the plugin include line to the IncPlugins settings file settings.php.
For best results you can download and install Simple plugin. When Highlight plugin is installed, Simple will highlight <pre> areas and highlighted blocks [~ ~] for you.
3. Using Highlight Directly
You can directly call this function:
function highlight($text, $language="html");
Example:
<?=highlight('function highlight($text, $language="html");','php')?>
This code will produce this HTML output:
4. Using Highlight with Simple
With Simple you can highlight your texts quickly. For details see the Simple User’s Manual. Example:
~php~ function highlight($text, $language="html"); ~~
5. Create your own Language Highlighting
To do it you should specify one of more special global arrays with keywords:
- $highlight_(name)_symbols — language symbols
- $highlight_(name)_values — language text values
- $highlight_(name)_comments — comment keywords
- $highlight_(name)_resw — reserved words
- $highlight_(name)_user1 — first extended user set of keywords
- $highlight_(name)_user2 — second extended user set of keywords
Here (name) is a name of your language, like: pascal, c++.
Example:
$highlight_custom_symbols = explode(',', '==^'); $highlight_custom_comments = explode(',', '**'); $highlight_custom_resw = explode(',', 'in,with'); $highlight_custom_user1 = explode(',', 'A'); $highlight_custom_user2 = explode(',', 'B,C');
To highlight <, > and & symbols use HTML entities.
You can also extend or modify standard HTML highligter, using these arrays:
- $highlight_html_tagnames — tag names
- highlight_html_tagvalues — tag values
These special arrays control highlightion of SGML/XML languages.
Note: You can disable standard arrays, using boolean variable $highlight_web_languages:
$highlight_web_languages = false;
6. Highlight Limitations
Highlight is very optimized for execute speed so it is very simple in highlight quality. It can only highlight separate keywords. But, anyway, you get perfect results and source code reading by your visitor.
You cannot:
- Highlight ; and & symbols in HTML-related languages
- Create syntax-based highlighting
- Separate highlighting keyword if it is available as a part of another word

