Syntax Highlighter

Just installed the Syntax Highlighter from Alex Gorbatchev, and like it quite a bit… here’s an example.

public int factorial( int number ) {
  if( number == 1 ) {
    return 1;
  }
  return number * factorial( number - 1 );
}

The key is to use a name=”code” and class=”java” (or xml, or others…) in your pre-tag. Add the javascript calls required for the feature, and your code shows up nicely on the web page…

For easy copy and paste:

<pre name="code" class="java">

</pre>