🌏 中文版
GitBook is a platform that lets you manage documentation the same way you manage code. It uses Git under the hood for version control, Markdown for content, and produces a polished documentation site complete with search, navigation, and custom domain support. If you’ve ever found yourself torn between Notion, Confluence, or a self-hosted wiki for your technical docs, GitBook is worth a serious look.
Core Features
- Git Sync: Bind to a GitHub or GitLab repo and documentation updates automatically on every push. Edits made in the GitBook web editor are committed back to the repo as well.
- Markdown + Rich Text: Supports pure Markdown authoring alongside a WYSIWYG editor for those less comfortable with Markdown.
- Version Control: Every change is tracked in history. Change Requests (similar to pull requests) provide a review workflow before publishing.
- Full-Text Search: Built-in search with Chinese language support — users can find content without digging through the navigation.
- Multiple Spaces: An organization can have multiple independent documentation spaces, e.g., separate ones for API Docs, User Guide, and Internal Wiki.
- Custom Domain: Paid plans allow binding your own domain (e.g.,
docs.yourcompany.com). - AI Search: A built-in AI assistant lets users ask questions in natural language and surfaces answers from your own documentation.
Basic Setup: GitHub Sync
The most powerful GitBook workflow is two-way sync with a GitHub repo. Here’s how to set it up:
- Create a Space in GitBook
- Go to Space Settings → Integrations → GitHub
- Select the repo and branch to sync
- Choose the sync direction:
- GitBook → GitHub: Edit in GitBook, auto-push to repo
- GitHub → GitBook: Edit Markdown in the repo, auto-update GitBook
- Bidirectional: Edit from either side; GitBook handles the merge
Your GitHub Repo
├── README.md # Homepage
├── SUMMARY.md # Table of contents (GitBook uses this to build the sidebar)
├── getting-started/
│ ├── installation.md
│ └── quick-start.md
├── guides/
│ ├── authentication.md
│ └── deployment.md
└── api-reference/
├── endpoints.md
└── errors.md
SUMMARY.md: The Skeleton of Your Docs
GitBook uses SUMMARY.md to determine the structure of the left-hand navigation sidebar. It’s the most important file in your documentation site:
# Summary
## Getting Started
* [Installation](getting-started/installation.md)
* [Quick Start](getting-started/quick-start.md)
## Guides
* [Authentication](guides/authentication.md)
* [Deployment](guides/deployment.md)
## API Reference
* [Endpoints](api-reference/endpoints.md)
* [Error Codes](api-reference/errors.md)
Nested structure is expressed through indentation; GitBook automatically generates a multi-level sidebar from it.
Use Cases
| Scenario | Fit | Notes |
|---|---|---|
| Open-source project docs | Excellent | Free, Git sync, community can submit doc PRs |
| API documentation | Good | OpenAPI import, syntax-highlighted code blocks |
| Internal team knowledge base | Good | Permissions, multiple spaces, solid search |
| Product user manuals | Good | Multi-language support, custom branding |
| Personal notes | Mediocre | Works, but Notion / Obsidian are more flexible |
| Blog | Poor | No RSS, no timeline, not designed for articles |
Comparisons with Other Documentation Tools
GitBook vs. Notion
Notion is a general-purpose workspace; GitBook is focused on documentation. If your goal is a publicly accessible technical docs site, GitBook’s search, navigation, and SEO are significantly better than Notion’s public pages. For purely internal team collaboration, though, Notion is more flexible.
GitBook vs. Docusaurus / VitePress
Docusaurus and VitePress are static site generators — you build and deploy them yourself. The upside is full control; the downside is that you have to maintain a CI/CD pipeline and manage version upgrades. GitBook is a managed service: no infra to worry about, but less customization headroom.
GitBook vs. Confluence
Confluence is an enterprise-grade wiki with a lot of features but significant bloat. GitBook has a cleaner interface, a faster onboarding curve, and far better Git integration. That said, if your company is already all-in on Atlassian (Jira + Confluence), the switching cost is real.
GitBook vs. ReadMe
ReadMe specializes in API documentation and includes an interactive API explorer. If API docs are your core need, ReadMe is more purpose-built. But if you have documentation needs beyond APIs, GitBook is the more general-purpose choice.
GitBook vs. Mintlify
Mintlify is currently GitBook’s most credible competitor. It offers a more modern design, a built-in API playground, and excellent MDX support. Most AI-company API docs — OpenAI, Anthropic, Cohere, Mistral — have gravitated to Mintlify. GitBook’s advantages are a more generous free tier and a WYSIWYG editor that’s friendlier for non-engineers.
Pricing
| Plan | Price | Key Features |
|---|---|---|
| Free | $0 | 1 public space, unlimited pages, Git sync, community support |
| Plus | $6.70/mo per user | Multiple spaces, custom domain, PDF export, advanced permissions |
| Pro | $12.50/mo per user | SSO, API access, advanced analytics, priority support |
| Enterprise | Contact sales | SLA, dedicated support, compliance features |
The free plan is more than enough for personal projects and open-source documentation.
Getting Started
Option 1: Start from the GitBook Web App
- Sign up at gitbook.com
- Create an Organization → Create a Space
- Write your documentation directly in the web editor
- Configure GitHub sync when you need it
Option 2: Start from a GitHub Repo
- Create
SUMMARY.mdand the corresponding Markdown files in your repo - Create a Space in GitBook and configure the GitHub Integration
- Select your repo and branch, then enable sync
- GitBook reads
SUMMARY.mdautomatically and builds your documentation site
Option 3: GitBook CLI (Deprecated)
The legacy gitbook-cli npm package is no longer maintained. GitBook is now a fully SaaS product — no local installation needed. If you find tutorials suggesting npm install -g gitbook-cli, they are outdated.
Practical Tips
- Use
.gitbook.yamlto control sync behavior: Specify the root directory or exclude certain files.
# .gitbook.yaml
root: ./docs/
structure:
readme: README.md
summary: SUMMARY.md
- Change Requests: When enabled, every edit goes through a review process before publishing — ideal for teams with multiple contributors.
- Custom favicon and logo: Upload them in Space settings to make your docs feel like part of your product.
- Embed external content: Supports embedding YouTube videos, CodeSandbox, Figma, and other third-party content.
- Variants (multiple versions): Maintain several versions of the same documentation (e.g., v1, v2) with a version switcher for users.
When Not to Use GitBook
- You need highly customized page design → Use Docusaurus or VitePress
- Your documentation runs into thousands of pages with complex structure → Consider Confluence or a self-hosted solution
- You just want personal notes → Obsidian or Notion is a better fit
- You need offline access → GitBook is an online-only service
Conclusion
GitBook’s positioning is clear: turn Markdown files into a professional documentation site with minimal setup overhead. Git sync keeps you in your familiar workflow, while the WYSIWYG editor lets non-engineers contribute content without friction. For most scenarios, the free plan covers everything you need — making GitBook one of the fastest ways to get a technical documentation site off the ground.
References
Loading...