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。
2015/10/13 更新:已經搬到 GitHub。
參考資料:https://github.com/google/code-prettify
沒有留言:
張貼留言