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.
Discuss This Article
|
|
5 Responses to “Syntax Highlighting in WordPress”
-
Amit
Posted: Oct 1st, 2006 at 3:36 pm1 -
Roman
Posted: Jan 14th, 2007 at 8:30 amReply to this comment.Thanks! This will definitely help me in my new RoR blog. Just installed and tried it out. Works excellent. Cheers!
2 -
Jimmy
Posted: Jan 28th, 2007 at 10:44 pmReply to this comment.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 !
3 -
pingback:
Posted: Feb 9th, 2007 at 10:01 amArchetype Coder » Blog Archive » Escrevendo código no seu post com plugin Reply to this comment.[...] 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: [...]
4 -
MoiKano
Posted: Feb 12th, 2007 at 6:43 pmReply to this comment.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
5



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! :)