Gitbook Manual
How to install, run and build gitbook.
Introduction
GitBook 是目前最流行的开源书籍写作方案,可以把Markdown 文件汇集成电子书,并提供 PDF、HTML 等多种格式输出。一般还需配合 Markdown 文本编辑器、Git 代码管理工具和 GitHub 托管仓库使用。
⚠️ Deprecation warning:
As the efforts of the GitBook team are focused on the GitBook.com platform, the CLI is no longer under active development.
All content supported by the CLI are mostly supported by our GitBook.com / GitHub integration.
Content hosted on the legacy.gitbook.com will continue working until further notice. For differences with the new vesion, check out our documentation.
Install
npm install -g gitbook-cli
nvm use 10
gitbook install
gitbook serve
执行命令,GitBook 会启动一个 4000 端口 (http://localhost:4000) 用于预览。
./build.sh
上述命令默认将生成的静态网站输出到 _book 目录。
GitBook
GitBook is a command line tool (and Node.js library) for building beautiful books using GitHub/Git and Markdown (or AsciiDoc). Here is an example: Learn Javascript.
You can publish and host books easily online using gitbook.com. A desktop editor is also available.
Stay updated by following @GitBookIO on Twitter or GitBook on Facebook.
Complete documentation is available at toolchain.gitbook.com.
Getting started
GitBook can be used either on your computer for building local books or on legacy.gitbook.com for hosting them. To get started, check out the installation instructions in the documentation.
Usage examples
GitBook can be used to create book, public documentation, enterprise manual, thesis, research papers, etc.
You can find a list of real-world examples in the documentation.
Help and Support
We're always happy to help out with your books or any other questions you might have. You can ask a question on the following contact form at gitbook.com/contact or signal an issue on GitHub.
Features
- Write using Markdown or AsciiDoc
- Output as a website or ebook (pdf, epub, mobi)
- Multi-Languages
- Lexicon / Glossary
- Cover
- Variables and Templating
- Content References
- Plugins
- Beautiful default theme
Publish your book
The platform legacy.gitbook.com is like an "Heroku for books": you can create a book on it (public, or private) and update it using git push.
Licensing
GitBook is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.