There is a great highlight tool written by javascript. syntaxhighlighter is a Google code project. Update: Just found it is a new version for Syntaxhighlighter. It is a little bit different than the old one which I mentioned here. Please find the right way to use it. It is easy to use and looks perfect.