转自:http://www.21andy.com/blog/20100920/1955.html
地址:http://code.google.com/p/google-code-prettify/
特点是无须指定语言!
安装使用
1、在你的文件中包含这儿的脚本和样式表(你要保证这儿的 css 和 js 文件按在你的服务器上, 并且调整在 script 和 link标签中的路径)
1 2 |
<link href="prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="prettify.js"></script> |
2、添加onload="prettyPrint()"
到你的文件的 body 标签中.
3、修改样式表,使用你自己喜欢的颜色. Continue reading “自动语法高亮 google-code-prettify”