將程式碼轉成網頁格式


平常如果我們要把程式碼貼到自己的blog,常常會出現縮排不見, 
或者少掉一堆符號,
因此寫了這支程式,它可以將你需要的程式碼,
轉換成為HTML格式。



http://blog.xuite.net/givemepassxd/blog/40467229

發現一個更讚的網站
http://www.tohtml.com/

後來發現上面的網站都沒有下面的網站方便
http://www.ewdna.com/2008/10/blog-post.html

結果上面的都失敗了
http://formatmysourcecode.blogspot.tw/
這個是讓我實驗成功的網站
<center>
<img width="400" src="https://dl.dropboxusercontent.com/u/24682760/Android_AS/LRUCacheDemo/02.png"  />
</center>
<br/>

<!--more-->
![](https://github.com/givemepassxd999/free_img/blob/master/01.jpg?raw=true)

影片轉gif

放棄原本使用的方法
研究了很多套blog寫法, 最後還是覺得寫程式需要用到markdown語法,

因此利用
https://stackedit.io/
完成markdown語法的頁面,
再傳送到dropbox或者google device
可以透過stackedit來進行儲存, 是目前我覺得最方便的方法。

如果要更改介面, 可以參考以下的template
https://highlightjs.org/static/demo/
https://github.com/isagalaev/highlight.js/tree/master/src/styles

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/tomorrow-night.min.css"/>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js"></script>
放到blogger的範本


https://github.com/benweet/stackedit/wiki/Template.Pacini

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><%= documentTitle %></title>
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body><%= documentHTML %></body>
</html>