Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitbook #55

Open
uniquejava opened this issue Jun 24, 2016 · 2 comments
Open

gitbook #55

uniquejava opened this issue Jun 24, 2016 · 2 comments

Comments

@uniquejava
Copy link
Owner

uniquejava commented Jun 24, 2016

http://toolchain.gitbook.com/

Local Installation

Requirements

Installing GitBook is easy and straightforward. Your system just needs to meet these two requirements:

NodeJS (v4.0.0 and above is recommended)
Windows, Linux, Unix, or Mac OS X
Install with NPM

The best way to install GitBook is via NPM. At the terminal prompt, simply run the following command to install GitBook:

$ npm install gitbook-cli -g
gitbook-cli is an utility to install and use multiple versions of GitBook on the same system. It will automatically install the required version of GitBook to build a book.

Create a book

GitBook can setup a boilerplate book:

$ gitbook init
If you wish to create the book into a new directory, you can do so by running gitbook init ./directory

Preview and serve your book using:

$ gitbook serve
Or build the static website using:

$ gitbook build
Install pre-releases

gitbook-cli makes it easy to download and install other versions of GitBook to test with your book:

$ gitbook fetch beta
Use gitbook ls-remote to list remote versions available for install.

Debugging

You can use the options --log=debug and --debug to get better error messages (with stack trace). For example:

$ gitbook build ./ --log=debug --debug

@uniquejava
Copy link
Owner Author

uniquejava commented Jun 24, 2016

Generating eBooks and PDFs

GitBook can generates a website, but can also output content as ebook (ePub, Mobi, PDF).

Generate a PDF file

$ gitbook pdf ./ ./mybook.pdf

Generate an ePub file

$ gitbook epub ./ ./mybook.epub

Generate a Mobi file

$ gitbook mobi ./ ./mybook.mobi
Installing ebook-convert

ebook-convert is required to generate ebooks (epub, mobi, pdf).

OS X

Download the Calibre application. After moving the calibre.app to your Applications folder create a symbolic link to the ebook-convert tool:

$ sudo ln -s /Applications/calibre.app/Contents/MacOS/ebook-convert /usr/bin
You can replace /usr/bin with any directory that is in your $PATH.

@uniquejava
Copy link
Owner Author

uniquejava commented Jun 26, 2016

我写了个gitbook插件, 扔到npm上去了, 下载地址: https://www.npmjs.com/package/gitbook-plugin-lb2br

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant