為了方便記錄, 今天來研究如何在Blogger上顯示程式碼區塊。
使用「新增小工具」的功能,是不錯的方法,盡量比面跟範本的程式碼混雜在一起,事後修改更方便,參考使用方法--> https://pjchender.blogspot.tw/2015/03/blogger.html
這裡詳細介紹使用法--> https://github.com/google/code-prettify/blob/master/docs/getting_started.md
懶人模式-直接套用喜歡的樣板--> https://cdn.rawgit.com/google/code-prettify/master/styles/index.html
單行有行數寫法:
<pre class="prettyprint lang-scm">(friends 'of '(parentheses))</pre>多行有行數寫法:
指定行數寫法
- <pre class="prettyprint linenums">
- Many
- lines
- of
- code
- Test1
- Test2
- Test3
- </pre>
- <pre class="prettyprint linenums:40">lots of code</pre>