Gitbook writing technical documents


Gitbook is a static site writing tool based on GIT and GitHub. They have an official website with many good books

Here are some records of gitbook’s writing

Interface editing

Download editor

command line

The following only records the main command line using process, the article editing function is not written It’s too much trouble pasting pictures


npm -g install gitbook
npm -g install gitbook-plugin
npm install gitbook-plugin-disqus
npm install gitbook-plugin-ga

Command parameters

timgerdeMac-mini:PythonToScala_Zh timger$ gitbook 

  Usage: gitbook [options] [command]


    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
    publish [source_dir]   Publish content to the associated book
    git:remote [source_dir] [book_id] Adds a git remote to a book repository


    -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"

Online address

Package pdf

timgerdeMac-mini:PythonToScala_Zh timger$ gitbook pdf  ./ -o ./python2scala.pdf --config=book.json
Starting build ...
Successfully built!