Re: [請益] 適合貼程式碼的 blog
※ 引述《On1earth (小淺)》之銘言:
: 請問大家有什麼blog系統或平台比較適合拿來貼程式碼嗎?
: 想記錄一些coding上遇到的麻煩與解法,
: 主要有兩點比較重要
: 1. 方便貼程式碼,有highlight
: 2. 方便在文章插圖(會有step by step一步驟一張圖的需求),
: 架好wordpress後發現不太適合這種用途,
: 例如貼xml要手動轉換< >等字元、縮排也不方便。
: 謝謝。
有 syntax highlighting 的很多,
但有做到第 2 點的比較少。
現在流行能用靜態網站做到的,就不要用動態的,像 blogging 就蠻適合用靜態網站的,
搭配 GitHub Pages (前幾篇有中文教學) 就能呈現。
這邊有人整理各個靜態網站 generator 的比較:http://staticsitegenerators.net/
從中舉幾個 syntax highlighting 的 demo:
1. Octopress (Ruby)
http://octopress.org/docs/plugins/codeblock/
2. Nikola (Python)
http://getnikola.com/handbook.html#gist
3. Hexo (JavaScript)
http://hexo.io/docs/tag-plugins.html#Code_Block
4. Hugo (Go)
http://hugo.spf13.com/extras/highlighting
--
http://changyuheng.github.io/
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.141.117.77
※ 文章網址: http://www.ptt.cc/bbs/Soft_Job/M.1406435774.A.F9C.html
推
07/27 16:24, , 1F
07/27 16:24, 1F
→
07/27 16:29, , 2F
07/27 16:29, 2F
→
07/27 16:31, , 3F
07/27 16:31, 3F
Octopress 是最大宗的,但是我不熟悉,沒辦法給你建議。
簽名檔的 blog 就是用 Pelican 產生的,但是沒有在 Windows 下試過。
同樣是 Python 寫的 generator,比起 Pelican 我更推薦 Nikola。
不過上面這四個 generator 裡面我最推薦的是 Hexo,
因為他是台灣人寫的,中文支援比較多:
http://zespia.tw/blog/2012/10/11/hexo-debut/
針對 syntax highlighting 功能,這邊有個範例:
http://hexo.chenall.net/post/code/
比起許多程式只要一直按下一步就可以裝好、設定好,
這些 generator 是比較複雜一點,
但既然有張貼程式碼的需求,相信這些設定都不算困難。
網路上有好幾篇文章分享如何在 Windows 下安裝與使用 Hexo。
許多 doc 也都是 generator 產生的 static site,
舉一個比較特別的:https://www.gitbook.io/
→
07/28 02:06, , 4F
07/28 02:06, 4F
因為 Ruby 的代表我已經選 Octopress 了...
推
07/28 10:18, , 5F
07/28 10:18, 5F
推
07/28 21:56, , 6F
07/28 21:56, 6F
→
07/28 21:58, , 7F
07/28 21:58, 7F
→
07/28 21:59, , 8F
07/28 21:59, 8F
→
07/28 22:19, , 9F
07/28 22:19, 9F
→
07/28 22:21, , 10F
07/28 22:21, 10F
※ 編輯: changyuheng (60.251.223.31), 07/29/2014 14:06:35
討論串 (同標題文章)