Skip to content

chusiang/how-to-build-the-gitbook-with-gitbook-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to build the Gitbook with gitbook-cli

Need the package fo git, make, node.js, npm and gitbook-cli.

My private GitBook

Setup

  1. Install node.js and npm package.

     # Mac OSX.
     $ brew install node npm
    
     # Ubuntu.
     $ sudo apt-get install nodejs npm
    
  2. Install n with npm.

     $ sudo npm install n -g
    
  3. Downgrade node.js to v5.12.0. (see Build error with node v6 · Issue #1)

     $ n 5.12.0        
    
  4. Install gitbook-cli package.

     $ sudo npm install -g gitbook-cli
    
  5. Install necessary package with npm.

     $ gitbook install
    
  6. Check version.

     $ gitbook -V
     CLI version: 2.3.0
     GitBook version: 3.1.1
    
  7. Install calibre for build pdf, epub and mobi.

  8. Link calibre command line tool.

     # Mac OSX.
     $ ln -s /Applications/calibre.app/Contents/MacOS/ebook-convert /usr/local/bin/
    

Get repository.

Get MyBook with git.

$ git clone https://github.com/chusiang/how-to-build-the-gitbook-with-gitbook-cli.git

Build

  1. Go to MyBook project.

     $ cd ${MyBook}
    
  2. Build static HTML.

     $ make
    
  3. Build PDF.

     $ make pdf
    
  4. Build epub for iDevice.

     $ make epub
    
  5. Build mobi for Kindle.

     $ make mobi
    
  6. Review result at local.

     $ make review
    
  7. Clean.

     $ make clean
    

Reference

CI

About

如何藉由 gitbook-cli 來建置自己的 GitBook。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published