Code Syntax Highlighting plugin for WordPress


Just thought I would share how I got syntax highlighting to work on the previous post on XAJAX.

Check out the WordPress plugin wp-syntax. Blurb:

WP-Syntax provides clean syntax highlighting using GeSHi — supporting a wide range of popular languages. It supports highlighting with or without line numbers and maintains formatting while copying snippets of code from the browser.

Setup:

    1. Install the plugin
    2. Activate it
    3. Example usage:
<pre lang="java">
public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}
<pre>

Result:

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

This entry was posted in Software, Tech. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *