Google Syntax Highlighter for WordPress

Uncategorized Add comments

Google Syntax Highligher for WordPress colorizes your code on-the-fly. It supports most programming/scripting languages such as C++, PHP, Perl, Ruby, and much more. The syntax is simple — just put your code inside <pre> tags and assign them the attributes name="code" and class="thelanguage".

The following code was tested:

<pre name="code" class="java">
public static void main(string[] args){
     System.out.println("Hello World Again!");
   }
</pre>

This is how it colorizes my code:


public static void main(string[] args){
     System.out.println("Hello World Again!");
   }

You can learn more more ways to customize your highlighted code in the Google code wiki entry on Usage - syntaxhighlighter. Also check out the full list of supported languages on Google Code.

Other code highlighters available are:

WP-Syntax - A plain and simple code highlighter.

Leave a Reply

You must be logged in to post a comment.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in