Google发布了一个简洁的客户端 代码高亮显示模块(google-code-prettify) 。只要把 JS文件 和 CSS文件 插到HTML页,在Body加上onload=”prettyPrint()” , <pre class="prettyprint">...</pre> 或者 <code class="prettyprint">...</code> 之间的代码将会高亮显示 。

  可以用在C语言系列,Java,Python,Bash,SQL,HTML,XML,CSS,Javascript和Makefiles。也可以将就的用在Ruby,PHP,Awk,Perl的正规子集,但是,因为注解的惯例,不能用在Smalltalk,Lisp类,CAML类语言上。

Google-Code-Prettify主页:
http://code.google.com/p/google-code-prettify/

JS和CSS文件下载地址:
http://google-code-prettify.googlecode.com/svn/trunk/src/

详细的说明(很简单的,就不翻译了,因为我的英文也够烂):
http://google-code-prettify.googlecode.com/svn/trunk/README.html

演示:
http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test.html

注:部分文字来源:谷歌治印