This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Javascript Syntax Highlighter

Description

This plugin eases the use of Alex Gorbatchev’s SyntaxHighlighter, a lightweight javascript based code snippet highlighter within WordPress.

Supports a wide range of languages currently including:= Feature summary =

  • 100% client side, no server dependency
  • Multiple languages support
  • Wide browser support
  • Very lightweight

Languages Supported

  • AS3
  • Bash
  • C#
  • ColdFusion
  • C++
  • CSS
  • Delphi
  • Diff
  • Erlang
  • Groovy
  • JScript
  • Java
  • JavaFX
  • Perl
  • Php
  • Plain
  • PowerShell
  • Python
  • Ruby
  • Scala
  • SQL
  • VB
  • XML

Screenshots

  • Simple PHP Example

Installation

  1. Extract plugin into /wp-content/plugins directory.
  2. Activate the plugin.
  3. Specify the code snippets in your blog post following the Usage Directions.

Here is an example to produce PHP syntax highlighting once the plugin is activated:

 
/***********************************
 ** Multiline block comments
 **********************************/

$stringWithUrl = "http://alexgorbatchev.com";
$stringWithUrl = 'hello world';

ob_start("parseOutputBuffer");        // Start Code Buffering
session_start();

function parseOutputBuffer($buf) {
    global $portal_small_code, $portal_gzcompress;
    global $PHP_SELF, $HTTP_ACCEPT_ENCODING;

    // cleaning out the code.
    if($portal_small_code && !$portal_gzcompress) {
        $buf = str_replace("   ", "", $buf);
        $buf = str_replace("\n", "", $buf);
        $buf = str_replace(chr(13), "", $buf);
    }
}

Contributors & Developers

“Javascript Syntax Highlighter” is open source software. The following people have contributed to this plugin.

Contributors