<link rel="stylesheet" href="css/prettify.css" /> <!-- 设置代码主题,此文件为默认主题,你可以换成其他主题-->
<script src="js/prettify.js" type="text/javascript"></script>
<body onload="prettyPrint()">
默认在prettify中有5种选择:
比如你想使用sunburst.css,则我们只需要将:
<link rel="stylesheet" href="css/prettify.css" />
替换成
<link rel="stylesheet" href="css/sunburst.css" />
扩展样式可以从 http://jmblog.github.io/color-themes-for-google-code-prettify/ 下载。
[1] 官方文档:http://google-code-prettify.googlecode.com/svn/trunk/README.html
[2] 扩展的Prettify主题CSS样式:http://jmblog.github.io/color-themes-for-google-code-prettify/
[3] 代码格式化工具:http://tool.oschina.net/codeformat
五、Google Code Prettify:实现代码高亮的JS库,布布扣,bubuko.com
五、Google Code Prettify:实现代码高亮的JS库
原文:http://www.cnblogs.com/xiazdong/p/3575693.html