Fork me on GitHub

GeSHi is a PHP code renderer that takes the HTML code from the article, specially marked via a lang or xml:lang property, and replaces it with HTML that syntax highlights the code when displaying the article.

GeSHi needs to be installed, enabled and configured on your platform before you can use it at all. Programming languages for it must be added separately.

In Wordpress its usage is something like:

1
2
3
4
<pre lang="java" line="1">class A {
  // this is a comment
  int x; // this is a variable
}</pre>

While in Joomla its usage is:

1
2
3
4
<pre xml:ang="java" lines="true">class A {
  // this is a comment
  int x; // this is a variable
}</pre>

Don't forget that you need the Java language support installed into your GeSHi for this to work.

comments powered by Disqus

Donate

Go to top