Syntax Highlighting in WordPress

Some of my most recent posts involving code have displayed the wonderful blocks of login in all its syntax highlighted glory. A week ago I stumbled on the sweet syntax highlighting plugin – iG:Syntax Highligher (here’s the link to the actual plugin).

The highlighter uses GeSHi for the highlighting engine then wraps a bunch of sweet javascript functions around it to give it a bunch of features (i.e. viewing as syntax highlighted code or plain text toggle). Here’s the supported language list:

[as] & [/as]
[asp] & [/asp]
[c] & [/c]
[cpp] & [/cpp]
[csharp] & [/csharp]
[css] & [/css]
[delphi] & [/delphi]
[html] & [/html]
[java] & [/java]
[js] & [/js]
[mysql] & [/mysql]
[perl] & [/perl]
[php] & [/php]
[python] & [/python]
[ruby] & [/ruby]
[smarty] & [/smarty]
[sql] & [/sql]
[vb] & [/vb]
[vbnet] & [/vbnet]
[xml] & [/xml]

Installation is super easy and simply requires you to edit the quicktags.js file in wp-admin. If you’re looking for a syntax highlighter for your blog, I’d suggest you give this one a try. w00t.


Comments

7 responses to “Syntax Highlighting in WordPress”

  1. Installation is super easy and simply requires you to edit the quicktags.js file in wp-admin

    You are not required to change the quicktags.js file. its required only if you want to have Quicktag buttons for the codes in your editor, othewise not. Its entirely an optional step! :)

  2. Thanks! This will definitely help me in my new RoR blog. Just installed and tried it out. Works excellent. Cheers!

  3. But sorry to say it definitely not work properly with wordpress 2.x versions. Can you tell me the solution what to do with wordpress 2.x to work it properly !

  4. […] O plugin que eu escolhi foi o iG no blog de BorkWeb vc encontra uma boa resenha. Abaixo vão algumas opções e exemplos. Opções: PLAIN TEXT CODE: […]

  5. thank’s a lot … wonderfull plug-in!!!

    only one note: in my first WP (2.1) installation it didn’t go well (You need to be a Level 8(or above) … etc);

    I inserted manually in the table “wp_users” a row called “user_level” (integer [2], unsigned, defalt 0) and after I assigned “10” to user “admin” … now it is perfect!!!

    MoiKano

  6. thanx ig for the plugin
    thanx MoiKano for the wordpresse 2.7 workaround! since ig is not updated since 2006!

  7. I like WP-Syntax. It uses the “pre” tag, so if you accidentally disable this plugin, or even if there’s any issue with newer WordPress version, it won’t totally screw up with your post, it will just take the colors and line numbers off.