gitbook 是一个基于 git 和 github 的静态站点写做工具他们有一个官网上有很多好的书
参见https://www.gitbook.io/html
下面介绍下 gitbook 写书的一些记录python
下载编辑器 https://github.com/GitbookIO/editor
git
下面只记录了主要的命令行使用流程,文章编辑功能就没写啦
http://segmentfault.com/ 贴图片太麻烦github
npm -g install gitbook npm -g install gitbook-plugin npm install gitbook-plugin-disqus npm install gitbook-plugin-ga
timgerdeMac-mini:PythonToScala_Zh timger$ gitbook Usage: gitbook [options] [command] Commands: build [options] [source_dir] Build a gitbook from a directory serve [options] [source_dir] Build then serve a gitbook from a directory pdf [options] [source_dir] Build a gitbook as a PDF epub [options] [source_dir] Build a gitbook as a ePub book mobi [options] [source_dir] Build a gitbook as a Mobi book init [source_dir] Create files and folders based on contents of SUMMARY.md publish [source_dir] Publish content to the associated gitbook.io book git:remote [source_dir] [book_id] Adds a git remote to a book repository Options: -h, --help output usage information -V, --version output the version number
timgerdeMac-mini:PythonToScala_Zh timger$ cat book.json { "plugins": ["ga", "disqus"] "pluginsConfig": { "ga": { "token": "UA-29124639-6" }, "disqus": { "shortName": "yishenggudou" } } }
gitbook build ./ -o ./build --config=book.json
cp -vrf ../PythonToScala_Zh/build/* ./ git add -f ./* . ~/.bashrc . ~/.bash_profile git_commit_msg "pub" push_auto_branch
http://www.timger.info/PythonToScala/index.html
npm
timgerdeMac-mini:PythonToScala_Zh timger$ gitbook pdf ./ -o ./python2scala.pdf --config=book.json Starting build ... Successfully built!