安装
我是ubuntu平台,其他平台请参考官方安装文档
sudo apt-get install ruby ruby-dev make zlib1g-dev libicu-dev build-essential git
gem的官方源被和谐了,需要先切换到淘宝源,请参考为gem更换淘宝的源,
设置好源后通过gem直接安装gollum
sudo gem install gollum
经过漫长的等待,自动安装了一系列的组件后,终于完成了。
Done installing documentation for charlock_holmes, diff-lcs, github-markup, gitlab-grit, gollum, gollum-grit_adapter, gollum-lib, kramdown, mime-types, mini_portile2, mustache, nokogiri, posix-spawn, rack, rack-protection, rouge, sanitize, sinatra, stringex, tilt, useragent after 904 seconds
21 gems installed
创建本地的wiki
hartnett at hartnett-NOTEBOOK in /data
$ mkdir wiki
hartnett at hartnett-NOTEBOOK in /data
$ cd wiki
hartnett at hartnett-NOTEBOOK in /data/wiki
$ git init
初始化空的 Git 版本库于 /data/wiki/.git/
hartnett at hartnett-NOTEBOOK in /data/wiki (master)
$ gollum
[2015-12-16 11:35:06] INFO WEBrick 1.3.1
[2015-12-16 11:35:06] INFO ruby 2.1.5 (2014-11-13) [x86_64-linux-gnu]
== Sinatra (v1.4.6) has taken the stage on 4567 for development with backup from WEBrick
[2015-12-16 11:35:06] INFO WEBrick::HTTPServer#start: pid=599 port=4567
001.png
与github联动
-
开通笔记repos的wiki,比如我的repos是xnote,如果希望别人可读不可写,需要去掉Restrict edits to Collaborators only,如下图所示:
002.png -
clone wiki到本地,wiki的地址为repos的名字加.wiki,如下图所示:
003.png - 编辑github的wiki,进入xnote.wiki目录启动gollum就可以本地编辑github的wiki了。
hartnett at hartnett-NOTEBOOK in /data/wiki (master)
$ cd xnote.wiki
hartnett at hartnett-NOTEBOOK in /data/wiki/xnote.wiki (master)
$ gollum
[2015-12-16 12:21:25] INFO WEBrick 1.3.1
[2015-12-16 12:21:25] INFO ruby 2.1.5 (2014-11-13) [x86_64-linux-gnu]
== Sinatra (v1.4.6) has taken the stage on 4567 for development with backup from WEBrick
[2015-12-16 12:21:25] INFO WEBrick::HTTPServer#start: pid=1794 port=4567
- 最后将wiki的内容提交到github即可。
网友评论