Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Pasting code in Wordpress is not an easy task, Wordpress will tend to mess it up by applying filters to it. The GeSHi (Generic Syntax Highlighter) project not only prevents that, but also provides syntax highlight as well. To use it, you will need a Wordpress plugin. The WordPress csh GeSHi Plugin does that job well, the syntax is easy and is easily configurable. You will have to disable Wordpress’s rich text editor though, at least when you need to paste code samples.

Some examples of the combination in action.

Simple:

function square(num)
{
return num*num;
}

With line numbering:

  1. public class Student
  2. {
  3. private String name;
  4. private String matricNo;

public Student(String name, String matricNo)
{
this.name=name;
this.matricNo=matricNo;
}
}
Start line numbering from 10

  1. SELECT * FROM product WHERE price>100 AND type='ELECTRONICS';
  2. SELECT * FROM staff WHERE name LIKE '%JOHN%';
  3. SELECT * FROM store WHERE manager='HENRY LEE';
Tags:
Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Warning: Division by zero in /home/content/p/r/o/project00/html/blog/wp-content/plugins/geshi/geshi.php on line 2310

Related posts:

  1. Some things to note when upgrading to WordPress 2.3 Was upgrading to WP 2.3, got the following error message during the course of upgrading....
  2. 17 days into work as part-time IT executive There are 5 people working in my company, 3 part-timers and none of the part-timers...
  3. phpBB forum – using the default DB object Have been doing a little freelance lately, mainly involving integrating new functionality with phpBB. Using...
  4. Maven2 – installing 3rd party JARs Have a little time these few days, trying to get familiarised with Maven2. Not for...

One Response to “Syntax Highlighting with GeSHi and csh_geshi plugin”
  1. My first time to know about this plugin. WordPress csh GeSHi Plugin? It really sounds new to me. I will review more about it first before installing. Thanks!

  2.  
Trackbacks
  1.  
Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>