<link rel="stylesheet" href="css/prettify.css" /> <!-- 设置代码主题,此文件为默认主题,你能够换成其余主题-->
<script src="js/prettify.js" type="text/javascript"></script>
<body onload="prettyPrint()">
默认在prettify中有5种选择:javascript
好比你想使用sunburst.css,则咱们只须要将:css
<link rel="stylesheet" href="css/prettify.css" />
替换成html
<link rel="stylesheet" href="css/sunburst.css" />
扩展样式能够从 http://jmblog.github.io/color-themes-for-google-code-prettify/ 、http://stanleyhlng.com/demo/?url=http%3A%2F%2Fdemo.stanleyhlng.com%2Fprettify-js%2F&surl=http%3A%2F%2Fstanleyhlng.com%2Fprettify-js%2F下载。java
[1] 官方文档:http://google-code-prettify.googlecode.com/svn/trunk/README.htmlgit
[2] 扩展的Prettify主题CSS样式:http://jmblog.github.io/color-themes-for-google-code-prettify/github
[3] 代码格式化工具:http://tool.oschina.net/codeformatsvn