> onursafak.com / projects / gembox

Gembox Syntax Highlighter

A free javascript based client side syntax highlighter for web, allows code coloring on your web pages and blogs.
You can see a working example on Byte Hell.


Gembox is a full mod for well written Syntax Highlighter by Alex Gorbatchev.

This software is released under the GNU GPL.

- download v2.1.0 (61K .zip file) -


Installation :

Put the archive contents into a folder like http://mysite.com/sh

This goes into the head section of the page you want to enable highlighting on :

<link href='sh/shCore.css' rel='stylesheet' type='text/css'/>
<link href='sh/shThemeDefault.css' rel='stylesheet' type='text/css'/>

<script src='sh/shCore.js' type='text/javascript'></script>
<script type='text/javascript'>
dp.SyntaxHighlighter.ClipboardSwf = 'sh/clipboard.swf';
dp.sh.Settings.GlobalParams = {gutter : false, controls : false};

Replace sh/ with the path to your highlighter directory.

In the IncludeBrushes function call, include the brush names you want to enable, seperated by commas. Brush names are the parts after shBrush in the file names.

Eg: shBrushJScript.js is the brush file which includes definitons for javascript. In this case the brush name is JScript.


More configuration options :

Using GlobalParams you can define the appearance of all highlighted code in the page.


Usage :

Just surround the content to be highlighted with <pre> tags like :

<pre class="hl:js">
var myTestVar;

replace js with the alias of the language to be highlighted.

More description to be available soon.