2013年9月28日 星期六

使用 google-code-prettify 在 Blogger 呈現 syntax highlight

echo "Hello world";
若要形成上述模樣﹐只需要在部落格貼入下方的程式碼即可:
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script>
<pre class="prettyprint">
echo "Hello world";
</pre>

樣板(skin)可以輸入 default﹑desert﹑sunburst﹑sons-of-obsidian﹑doxy 等數種。 若是希望顯示行數﹐可於屬性 class 加入 linenums。

參考資料:http://code.google.com/p/google-code-prettify/

2015/10/13 更新:已經搬到 GitHub。
參考資料:https://github.com/google/code-prettify

沒有留言:

張貼留言

[Java] Invalid HTTP method: PATCH

最近系統需要使用 Netty4,所以把衝突的 Netty3 拆掉,然後就出現了例外。 pom.xml <dependency> <groupId>com.ning</groupId> <artifactId>as...