Googleのブログサービス「Blogger」で、ソースコードを見やすくきれいに表示するには、
google code prettify を使うのがよさそう。
下記を参考にしました。
Bloggerでソースコードをきれいに表示する方法htmlのヘッダに以下を追加した。
- <!-- Google-code-prettifyを追加 -->
- <script src='https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?skin=sunburst'/>
- <style type='text/css'>
- pre.prettyprint { word-wrap: normal; overflow: auto; white-space: pre; height:32em; }
- pre.prettyprint.linenums li{ list-style-type: decimal; }
- </style>
- <!-- /Google-code-prettify -->
HTMLで、特殊文字がある時は、以下のサイトで変換する。