gitBook 写技术文档

gitbook 是一个基于 git 和 github 的静态站点写作工具他们有一个官网上有不少好的书
参见https://www.gitbook.io/

下面介绍下 gitbook 写书的一些记录

界面编辑

下载编辑器 https://github.com/GitbookIO/editor

命令行

下面只记录了主要的命令行使用流程,文章编辑功能就没写啦
http://segmentfault.com/ 贴图片太麻烦

安装

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


config

timgerdeMac-mini:PythonToScala_Zh timger$ cat book.json
{
    "plugins": ["ga", "disqus"]
    "pluginsConfig": {
        "ga": {
            "token": "UA-29124639-6"
        },
    "disqus": {
            "shortName": "yishenggudou"
        }
    }
}

build

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

打包 pdf

timgerdeMac-mini:PythonToScala_Zh timger$ gitbook pdf  ./ -o ./python2scala.pdf --config=book.json
Starting build ...
Successfully built!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值