# GitBook documentation

Create and publish AI-native documentation your users will love. GitBook gives you intelligent tools to build product guides, API references, and documentation that improves over time.

## Documentation your users actually read

Your users are humans and their AI agents — GitBook publishes for both. Write in the editor, drive it from your agent, or sync from Git.

<button type="button" class="button primary" data-action="ask" data-icon="gitbook-assistant">What are you trying to do?</button>

<a href="/docs/getting-started/quickstart" class="button primary">Quickstart</a><a href="/docs/docs-as-code/gitbook-mcp" class="button secondary" data-icon="sparkles">GitBook MCP</a>

<h3 align="center">How do you want to work?</h3>

<p align="center">The same docs, three ways in. Most teams use more than one.</p>

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><h4><i class="fa-hand-pointer">:hand-pointer:</i></h4></td><td><h4>In the editor</h4></td><td>Write and publish visually. Blocks, change requests, and review without touching a terminal.</td><td><a data-mention href="/docs/getting-started/quickstart">Quickstart</a></td><td><a data-mention href="/docs/create-content/formatting">Format content</a></td><td><a data-mention href="/docs/publish/publish-a-docs-site">Publish a docs site</a></td></tr><tr><td><h4><i class="fa-claude">:claude:</i> <i class="fa-chatgpt">:chatgpt:</i> <i class="fa-cursor">:cursor:</i></h4></td><td><h4>From your agent</h4></td><td>Drive GitBook from Claude, Cursor, or any MCP client. Draft, restructure, and open change requests.</td><td><a data-mention href="/docs/docs-as-code/git-sync">GitHub &amp; GitLab Sync</a></td><td><a data-mention href="/docs/docs-as-code/gitbook-mcp">GitBook MCP</a></td><td><a data-mention href="/docs/docs-as-code/ai-coding-assistants-and-skillmd">Agent skills</a></td></tr><tr><td><h4><i class="fa-code">:code:</i></h4></td><td><h4>With code</h4></td><td>Sync from Git, script with the CLI, or build on the API and ship your own components.</td><td><a data-mention href="/docs/docs-as-code/gitbook-cli">GitBook CLI</a></td><td><a data-mention href="/docs/developers/gitbook-api/api-reference">API reference</a></td><td><a data-mention href="/docs/developers/integrations/quickstart">Build a custom component</a></td></tr></tbody></table>

***

<h3 align="center">From first draft to published site</h3>

<p align="center">Follow it end to end, or pick up where you left off.</p>

<table data-card-wrap="false" data-view="cards"><thead><tr><th><select><option value="tYrMrLMXUpio" label="CREATE" color="blue"></option><option value="d22AQrHOOWqZ" label="COLLABORATE" color="blue"></option><option value="gRpitypvSxnY" label="PUBLISH" color="blue"></option><option value="jRHQeaWBEkNl" label="IMPROVE" color="blue"></option></select></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><span data-option="tYrMrLMXUpio">CREATE</span></td><td><h4>Get content in</h4></td><td>Start fresh or bring what you have.</td><td><a data-mention href="/docs/getting-started/quickstart">Quickstart</a></td><td><a data-mention href="/docs/getting-started/import">Migrate to GitBook</a></td><td><a data-mention href="/docs/create-content/content-structure">Content structure</a></td><td><a data-mention href="/docs/create-content/blocks">Blocks</a></td><td><a data-mention href="/docs/create-content/reusable-content">Reusable content</a></td></tr><tr><td><span data-option="d22AQrHOOWqZ">COLLABORATE</span></td><td><h4>Work as a team</h4></td><td>Review before anything goes live.</td><td><a data-mention href="/docs/collaborate/change-requests">Change requests</a></td><td><a data-mention href="/docs/collaborate/comments">Comments</a></td><td><a data-mention href="/docs/collaborate/merge-rules">Merge rules</a></td><td><a data-mention href="/docs/collaborate/member-management/roles">Roles</a></td><td><a data-mention href="/docs/docs-as-code/git-sync">GitHub &amp; GitLab Sync</a></td></tr><tr><td><span data-option="gRpitypvSxnY">PUBLISH</span></td><td><h4>Ship your site</h4></td><td>Structure, brand, and control access.</td><td><a data-mention href="/docs/publish/publish-a-docs-site">Publish a docs site</a></td><td><a data-mention href="/docs/manage-your-site/site-structure">Site structure</a></td><td><a data-mention href="/docs/manage-your-site/customization">Site customization</a></td><td><a data-mention href="/docs/publish/custom-domain">Set a custom domain</a></td><td><a data-mention href="/docs/publish/embedding">Embed in your product</a></td></tr><tr><td><span data-option="jRHQeaWBEkNl">IMPROVE</span></td><td><h4>Learn what works</h4></td><td>See what readers need next.</td><td><a data-mention href="/docs/analytics/insights">Site analytics</a></td><td><a data-mention href="/docs/analytics/ai-insights">AI insights</a></td><td><a data-mention href="/docs/publish/seo">SEO</a></td><td><a data-mention href="/docs/publish/site-redirects">Site redirects</a></td><td><a data-mention href="/docs/gitbook-agent/automatic-docs-improvements">Automatic docs improvements</a></td></tr></tbody></table>

***

<h3 align="center">AI out of the box</h3>

<p align="center">Two work for you while you write. Three work for your readers after you publish.</p>

<table data-card-wrap="false" data-view="cards"><thead><tr><th><select><option value="2Uw7O5pXC3Za" label="WRITES WITH YOU" color="blue"></option><option value="nGF5DOSuoMEQ" label="ANSWERS READERS" color="blue"></option><option value="hN3xLK8qPaR1" label="IMPROVES DOCS" color="blue"></option><option value="tPcprkNCfFXJ" label="SERVES AGENTS" color="blue"></option></select></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><span data-option="2Uw7O5pXC3Za">WRITES WITH YOU</span></td><td><h4>GitBook Agent</h4></td><td>Drafts, edits, reviews change requests, and flags gaps against your style guide.</td><td><a href="/docs/gitbook-agent/overview">GitBook Agent</a></td></tr><tr><td><span data-option="nGF5DOSuoMEQ">ANSWERS READERS</span></td><td><h4>AI Assistant</h4></td><td>Answers questions on your site from your docs and connected support sources, in the sidebar or search box.</td><td><a href="/docs/ai-for-your-readers/gitbook-ai-assistant">AI Assistant</a></td></tr><tr><td><span data-option="hN3xLK8qPaR1">IMPROVES DOCS</span></td><td><h4>AI Insights</h4></td><td>See what your visitors are asking and identify knowledge gaps in your docs.</td><td><a href="/docs/analytics/ai-insights">AI insights</a></td></tr><tr><td><span data-option="tPcprkNCfFXJ">SERVES AGENTS</span></td><td><h4>MCP for your docs</h4></td><td>Your published docs as a tool, so your customers' agents can read them properly.</td><td><a href="/docs/ai-for-your-readers/mcp-servers-for-published-docs">MCP servers for published docs</a></td></tr></tbody></table>

***

<h3 align="center">Keep going</h3>

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-book">:book:</i></h4></td><td><h4>Concepts</h4></td><td>Learn about GitBook concepts.</td><td><a href="/docs/reference/concepts">Core concepts</a></td></tr><tr><td><h4><i class="fa-clock-rotate-left">:clock-rotate-left:</i></h4></td><td><h4>Changelog</h4></td><td>See our latest releases.</td><td><a href="https://gitbook.com/docs/changelog/">Changelog</a></td></tr><tr><td><h4><i class="fa-life-ring">:life-ring:</i></h4></td><td><h4>Support</h4></td><td>Contact us or report a bug.</td><td><a href="/docs/help/report-a-bug">Report a bug</a></td></tr></tbody></table>


# Quickstart

Get up and running in GitBook and publish your first docs site in minutes

This quickstart guide explains how to get set up in GitBook and publish your first docs site in minutes.

At the end of this guide, you’ll have a live documentation site, ready to expand and customize.

{% stepper %}
{% step %}

#### Create your account

[Create an account](https://app.gitbook.com/join) to get started with your first documentation site.
{% endstep %}

{% step %}

#### Create your first site

1. From your organization **Home**, click the **+** next to **Sites** in the sidebar.
2. Give your site a name your visitors will recognize.
3. Click **Create**.
   {% endstep %}

{% step %}

#### Choose how you want to start

GitBook welcomes you to your new site and asks how you'd like to begin.

<table><thead><tr><th width="200">Starting point</th><th>Best for</th></tr></thead><tbody><tr><td><strong>Docs template</strong></td><td>Starting from a ready-made documentation layout with placeholder sections — the fastest way to see a full site working.</td></tr><tr><td><strong>Import</strong></td><td>Bringing in existing content from online docs, Markdown, or HTML.</td></tr><tr><td><strong>OpenAPI</strong></td><td>Generating interactive API reference docs from an OpenAPI spec.</td></tr><tr><td><strong>Blank</strong></td><td>Starting from an empty section and building from scratch.</td></tr><tr><td><strong>Sync with Git</strong></td><td>Keeping your docs in sync with a GitHub or GitLab repository.</td></tr></tbody></table>

Or, you can pick from your organization's existing content if you already have some work in GitBook.

This guide follows the template path:

1. Click **Docs template** and review the preview.
2. Click **Use Docs Template** to apply it.
   {% endstep %}

{% step %}

#### Explore your new site

Your site opens unpublished, so you can edit, customize, and preview everything before it goes live. The sidebar shows:

<table><thead><tr><th width="160">Sidebar area</th><th>What you'll find</th></tr></thead><tbody><tr><td><strong>Site header</strong></td><td>Your site name, its publish status, and the <strong>Preview</strong> and <strong>Publish</strong> buttons.</td></tr><tr><td><strong>General</strong></td><td><strong>Overview</strong>, <strong>Change requests</strong>, <strong>Site structure</strong>, and <strong>Settings</strong>.</td></tr><tr><td><strong>Tools</strong></td><td><strong>Styleguide</strong>, <strong>Customize</strong>, <strong>Analyze</strong>, and <strong>Extend</strong>.</td></tr><tr><td><strong>Content</strong></td><td>These are your site's sections - for the Docs template: Home, Documentation, API Reference, Changelog, and Help Center. Use the icons on the <strong>Content</strong> header to find, rename, and add sections.</td></tr></tbody></table>

{% hint style="success" %}
Your content isn't published yet — so you can edit, customize, and preview your docs site before making it live. Click **Publish** to make it live immediately.

<i class="fa-arrow-down">:arrow-down:</i> [Jump to the 'Publish your documentation' step on this page](#publish-your-documentation)
{% endhint %}
{% endstep %}

{% step %}

#### Edit your content

The Docs template starts you with placeholder sections in the **Content** part of the sidebar. Click any section to open it and see its placeholder content.

There are two ways to edit and update your content in GitBook — in our visual editor, or following a docs-as-code workflow. **You can choose one, or use a combination of both.** Whichever workflow you prefer, you'll edit your content using a **branch-based editing flow**. Find out more on [the Concepts page](/docs/reference/concepts).

{% tabs %}
{% tab title="Visual editor" icon="hand-pointer" %}
GitBook's what-you-see-is-what-you-get (WYSIWYG) editor lets you edit content visually, drag content blocks to reorganize them, and see how your content looks as you work. It's ideal if you don't want to work in a code editor, or you're used to tools like Notion or Google Docs.

**Edit your docs in a change request**

1. In the **Content** section of the sidebar, click a section — such as Documentation — to open it.
2. Click **Edit** in the top-right corner. This opens a change request where you can change the content of the section.
3. Click **Add new…** > **Page** in the table of contents on the left-hand side.
4. Give your new page a title.

**Preview your changes**

Along the top of the web app you'll see tabs for **Editor**, **Changes**, and **Preview**. These switch between different views for your content. Click **Preview** to see how your docs site looks with all the changes in your change request, on both desktop and mobile.

**Merge your changes**

Once you're happy with your changes, click the **Merge** button in the top-right corner. This updates the primary version of your content with all the edits from the change request. If the content is part of a live docs site, the site updates immediately.
{% endtab %}

{% tab title="AI Agent" icon="robot" %}
Sync your documentation with a GitHub or GitLab repository to enable code-based editing in your existing developer environment. It's ideal for technical users who prefer to manage documentation alongside other code.

**Set up Git Sync**

1. Open the section you want to sync from the **Content** part of the sidebar.
2. Click the Git Sync indicator's **Set up** button in the top bar.
3. Follow the instructions to sync the section to your chosen Git repository. Head to the [Git Sync pages](/docs/docs-as-code/git-sync) to find out more.

**Edit your docs from your developer environment**

Once you've synced your section to your Git repository:

1. Open the repository.
2. Create a pull request.
3. Make the changes you want.

{% hint style="info" %}
GitBook supports [Markdown editing](/docs/create-content/formatting/markdown), so you can create and format content using common syntax.

Every standard block in GitBook can be written and formatted using Markdown.
{% endhint %}

**Preview your changes**

You can [preview your changes](/docs/docs-as-code/git-sync/github-pull-request-preview) on your published docs site from the pull request in GitHub or GitLab. Your pull request shows a status with a unique preview URL. Click **Details** on that status to open it and see how your site looks once merged.

**Merge your changes**

Merge your pull request and your content updates both in the GitBook app and on your docs site, if it's live. In the GitBook app, every commit and your merged pull request sync to your section as updates in the version history.
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

#### Customize your docs

**Organize your site navigation**

Add more content to your site — an API reference, a help center, a changelog — at any time, and organize your site's navigation bar so visitors find what they're looking for. Head to [Site structure](/docs/manage-your-site/site-structure) to learn about sections, groups, and variants.

**Customize the look and feel**

Your site looks great out of the box — and under **Customize**, you can set your own [logo, colors, and font](/docs/manage-your-site/customization/icons-colors-and-themes), adjust the layout, and update your [site's visibility](/docs/manage-your-site/site-settings#audience).
{% endstep %}

{% step %}

#### Publish your documentation <a href="#publish-your-documentation" id="publish-your-documentation"></a>

You can publish your site with a click at any time.

1. Open your site from your organization **Home**.
2. Click **Publish** in the site header.

Once your site is live, the **Overview** screen updates with a link to the live site.

{% hint style="success" %}
Want to explore publishing in more detail? Check out [our complete guide to creating and publishing content in GitBook](/docs/guides/editing-and-publishing-documentation/complete-guide-to-publishing-docs-gitbook).
{% endhint %}
{% endstep %}
{% endstepper %}

#### Add a custom domain

By default, your site is published with a unique URL in this format:

{% code title="Your site’s default URL" %}

```
https://[organization-name].gitbook.io/[site-title]
```

{% endcode %}

While this may be suitable for some teams, many choose to change their URL to [a custom domain](/docs/publish/custom-domain) or [a custom subdirectory](/docs/publish/custom-domain/setting-a-custom-subdirectory).

1. Expand **Settings** in your site's sidebar.
2. Click **Domain and URL**.
3. Choose the option you want.
4. Follow the instructions to configure the DNS settings with your domain provider.

{% hint style="info" %}
It can take up to 48 hours for your DNS changes to take effect — although they typically propagate much faster.
{% endhint %}

#### Next steps

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-card-cover-dark data-type="image">Cover image (dark)</th></tr></thead><tbody><tr><td><strong>Invite your team to collaborate</strong></td><td>Add team members to your organization and set permissions</td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fx86ICzAJYkRIHo8CkBfa%2FInvite%20your%20team%20to%20collaborate.png?alt=media&amp;token=427f64f0-9175-4787-a952-827bcdbec2ab">25_12_10_invite_your_team_to_collaborate_1.png</a></td><td><a href="/docs/collaborate/member-management/invite-members-to-your-organization">Manage or remove members</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fanu5lcBOfoYfNQPIUA65%2FInvite%20your%20team%20to%20collaborate.png?alt=media&amp;token=1759c40c-08a4-42e4-a345-2b91dfad1f62">25_12_10_invite_your_team_to_collaborate.png</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fanu5lcBOfoYfNQPIUA65%2FInvite%20your%20team%20to%20collaborate.png?alt=media&amp;token=1759c40c-08a4-42e4-a345-2b91dfad1f62">25_12_10_invite_your_team_to_collaborate.png</a></td><td></td><td></td><td></td></tr><tr><td><strong>Change site visibility</strong></td><td>Control who can see your content with share links and authenticated access</td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FA33LxfEQT05aX7uUdLpb%2FChange%20site%20visibility.png?alt=media&amp;token=896f9961-f57b-4a5b-8903-792303827565">25_12_10_change_site_visibility_1.png</a></td><td><a href="/docs/publish/publish-a-docs-site#publish-a-docs-site">Publish a docs site</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FDpa2c6rD9NiYgtdlIvF0%2FChange%20site%20visibility.png?alt=media&amp;token=f2c838ef-2737-4b8a-ad8b-69453bf28f53">25_12_10_change_site_visibility.png</a></td><td></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FDpa2c6rD9NiYgtdlIvF0%2FChange%20site%20visibility.png?alt=media&amp;token=f2c838ef-2737-4b8a-ad8b-69453bf28f53">25_12_10_change_site_visibility.png</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FDpa2c6rD9NiYgtdlIvF0%2FChange%20site%20visibility.png?alt=media&amp;token=f2c838ef-2737-4b8a-ad8b-69453bf28f53">25_12_10_change_site_visibility.png</a></td><td></td></tr><tr><td><strong>Add auto-translations</strong></td><td>Create one-click translations that update automatically</td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FC5waVC2qQyf9I6hE7uQW%2FAdd%20auto-translations.png?alt=media&amp;token=888e2471-7041-40f0-8b22-83c442bd0808">25_12_10_add_auto_translations_1.png</a></td><td><a href="/docs/manage-your-site/site-settings">Site settings</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Flewca2EA3o9UnsB9j0vz%2FAdd%20auto-translations.png?alt=media&amp;token=f3a42248-f303-44ce-b577-375f8579c34c">25_12_10_add_auto_translations.png</a></td><td></td><td></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Flewca2EA3o9UnsB9j0vz%2FAdd%20auto-translations.png?alt=media&amp;token=f3a42248-f303-44ce-b577-375f8579c34c">25_12_10_add_auto_translations.png</a></td><td></td></tr><tr><td><strong>Install integrations</strong></td><td>Integrate with your stack and extend functionality with powerful integrations</td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FitoGCSdPpGwPPCGwb29a%2FInstall%20integrations.png?alt=media&amp;token=6243ef56-d3f7-464f-8d8b-7ffee19f02a3">25_12_10_install_integrations_1.png</a></td><td><a href="broken://pages/b29aoPwtKZKkAO7zajgr">Broken link</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F5bKkozsx0KN2mbeWaWMv%2FInstall%20integrations.png?alt=media&amp;token=8f25beb6-8844-486b-8afb-8ae50e9b7554">25_12_10_install_integrations.png</a></td><td></td><td></td><td></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F5bKkozsx0KN2mbeWaWMv%2FInstall%20integrations.png?alt=media&amp;token=8f25beb6-8844-486b-8afb-8ae50e9b7554">25_12_10_install_integrations.png</a></td></tr><tr><td><strong>Add an API reference</strong></td><td>Create auto-updating, interactive API reference docs from an API spec</td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F2mbcS7cM3bp2Gi5XwWmf%2FAdd%20an%20API%20reference.png?alt=media&amp;token=fed30694-81df-4f0f-a061-9c869879fda1">25_12_10_add_an_api_reference_1.png</a></td><td><a href="broken://pages/EAZLjjyX6jX76NFnj71P">Broken link</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F5q9ieVfqWc6JewePmrTd%2FAdd%20an%20API%20reference.png?alt=media&amp;token=43439c73-f6bd-43f4-b7fa-6c9c03b3c969">25_12_10_add_an_api_reference.png</a></td><td></td><td></td><td></td><td></td></tr><tr><td><strong>Track docs analytics</strong></td><td>Use the built-in insights to measure success and understand user behavior</td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FSmrnppLSbEjgJXeblvHp%2FTrack%20docs%20analytics.png?alt=media&amp;token=09f31b10-1c10-48e1-a21c-bcc3d356b70d">25_12_10_track_docs_analytics_1.png</a></td><td><a href="/docs/analytics/insights">Site analytics</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FbzbqcT1c5ndzkO12Eh6d%2FTrack%20docs%20analytics.png?alt=media&amp;token=23b06593-393f-4382-a97f-697009646263">25_12_10_track_docs_analytics.png</a></td><td></td><td></td><td></td><td></td></tr></tbody></table>


# LLM-ready docs

Make your published docs easier for AI tools to discover, read, and use

GitBook automatically publishes AI-friendly formats for your docs site.

They help large language models (LLMs), coding agents, and AI search systems. These tools can discover and retrieve accurate documentation without parsing HTML.

## Markdown pages

Append `.md` to any published page URL to view its Markdown. Markdown gives AI tools structured content without the surrounding HTML.

<a href="https://gitbook.com/docs/publishing-documentation/llm-ready-docs.md" class="button primary">Check out the .md file for this page</a>

## llms.txt

[llms.txt](https://llmstxt.org/) is a proposed standard for LLM-friendly web content. Append `/llms.txt` to your docs site's root URL.

It lists every published page with a Markdown version. AI tools can use this index to discover your documentation.

<a href="https://gitbook.com/docs/llms.txt" class="button primary">Check out the /llms.txt for the GitBook docs</a>

## llms-full.txt

Append `/llms-full.txt` to your docs site's root URL. This file includes your full documentation content in one place.

Hidden pages are included in `llms-full.txt`. Hiding a page only removes it from the published table of contents.

<a href="https://gitbook.com/docs/llms-full.txt" class="button primary">Check out the /llms-full.txt file for the GitBook docs</a>

## MCP server for published docs

GitBook exposes a Model Context Protocol (MCP) server for every published docs site. Compatible tools can discover and retrieve your docs as structured resources.

Hidden pages remain available through the site’s MCP server. Hiding a page only removes it from the published table of contents.

Append `/~gitbook/mcp` to your docs site's root URL. For example, GitBook's MCP server is `https://gitbook.com/docs/~gitbook/mcp`.

{% hint style="info" %}
Opening this URL in a browser returns an error. Use a tool that can make HTTP requests.
{% endhint %}

Learn more in [MCP servers for published docs](/docs/ai-for-your-readers/mcp-servers-for-published-docs).

## Optimizing your docs for AI

GitBook handles the delivery layer. Your writing shapes the quality of AI answers.

Write content that AI tools can interpret reliably:

* Give each page a clear purpose.
* Use descriptive headings and short sections.
* State constraints, defaults, and requirements directly.
* Include concrete examples and exact values.
* Update content when your product changes.

These practices improve retrieval, reduce ambiguity, and help people find answers.

### Keeping translations aligned

If you publish in multiple languages, keep each translation aligned with its source.

[Translations](/docs/gitbook-agent/translations) let you localize content with GitBook Agent. When source content changes, GitBook can keep translated versions aligned.

### Measuring AI traffic

Use [Site analytics](/docs/analytics/insights) to track traffic from LLMs and MCP clients.


# Migrate to GitBook

How to import existing content into GitBook from Confluence, Notion, Git and more

You can migrate and unify existing documentation in GitBook using the import tool.

You have the option to import single or multiple pages using our built-in import tool — or [an entire Git repository using Git Sync](#import-using-git-sync).

## Using the Import panel

The Import panel makes it easy to migrate your content into your GitBook organization from another documentation website or from existing files.

When you choose to import from another online documentation site, all you have to do is add the URL of the site and GitBook will handle the rest.

By default, GitBook uses AI to streamline the import process. This will intelligently refine and clean up imported content that doesn’t perfectly match GitBook’s formats — meaning the output will be more polished and use GitBook’s blocks more effectively. You can disable this from the menu.

### Supported import formats

GitBook supports imports from docs websites or files in the following formats:

* Markdown (`.md` or `.markdown`)
* HTML (`.html`)
* Microsoft Word (`.docx`)

GitBook also support imports from:

* Confluence
* Notion
* GitHub Wiki
* Quip
* Dropbox Paper
* Google Docs

If you want to **import multiple pages**, you can upload a ZIP file containing HTML or Markdown files, or use the **Online docs** import option.

{% hint style="info" %}
GitBook is Markdown-based, so importing content in Markdown format will yield the best results. If your current tools support exporting in Markdown, we recommend using that format for a smoother import process.
{% endhint %}

### The Import panel

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F8omDHqTDwNkvdG6Hv81q%2FImport%402x%20(1).png?alt=media&amp;token=a5c0993c-f49a-4911-8297-6e76f0435bcb" alt="A GitBook screenshot showing the import panel"><figcaption><p>The import panel in GitBook.</p></figcaption></figure>

When you create a new section, you’ll have the option to import content in the modal that appears. If you create an empty section, you can also import using the **Quickstart** section at the bottom of the new empty page when you click **Edit**.

Alternatively, you can always import a page or subpage by selecting **Add new** > **Import pages** at the bottom of the [table of contents](/docs/reference/gitbook-ui#table-of-contents), or by opening the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> for a page and choosing **Import subpages**.

After choosing an input source, you can select the file you’d like to import.

{% hint style="warning" %}
GitBook imports content from various sources, but differences in product features and document formats may cause variations in the imported content compared to the original source.
{% endhint %}

### Limitations

GitBook currently has the following limits for imported content:

* The maximum number of pages that can be uploaded in a single import is **20**.
* The maximum number of files (images etc.) that can be uploaded in a single import is **20**.

GitBook can't increase these import limits. To import more content at once, use [Git Sync](/docs/docs-as-code/git-sync), which supports up to 5,000 Markdown pages.

***

## Import from a GitHub or GitLab repo using Git Sync <a href="#import-using-git-sync" id="import-using-git-sync"></a>

When importing large volumes of content into GitBook, we recommend using [Git Sync](/docs/docs-as-code/git-sync). While our built-in migration tool can handle most imports, Git Sync is better suited for handling larger migrations efficiently.

{% hint style="info" %}
You’ll find the essential steps to import your content below. For more detailed steps and a video demo, head over to our dedicated guide for [importing content into GitBook using Git Sync](/docs/guides/editing-and-publishing-documentation/import-or-migrate-your-content-to-gitbook-with-git-sync).
{% endhint %}

{% stepper %}
{% step %}
**Convert your content into Markdown**

GitBook is Markdown-based, so importing content in Markdown format will yield the best results. If your current tools support exporting in Markdown, we recommend using that format for a smoother import process.

If your content isn’t already in Markdown files, we recommend using a script (like [Markitdown](https://github.com/microsoft/markitdown)) or an online tool to convert your content.
{% endstep %}

{% step %}
**Organize your content in GitHub or GitLab**

When setting up your GitBook site, it’s crucial to organize your content in your GitHub or GitLab repository efficiently. Since Git Sync occurs at the section level, carefully plan how to group your content. Create multiple repositories or folders, ensuring the necessary Markdown files are in the correct locations.
{% endstep %}

{% step %}
**Set up sections and configure Git Sync**

To organize your content, create one or more sections in GitBook as needed. Install the [GitHub Sync](https://www.gitbook.com/integrations/github-sync) or [GitLab Sync](https://www.gitbook.com/integrations/gitlab-sync) integrations in your organization and configure it for those sections. You’ll need to synchronize your section with the folder or repository you set up in the previous step.
{% endstep %}

{% step %}
**Run Git Sync in the direction GitHub → GitBook**

When following the configuration process, make sure you select the direction of GitHub → GitBook. This will result in the contents of your folder or repository being pulled from GitHub or GitLab into GitBook.
{% endstep %}
{% endstepper %}

## Export your content

You can export your GitBook content in two ways:

* **As Markdown**, by syncing with a Git repository. There's no direct Markdown export in the app — sync the section you want to export with an empty GitHub or GitLab repository using [Git Sync](/docs/docs-as-code/git-sync), and the repository becomes your Markdown export. Some blocks don't have a Markdown representation and appear as HTML in the export.
* **As a PDF**, from the page or section's Actions menu. See [PDF export](/docs/publish/pdf-export). You may hit limits when exporting very large sections.


# Site workspace

Learn how the site workspace changes navigation, content structure, and permissions in GitBook

## The sites-first workspace in GitBook

GitBook is now organized around your docs sites. Everything in the app is arranged around the sites you publish, so what you see while editing matches what your visitors see when reading.

This page explains the workspace and what it means for your existing content.

<div data-with-frame="true"><figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FB5REa0OVf0NOyqISJNYj%2FSite%20workspace.png?alt=media&amp;token=b86d1b19-e910-44ed-868f-d5848cff24ba" alt=""><figcaption></figcaption></figure></div>

### Why the site workspace

Previously, GitBook organized your work around spaces and collections, and sites were built on top by linking spaces together. That meant the structure you navigated in the app never quite matched the structure of your published site.

The site workspace closes that gap. Your organization contains sites, and every piece of content lives inside a site as a **section**. The hierarchy you edit is the hierarchy your readers get.

### What’s new

#### Home shows all your sites

When you open GitBook, you land on your organization **Home**: your docs sites, recent changes, and organization-wide tools, in one place. To get back to it from anywhere, use the switcher at the top of the sidebar.

#### The sidebar shows your site, not your org

Opening a site replaces the sidebar with that site’s content tree, the same structure visitors see on your published site. Navigate straight to any section and start editing without switching contexts.

The content tree in the sidebar is read-only. To reorganize your site, open the **structure editor**, a dedicated screen that replaces the old Structure tab in Site settings. Changes you make there reflect back in the sidebar immediately.

#### Sections replace spaces

Content in a site now lives in **sections**. If you’ve used GitBook before, a section is what you knew as a space linked to a site. Sections work the same way in the editor. The change is where they live and how they inherit settings from their site.

{% hint style="warning" %}
In the GitBook API, sections are still represented as `space` objects. Nothing changes for API integrations or Git Sync.
{% endhint %}

#### Site tools, one click away

Insights, Analytics, Customization, and Site settings are now items in the site sidebar and open in the main view. You no longer need to dig through nested settings to find them. The screens themselves work exactly as before.

#### Draft sections

New sections start as **drafts**: linked to your site, editable by your team, but not visible to visitors. When you’re ready, publish a draft individually, or publish several at once from the structure editor.

To see how drafts will look on your site, switch the site preview between **Live** and **Live + Drafts**.

#### Organization settings, in context

Organization settings no longer take over the whole screen. They open in context at the organization level, alongside your organization Home, so you can adjust organization-wide options without losing your place.

#### Site-inherited permissions

Sections can inherit permissions from their site instead of from collections. When a member has access through more than one route, the most permissive grant applies. On Enterprise plans, sections shared across sites inherit the broadest access.

This is opt-in per space. Content you don’t opt in keeps the existing collection-based permissions.

### What happens to existing spaces and collections

Nothing is deleted or unpublished.

* Spaces already linked to a site become sections of that site.
* Spaces not linked to any site appear in a new **All content** section, alongside your sites, in the familiar tree view. Collections are preserved there as folders.
* If every space in your organization belongs to a site, the All content section doesn’t appear at all.


# Content structure

Learn how sites, sections, groups, and pages organize your GitBook content.

Content in GitBook is organized around your docs sites. Your organization contains sites, and each site is made up of **sections** — the pages you write and edit live inside a section.

Related sections can be organized into **groups** to shape your site's navigation. The structure you see while editing is the same structure your visitors see on your published site.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-globe">:globe:</i></h4></td><td><h4>Sites</h4></td><td>Create a site to publish and organize your documentation.</td><td><a href="/docs/getting-started/sites-first">Site workspace</a></td></tr><tr><td><h4><i class="fa-layer-group">:layer-group:</i></h4></td><td><h4>Sections</h4></td><td>Create sections to organize the content within your site.</td><td><a href="/docs/create-content/content-structure/space">Sections</a></td></tr><tr><td><h4><i class="fa-folder">:folder:</i></h4></td><td><h4>Groups</h4></td><td>Create groups to organize related sections in your site.</td><td><a href="/docs/create-content/content-structure/collection">Groups</a></td></tr><tr><td><h4><i class="fa-file-lines">:file-lines:</i></h4></td><td><h4>Pages</h4></td><td>Create pages to split up and edit the content in your documentation.</td><td><a href="/docs/create-content/content-structure/page">Pages</a></td></tr></tbody></table>


# Sections

A section is a part of your site where you work on a set of related pages. Sections let you write content, organize pages, add integrations, and more. Every section belongs to a site, and you can organize related sections into groups.

{% hint style="info" %}
The GitBook API represents sections as `space` objects. This has no impact on API integrations or Git Sync.
{% endhint %}

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FHaZz8c6V8LYpNM6ZLHlv%2Fcreating-content-content-structure-space%402x.png?alt=media&amp;token=085393dd-d9a9-4400-8812-7436ebf8bbc5" alt="A GitBook screenshot showing a site&#x27;s content tree in the sidebar"><figcaption></figcaption></figure>

### Create a section

1. In your site, click **Add…**.
2. Click **New section**.

Create a section at the top level of your site or inside a group. New sections start as **drafts**: part of your site and editable by your team, but not visible to visitors until you publish them.

Edit a section's name by hovering over the name in the section header.

### Publish a draft section

1. Open the section's **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
2. Click **Publish**.

Or publish several drafts at once from the structure editor.

To preview how drafts look on your site, switch the site preview between **Live** and **Live + Drafts**.

### Duplicate a section

1. Open the section's **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
2. Click **Duplicate**.

Duplicating a section creates a copy of the source section in the same location (site or group).

{% hint style="warning" %}
Duplicating a section copies the content in the source section. It doesn't copy revisions or version history.
{% endhint %}

### Move or reorder a section

The content tree in the sidebar is read-only. To move a section into or out of a group, or to reorder sections:

1. Open the **structure editor**.
2. Drag the section to its new position.

Changes reflect back in the sidebar — and on your published site — immediately.

### Delete a section

1. Open the section's **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
2. Click **Delete**.

{% hint style="warning" %}
**Restore deleted sections from the Trash for up to 7 days.** After that, GitBook deletes them permanently.
{% endhint %}


# Groups

Organize related sections within your site

Section groups let you organize related sections within your site, making your site's structure easier for visitors to navigate.

Section groups are different from [Pages](/docs/create-content/content-structure/page). Page groups organize pages within one section. Section groups organize sections in site navigation. Both are called groups, but you configure their icons independently.

### Create a group

1. In your site, click **Add…**.
2. Click **New group**.
3. Choose a title and an icon that represents the group.

New groups start as **drafts**: they aren't visible on your published site until you publish them.

### Add sections to a group

1. Open the **structure editor**.
2. Drag the section into or out of the group.

Or create a new section directly inside a group.

### Publish a group

1. Open the group's **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
2. Click **Publish**.

Or publish several drafts at once from the structure editor.

To preview how draft groups look on your site, switch the site preview between **Live** and **Live + Drafts**.

### Rename a group

1. Click the **Action menu** icon <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> next to the group.
2. Click **Rename**.
3. Change the group's title or icon.

### Delete a group

1. Open the group's **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
2. Click **Delete**.


# Pages

Add pages, page groups or external links — and learn about the options you have on each page

A page is the place where you can add, edit and embed content. Pages always live inside a section, allowing you to group related content for the topics or areas you're covering.

When you publish your site, each section appears in your site's navigation, and the pages inside it all appear under that section.

### Table of contents

Create as many pages as you need in a section. They're all visible on the left sidebar of your screen in your section's table of contents. The table of contents appears in the same place on your published site, unless [you choose to hide it](#page-options).

{% hint style="info" %}
**Section landing page**

The first page in your table of contents is always your section's landing page, even if it's hidden from the table of contents.
{% endhint %}

### Create a new page

1. Enter live edit mode or open a change request.
2. Click **Add new\...** at the bottom of your table of contents.
3. Click **Page**.

Or hover between pages in the table of contents and click the **+** icon that appears.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FP0V046UJgzgtkrD1NiQG%2Fcreating-content-content-structure-page%402x%20(1).png?alt=media&amp;token=69805dbf-4ce7-4a6b-ac4d-43fc958d62c4" alt="A GitBook screenshot showing an empty page listed in the table of contents"><figcaption><p>An empty page in GitBook. You can see it listed in the table of contents on the left-hand side.</p></figcaption></figure>

### New page option missing

{% hint style="warning" %}
If live edits are disabled for your section, create or edit a change request. In a change request, the **New page** button — which creates pages, page groups, and links — is available in the table of contents.

You might also lack the permissions to edit a page.
{% endhint %}

### Organizing your content

There are three ways to organize your content in the table of contents:

#### Pages

A page has a title, an optional description, and an area where you can write and add any kind of content.

Nest pages by dragging and dropping a page below another in the table of contents. Doing this creates a **subpage**.

If you add subpages to an empty parent page, GitBook automatically generates a 'contents' page with links to all the subpages in the published version of your docs.

{% hint style="info" %}
**Tip:** There's no limit to page nesting, but avoid more than three levels to keep your navigation simple.
{% endhint %}

When you change the title of a page, the page's slug (the part at the very end of the URL, such as `/hello-world`) also changes — unless you've manually set the page's slug previously.

A published page URL follows the navigation tree, not your Git Sync file layout. It includes the top-level section or group slug, every ancestor page or group slug, and the page's own slug.

For example, this Git Sync file layout:

```
content/
└── setup/
    └── install.md
```

Can have this navigation tree:

```
API
└── Guides
    └── Install
```

If the slugs are `api`, `guides`, and `install`, the published URL is `/api/guides/install`. The file path doesn't determine the URL.

To change the title, link title, or slug of a page:

1. Open the page's **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
2. Click **Edit title & slug**.

#### Page link title

To give your page a longer SEO-friendly title while keeping a shorter title for your navigation entry and links, define a link title.

1. Open the page's **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
2. Click **Edit title & slug**.
3. In the **Edit page** dialog, enable and define a link title for that page.

If you're using Git Sync, set the page link title in `SUMMARY.md` on the page link:

```markdown
# Table of contents

* [Page main title](page.md "Page link title")
```

{% hint style="info" %}
**Note:** Page link titles appear in the table of contents, the pagination buttons at the bottom of each page, and any relative links you add to that page.
{% endhint %}

Page link titles are optional — if you don't add one, the page uses its standard title.

#### Page groups

Page groups bring related pages together within a section's table of contents. You can add an icon to each page group.

{% hint style="info" %}
Page groups organize pages within one section. Section groups organize sections in site navigation. They are different objects, even though both are called groups. See [Groups](/docs/create-content/content-structure/collection).
{% endhint %}

Create a page group by clicking **Add new\...** > **Group** at the bottom of your table of contents.

Page groups live only at the **top level** of the table of contents — you can't nest page groups inside each other.

{% hint style="warning" %}
Page-group slugs become part of every child page URL. Adding, renaming, or removing a page group changes child page URLs and breaks existing links unless you add redirects. See [Site redirects](/docs/publish/site-redirects).
{% endhint %}

To change the title, slug, or icon of a page group:

1. Click the **Action menu** icon <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> next to the group title in the table of contents.
2. Click **Rename**.
3. Update the title, slug, or icon.

{% hint style="warning" %}
`SUMMARY.md` doesn't store page-group icons. GitBook stores them, and Git Sync doesn't round-trip them. If your repository recreates a page group, GitBook doesn't restore the original icon automatically. Set the icon again in GitBook.
{% endhint %}

#### External links

Add links to your table of contents to take people directly to the linked content.

Create an external link by clicking **Add new\...** > **External link** at the bottom of your table of contents.

### Page icons and emojis

To improve visibility for readers when skimming your table of contents, add an optional icon or emoji to individual pages. The icon or emoji appears in the table of contents, and next to the title at the top of the page.

To add an icon or emoji, click the **Add icon** button when hovering the page title, or the emoji button to the left of the title.

### Page options

In the **Page options** menu, customize the look and feel of a selected page within a section and control its visibility.

#### Layout

Open the **Page options** <picture><source srcset="/files/tb21SaZbz1g0fv6lzP83" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FAsao5RY8jwAmcYhpVwPI%2Foptions.svg?alt=media&amp;token=d962d9a8-0cd6-42e7-a7b7-50c68a74dfea" alt="The Page options menu icon in GitBook"></picture> menu or change a page's cover by hovering over the page title. The buttons appear just above the page title.

In the **Page options** side panel, choose how each page displays to visitors of your **published** content. There are three layout presets to choose from, or you can create a custom layout.

Each layout preset toggles the following parts of the page on or off:

* Page title
* Page description
* Table of contents
* Page outline
* Next/previous links
* Page metadata
* Tags

Tag a page with one or more tags from **Library** → **Tags**. Turn on **Show tags on page** to display them in the page header. Or pick one tag as the page's primary tag, which GitBook can show next to the page in the table of contents. Learn more in Tags.

Set your page's global width from this menu, too. Choosing **Wide** gives blocks such as tables, cards, and code blocks more space on the published page. Use this for eye-catching landing pages.

#### Visibility

Choose which pages to show or hide in your published documentation, and whether each page appears in your site's search and in search engines.

To hide a page or group of pages from your site's table of contents:

1. Open the page's **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
2. Toggle **Hide page**.

Hidden pages are only hidden from the published table of contents. They remain available through the site's MCP server and in `llms-full.txt`.

If you're using Git Sync, hidden pages include the following front matter in the Markdown file:

<pre class="language-markdown" data-title="page.md"><code class="lang-markdown">---
hidden: true
<strong>---
</strong></code></pre>

{% hint style="warning" %}
Hiding **Page title** or **Page description** only hides the page header in published content. It doesn't remove headings inside the page body. Learn more about heading levels in Headings.
{% endhint %}

#### Metadata (SEO)

Use **Page options → Metadata** to control how search engines understand relationships between similar pages (for example: documentation versions or content variants).

* **Canonical URL**: the preferred (authoritative) URL for this page. Search engines treat it as the 'source of truth'. Use it when multiple URLs show the same content.
* **Alternate URLs**: other URLs for the same content in another variant. For example, another version or language. They help search engines group variants instead of treating them as duplicates.

Both fields support selecting another GitBook page (recommended) or entering an external URL.

{% hint style="info" %}
A common pattern for versioned docs is to set older pages to be canonical to the latest equivalent page (for example, `1.0` → `2.0`), and then list older versions as alternates on the latest page.
{% endhint %}

#### Moving pages between sections

GitBook doesn't currently support moving individual pages between sections in the app. To move a page's content to another section:

* **Copy and paste** — select the page's content with the `Esc` key, then copy and paste it into the destination. Some blocks may need reconfiguring; comments and page history aren't copied, and images need re-uploading in the new section.
* **Use Git Sync** — if both sections sync with repositories, copy the files between repositories and add the page titles to the destination's `SUMMARY.md`. See [Git Sync](/docs/docs-as-code/git-sync).

### Page covers

Set a page cover for each page of your documentation. When you click the **Page cover** <picture><source srcset="/files/m3pW0fk37zO88JKWr4U5" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FI1Q5rfhHgy0toM2pUEH5%2Fimage.svg?alt=media&amp;token=a3cf4181-880b-4698-9a1b-1a99f48bb03b" alt="The Page cover icon in GitBook"></picture> option, GitBook adds a default cover immediately. The ideal cover image size is 1990 × 480 pixels — covers are locked to this aspect ratio, so the proportions are maintained across screen sizes. From here, you can:

* **Change the cover image**
  1. Hover over the page cover and click **Change cover**.
  2. Choose or upload an image. The ideal size is 1990x480 pixels.
* **Reposition the cover image**
  1. Hover over the page cover and open the **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
  2. Click **Reposition**.
  3. Drag the image into place and click **Save**.
* **Remove the cover image**
  1. Hover over the page cover and open the **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
  2. Click **Remove**.
* **Full width and hero width**

  Change the style of your page cover to span the full width of your screen or just the width of your content.

  1. Hover over the page cover and open the **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture>.
  2. Click your preferred option.


# Tags

Tags are reusable labels you can add to pages and update blocks — this page tells you how to create, add and manage tags

Use tags to group related content, convey release states, mark outdated content, or anything else that helps readers scan your documentation.

#### Tag a page

Open the page, then open the **Tags** menu — accessible by hovering over the page title — and create or add tags. You can drag tags around to change the order in which they appear on the page.

1. Open the page.
2. Hover over the page title and open **Page options**.
3. Add one or more tags.

Drag tags to change the order in which they appear on the page.

#### Show or hide tags on a page

Tags display at the top of the page by default. To hide a page's tags while keeping the associated metadata:

* Open the **Tags** menu
* Turn off **Show tags on page** to keep tags as metadata only

1. Open **Page options**.
2. Turn off **Show tags on page**.

#### Display a tag in the table of contents

For each page, you can pick one tag to display in the table of contents. To choose which tag displays:

* Open the **Tags** menu
* Use the **Display in table of contents** dropdown to choose your tag
* You can also click into a tag and **Display**, **Remove** or **Replace in table of contents**.

1. Open **Page options**.
2. Under **Tags**, choose your tag from the **Display in table of contents** dropdown.

#### Tag an update block

Each update block can have its own tags.

1. Open the update block.
2. Click **Add tag** below the date.
3. Use the tag picker to add, remove, or reorder tags.

#### Manage tags in the Library

To view, create and manage tags for your space, open the **Library** from the [table of contents](/docs/create-content/content-structure/page#table-of-contents) and choose **Tags**. You can quickly access this by opening the **Tags** menu and selecting **Open Tag Library**.\
\
You can also view an individual tag in the library by selecting the tag and choosing **Show in Library**.

To view, create, and manage tags for your section:

1. Open the **Library** from the table of contents.
2. Click **Tags**.

Each tag has:

* A label — what readers see
* A slug — a stable identifier
* An optional icon or emoji

#### Tags in Markdown

If you use Git Sync, tags appear in the page frontmatter:

```yaml
---
description: "Tags are reusable labels you can add to pages and update blocks — this page tells you how to create, add, and manage tags"
tags:
  - news
  - experiment
  - tag: beta
    primary: true
  - pro
---
```

Use a string for a standard tag. Use `primary: true` on one tag to make it the page's primary tag — GitBook can show that tag in the table of contents.


# All content

Browse, search, and manage content across all of your sites, and content that isn’t part of a site yet, from one screen

In GitBook, your content lives in [sections](/docs/manage-your-site/site-structure/site-sections) that belong to a docs site. The **All content** screen gives you one place to see everything in your organization: content from every site, and content that isn’t part of a site yet.

### Open All content

From your organization **Home**, click **Content** in the sidebar.

### Browse, filter, and search

Each row shows the content’s name and when it was last updated. Click a row to open it.

To narrow the list, click the **All sites** filter and choose a site. To find something by name, use the **Search content** field.

### Create content

Click **Create content** to start new content from this screen.

It’s best that content belongs to a parent site. Create new content inside a site whenever you can — it keeps your structure, permissions, and publishing in one place. See [Site structure](/docs/manage-your-site/site-structure) to learn how sections fit into a site.

### Content that isn’t part of a site

If your organization used GitBook before our navigation remodel, some of your content may not belong to a site. It still appears in **All content**, and you can keep editing and collaborating on it here.

To publish that content, add it to a site as a section. Learn more in [Site structure](/docs/manage-your-site/site-structure).


# Format content

Format your content in various ways using the context menu or keyboard shortcuts

To format your text, simply select the words you want and choose one of the formats from the context menu — or format your text using a keyboard shortcut or through Markdown syntax.

{% hint style="info" %}
We've written these shortcuts using Mac keys. Use **Control** in place of **⌘ (Command)** on Windows or Linux operating systems. Check out our keyboard shortcuts section to see all the shortcuts for all operating systems.
{% endhint %}

#### Bold

Keyboard shortcut: <kbd>⌘</kbd> + <kbd>B</kbd>

{% tabs %}
{% tab title="Markdown" %}

```markdown
**Bold**
```

{% endtab %}
{% endtabs %}

#### Italic

Keyboard shortcut : <kbd>⌘</kbd> + <kbd>I</kbd>

{% tabs %}
{% tab title="Markdown" %}

```markdown
_Italic_
```

{% endtab %}
{% endtabs %}

#### Strikethrough

Keyboard shortcut: <kbd>⇧</kbd> + <kbd>⌘</kbd> + <kbd>S</kbd>

{% tabs %}
{% tab title="Markdown" %}

```markdown
~~Strikethrough~~
```

{% endtab %}
{% endtabs %}

#### Code

Keyboard shortcut: <kbd>⌘</kbd> + <kbd>E</kbd>

{% tabs %}
{% tab title="Markdown" %}

```markdown
`Code`
```

{% endtab %}
{% endtabs %}

#### Link

Keyboard shortcut: <kbd>⌘</kbd> + <kbd>K</kbd>

When you add a link to text on your page, you'll be prompted to provide the link. You can add any URL, but if you're linking to another page or section in your site, we recommend using a relative link.

This is a [link to an external page](https://www.gitbook.com).

This is a [link to another page in this section](/docs/create-content/blocks).

This is a [link to a section on this page](#code).

This is a [link that starts an email to a specific address](mailto:support@gitbook.com).

#### Color and background color

Click the color icon in the context menu, and choose a color for the text or its background.

<mark style="color:orange;">This text is orange.</mark>

<mark style="background-color:orange;">This text background is orange.</mark>

### Right-to-left text

GitBook doesn't currently support right-to-left contributions. Paragraphs and headings automatically detect RTL text and adapt their layout, but lists and other content blocks may not align properly, and font quality can be reduced for some languages.


# Inline content

Use the inline palette to add images, links, math & TeX, and more

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQcBDNerKxNvi1X3Jnk2R%2F26_01_22_inline-palette%402x.png?alt=media&amp;token=08b0298b-627f-4394-addf-dd5b49cf3501" alt="A GitBook screenshot showing inline content options"><figcaption><p>Add inline elements to your content.</p></figcaption></figure>

The inline palette lets you quickly add extra content to your text block without moving your hands away from the keyboard. Simply hit `/` on any text block to open the inline palette. The forward slash will be replaced by the content you choose to insert.

## Annotations

With annotations, you can add extra context to your words without breaking the reader’s train of thought. You can use them to explain the meaning of a word, insert extra information, and more. Readers can hover over the annotated text to show the annotation above the text.

### Create an annotation

To create an annotation, select the text you would like to annotate and click the **Annotate** option in the context menu. Once you’ve written your annotation, click outside of it to continue writing in the text block.

### Markdown representation

You can write content as [Markdown footnotes](https://www.markdownguide.org/extended-syntax/#footnotes) to add them as annotations in GitBook. Footnote indicators should appear immediately after the word you wish to annotate; they should not appear after punctuation marks or other symbols.

```markdown
Here's a simple footnote[^1], and here's a longer one[^bignote].

[^1]: This is the first footnote.

[^bignote]: Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    `{ my code }`

    Add as many paragraphs as you like.
```

### Rendered example

The Markdown source creates an annotation on the referenced text:

```markdown
Annotations add extra context[^annotation-example].

[^annotation-example]: Hover over “extra context” to read this annotation.
```

It renders as follows. Hover over the annotated text to preview the annotation:

[Annotations add extra context.](#user-content-fn-1)[^1]

## Images

Inline images will sit alongside your text on the page.

By default, images are set to their original size with a maximum width of 300px. You can change the size by clicking the image to open the formatting palette, then choosing one of the three options:

1. **Inline size:** The image is proportionally sized to the font — great for icons and badges.
2. **Original size:** The image will remain inline at its original size, with a maximum width of 300 pixels.
3. **Convert to block:** This turns an inline image into a image block, which is as wide as your content.

{% hint style="info" %}
Image blocks offer more options, including more sizes and the ability to add a caption — but will not appear inline with your text.
{% endhint %}

### Representation in Markdown

{% code overflow="wrap" %}

```markdown
Here is an inline image: <img src=".gitbook/assets/GitBook - Dark.jpg" alt="Dark version of GitBook logo" data-size="line">
```

{% endcode %}

It renders as follows: Here is an inline image: <img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQcBDNerKxNvi1X3Jnk2R%2F26_01_22_inline-palette%402x.png?alt=media&amp;token=08b0298b-627f-4394-addf-dd5b49cf3501" alt="GitBook logo" data-size="line">

## Emojis

You can add emojis by hitting `/` to open the inline palette. Alternatively, type `:` and a list of emojis will pop up directly in line — you can start typing the name of an emoji to narrow down the selection.

### Representation in Markdown

{% code overflow="wrap" %}

```markdown
:house:
:smile:
:dog:
```

{% endcode %}

They render as follows: :house: :smile: :dog: &#x20;

## Links

You can insert three different types of links:

* [Relative links](#relative-links)
* [Absolute links](#absolute-links)
* [Email address `mailto` links](#email-address-mailto-links)

### Relative links

Relative links are links created by linking to pages that already exist in your section. The advantage of using relative links is that if the page's URL, name, or location changes, its reference will be kept up to date — so you'll end up with fewer broken links.

Here’s how to insert a relative link:

1. Click somewhere in your paragraph where you want to insert the link, or select some text.
2. Hit / to open the inline palette and choose Link, click the **Link** button in the context menu, or hit **⌘ + K**.
3. Start typing the title of the page you want to link to.
4. Select the page from the drop-down search results.
5. Hit `Enter`.

### Absolute links

Absolute links are external links that you can copy and paste into your content. They're great when you want to link to something outside your documentation.

To insert an absolute link:

1. Click somewhere in your paragraph where you want to insert the link, or select some text.
2. Hit / to open the inline palette and choose Link, click the **Link** button in the context menu, or hit **⌘ + K**.
3. Paste the URL you want to link to.
4. Hit `Enter`.

{% hint style="info" %}
**Why don't external links open in a new tab?**

When you add a link to an external site in your docs, it will open in the same tab.

GitBook follows this [W3C-recommended behavior](https://www.w3.org/TR/WCAG20-TECHS/G200.html) to support [accessibility](https://it.wisc.edu/learn/make-it-accessible/websites-and-web-applications/when-to-open-links-in-a-new-tab/) and ensure a consistent, inclusive experience for your readers.
{% endhint %}

### Email address mailto links

Email address `mailto` links are useful when you want your visitors to click on a link that will open up their default email client and fill in the `To` field with the email address of your link, so they can write an email to send.

Here’s how to insert an email address `mailto` link:

1. Click somewhere in your paragraph where you want to insert the link, or select some text.
2. Hit / to open the inline palette and choose Link, click the **Link** button in the context menu, or hit **⌘ + K**.
3. Paste or type `mailto:something@address.com`, replacing `something@address.com` with the email address you would like to use.
4. Hit `Enter`.

### Representation in Markdown

```markdown
[This is a relative link to another page in this section](../content-structure/page.md)
[This is an absolute link](https://www.gitbook.com/blog)
[This is a link](mailto:support@gitbook.com) to our support email address
```

They render as follows:

[This is a relative link to another page in this section](/docs/create-content/content-structure)\
[This is an absolute link](https://www.gitbook.com/blog)\
[This is a link](mailto:support@gitbook.com) to our support email address

## Math & TeX

Using this option, you can create inline math formulas in your content. We use the [KaTeX](https://katex.org/docs/supported.html) library to render formulas.

{% hint style="info" %}
You can also insert a block-level math formula by opening the command palette in an empty block and choosing the second Math & TeX option.
{% endhint %}

### Representation in Markdown

```markdown
This is an inline formula: $$f(x) = x * e^{2 pi i \xi x}$$
```

It renders as follows: This is an inline formula: $$f(x) = x \* e^{2 pi i \xi x}$$

## Buttons

Buttons are a great way to highlight calls to action or add a search or Ask AI bar to your docs. You can use them to send readers somewhere, or help them find answers.

### Button actions

Buttons can do more than link to a URL. You can also turn a button into a search or ask GitBook Assistant bar — right from the page. These actions work on published pages, too — as you can see from the examples below.

You can configure the following actions:

#### **Add a link button**

Send readers to another page or an external URL:<a href="/docs/ai-for-your-readers/gitbook-ai-assistant" class="button primary" data-icon="gitbook-assistant">Learn more about Assistant</a>

#### **Add a search bar**

Open search with an optional preset query: <button type="button" class="button primary" data-action="search" data-icon="magnifying-glass">Search...</button>

#### **Add a Ask AI/GitBook Assistant bar**

Open GitBook Assistant with an optional preset prompt: <button type="button" class="button primary" data-action="ask" data-icon="gitbook-assistant">Ask a question...</button>

#### **Add a disabled button**

Show a button that’s intentionally inactive:<a class="button primary">Inactive button</a>

### Create and configure a button

1. Type `/` and choose **Button**.
2. Click the button to open the **Label** menu.
3. Choose an action, then set the label and style.
4. Optional: add a preset search query or Assistant prompt.

### Styles

Link and inactive buttons have both primary and secondary styles. Here are a couple of examples:

<a href="https://app.gitbook.com/join" class="button primary">Sign up to GitBook</a> <a href="#annotations" class="button secondary">Go to top</a>

### Representation in Markdown

```markdown
<a href="https://app.gitbook.com" class="button primary">GitBook</a>
```

It renders as follows: <a href="https://app.gitbook.com" class="button primary">GitBook</a>

## Icons

Icons add visual context to paragraphs, cards, and other content. They use the visual style defined in your customization settings.

Use an `<i>` element with both forms of the icon name. The Font Awesome class and token must match:

```markdown
<i class="fa-rocket">:rocket:</i>
```

Choose an icon name from the [Font Awesome icon picker](https://fontawesome.com/search). Unsupported names might not render or survive Git Sync.

<i class="fa-facebook">:facebook:</i> <i class="fa-github">:github:</i> <i class="fa-x-twitter">:x-twitter:</i> <i class="fa-instagram">:instagram:</i>

### Representation in Markdown

```markdown
<i class="fa-github">:github:</i>
```

It renders as follows: <i class="fa-github">:github:</i>

## Expressions

Expressions allow you to dynamically display content defined in a variable. Expressions can be inserted from the `/` menu. Once inserted, clicking on the expression will bring up the expression editor, allowing you to reference and [conditionally format](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_operator) your variable.

### Representation in Markdown

```markdown
Welcome to <code class="expression">page.vars.inlineExampleProduct</code>.
```

It renders as follows: Welcome to <code class="expression">page.vars.inlineExampleProduct</code>.

[^1]: This is an annotation.


# Markdown

Write Markdown directly in the editor to easily create content using common syntax

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FMbo91kXRJGPsIzXxsgpU%2Fmarkdown%402x.png?alt=media&amp;token=9d812c93-81df-4bca-a053-baa88d83f572" alt="An image containing the markdown logo"><figcaption><p>Write Markdown in GitBook.</p></figcaption></figure>

GitBook’s editor allows you to create formatted content using Markdown.

Markdown is a popular markup syntax that’s widely known for its simplicity. GitBook supports it as a keyboard-friendly way to write rich and structured text.

{% hint style="info" %}
You can learn more about Markdown itself by visiting [Common Mark](https://commonmark.org/help/).
{% endhint %}

### Text formatting <a href="#text-formatting" id="text-formatting"></a>

GitBook supports all the classic inline Markdown formatting:

| Formatting    | Markdown version  | Result            |
| ------------- | ----------------- | ----------------- |
| Bold          | `**bold**`        | **bold**          |
| Italic        | `_italic_`        | *italic*          |
| Strikethrough | `~strikethrough~` | ~~strikethrough~~ |
| Inline code   | `` `code` ``      | `code`            |

### Line breaks

Press `Enter` to start a new paragraph.

Press `Shift` + `Enter` to insert a soft line break in the same paragraph.

### Pasting Markdown

When pasting Markdown content directly into the editor, it’s important to use the **Paste and Match Style** option (typically <kbd>Shift</kbd> + <kbd>Cmd</kbd> + <kbd>V</kbd> on Mac or <kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>V</kbd> on Windows).

If you use the standard Paste option for content copied from another editor or from the web, it may be inserted as a code block instead of formatted text.

### Titles

* Heading 1: `# A first-level title`
* Heading 2: `## A second-level title`
* Heading 3: `### A third-level title`

### Code blocks

` ```⏎ ` creates a new code block.

` ```py⏎ ` creates a new code block with Python syntax highlighting.

We use [Prism](https://github.com/PrismJS/prism) for syntax highlighting. Use [Test Drive Prism](https://prismjs.com/test.html#language=markup) to check supported languages.

If GitBook and Prism differ, we might be a version or two behind.

### Lists

GitBook automatically detects and creates ordered and unordered lists as you type.

* Begin a line with `-` or `*` to start an unordered bullet list.
* Begin a line with `1.` to start a numbered list.
* Begin a line with `- [ ]` to start a task list.

When writing lists, hit `Tab` to indent, and `Shift+Tab` to outdent.

### Quotes

Begin a line with `>` to create a block quote. If you select an entire paragraph from start to end, typing `>` will wrap the content in a block quote.

> This is a block quote.

### Dividers

Type `---` then hit `Enter` to create a divider on your page.

***

This is an example of a divider.


# Blocks

Add and edit blocks within your content

GitBook is a block-based editor, meaning you can add different kinds of blocks to your content — from standard text and images to interactive blocks. Your pages can include any combination of blocks you want, and there’s no limit to the number of blocks you can have on a page.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FspecLXwmhIxrNj5QDyol%2Fcreating-content-blocks%402x%20(1).png?alt=media&amp;token=a1a7dbe0-f83d-4551-8f38-5665d02221bd" alt="A GitBook screenshot showing the available content blocks"><figcaption><p>GitBook's built in content blocks.</p></figcaption></figure>

### Inserting a new content block

You can insert a new content block below an existing block using your mouse:

1. Hover over the block above the place you need the new content block.
2. Click on the `+` icon that appears on the left to open the insert palette.
3. Select the block you want from the drop-down menu to insert it.

Alternatively, on a new line, you can press `/` to launch the insert palette, which lists all the available blocks. You can scroll through the list to find the one you want, or use your keyboard to search for the block you want, navigate up and down the list, and insert it with `Enter`.

### Exiting a block

Some content blocks capture the editing cursor to allow you to add content in the context of that block. For example, when you’re writing in [a hint block](/docs/create-content/blocks/hint), hitting `Enter` will add a new line within the hint block, rather than a new paragraph below.

When you are done, you can continue adding new content to the page either by inserting a new block using the `+` button to the left of your content, or by hitting **⌘ + Enter** on a Mac or **Ctrl + Enter** on a PC.

### Selecting blocks and interacting with selected blocks

You can select a single block by pressing the `Esc` key with the cursor in the block. You can also select multiple blocks by highlighting content within them and hitting `Esc`.

Once selected, you can:

* Select more blocks by clicking on them while keeping the **Shift ⇧** key pressed.
* Moving up and down to select the block above or below, using the **↑** and **↓** keys
* Copy the entire block using **⌘ + C** (Mac) or **Ctrl + C** (Windows)
* Cut the entire block using **⌘ + X** (Mac) or **Ctrl + X** (Windows)
* Delete the selected block or blocks using **⌫** or **Del**.


# Paragraphs

Add a paragraph block to insert formatted text, inline images and more

A paragraph is the most basic content block you can use on GitBook.

{% hint style="info" %}
You can [add other inline content](/docs/create-content/formatting/inline) to your paragraph, such as emojis, images and Math & TeX.

You can also [format your text](/docs/create-content/formatting) using the context menu or keyboard shortcuts, or using [Markdown](/docs/create-content/formatting/markdown).
{% endhint %}

### Example of a paragraph

Professionally printed material in English typically does not indent the first paragraph, but indents those that follow. For example, Robert Bringhurst states that we should “set opening paragraphs flush left.”

### Representation in Markdown

Because a paragraph block is just text, that’s how it’s represented in Markdown.

{% code overflow="wrap" %}

```markdown
Professionally printed material in English typically does not indent the first paragraph, but indents those that follow. For example, Robert Bringhurst states that we should “set opening paragraphs flush left.”
```

{% endcode %}


# Headings

Add heading blocks to a page to organize your content and improve SEO

Headings help give your documents structure — and using keywords in headings will also help search engines understand that structure, which can help your page rank higher in search results.

GitBook offers three levels of headings. Heading levels 1 (H1) and 2 (H2) will appear in the [page outline](/docs/reference/gitbook-ui#page-outline).

### Anchor links

When you add a heading to a page, it creates an anchor link. You can then link directly to these specific sections, to point people to relevant information.

#### Link to an anchor

You can see anchor links in public content, or private content in read-only mode, by hovering over the title and clicking the `#` that appears next to it. This will update the URL in your browser’s top bar, so you can copy it to use elsewhere.

If you want to link to a particular anchor from a page within your section, you can use a [relative link](/docs/create-content/formatting/inline#relative-links), which will update if you change the heading to prevent the link from breaking.

#### Edit an anchor

By default, the anchor link will be identical to the text in your header. If you plan to link to that URL outside of GitBook, changing the header in future will break the anchor link. The link will then take visitors to the top of the page, rather than the anchor location.

To avoid this, you can manually set the anchor link by opening the **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> for the header, then choosing **Edit anchor**. You can then enter the anchor link you wish to use — this will remain the anchor even if you change the header itself.

### Representation in Markdown

GitBook generates SEO optimized pages, meaning page titles in GitBook are automatically represented in markdown as a first level heading:

```markdown
# I'm a page title
```

This means that if you [sync your content with Git](/docs/docs-as-code/git-sync), page headers added through the editor will be represented as one level lower:

{% code overflow="wrap" %}

```markdown
## My heading 1
### My heading 2
#### My heading 3
```

{% endcode %}

### Heading examples <a href="#example-of-a-heading" id="example-of-a-heading"></a>

## My heading 1

### My heading 2

#### My heading 3

{% hint style="info" %}
Page titles are separate from heading blocks in the page body. If you hide the page title in **Page options**, your H1, H2, and H3 headings still appear.
{% endhint %}


# Unordered lists

Add an unordered list block to create bullet point lists

Unordered lists are great for making a series of points that do not necessarily need to be made in a particular order. They are effectively bullet point lists, with support for nesting as needed.

When typing a list in GitBook, you can exit the list and start a new empty block below by hitting `Enter` twice.

### Example of unordered list

* Item
  * Nested item
    * Another nested item
  * Yet another nested item
* Another item
* Yet another item

{% hint style="info" %}
To create nested items, you can use **Tab** to indent and **⇧ + Tab** to outdent.
{% endhint %}

### Representation in Markdown

```markdown
- Item
   - Nested item
      - Another nested item
   - Yet another nested item
- Another item
- Yet another item
```


# Ordered lists

Add an ordered or numbered list to a page

Ordered lists, also called numbered lists, help you prioritize items or create a list of steps.

### Example of ordered list

1. Item 1
   1. Nested item 1.1
      1. Nested item 1.1.1
   2. Nested item 1.2
2. Item 2
3. Item 3

{% hint style="info" %}
To create nested items, you can use **Tab** to indent and **⇧ + Tab** to outdent.
{% endhint %}

### Representation in Markdown

```markdown
1. Item 1
   1. Nested item 1.1
      1. Nested item 1.1.1
   2. Nested item 1.2
2. Item 2
3. Item 3
```

### Adding an inline image to an ordered list

Adding images inside of ordered lists is possible in GitBook

If you want to add an image within an ordered list, add it using the insert menu, then on the row below the image type `3.` then hit `Space`, and the ordered list will continue.

1. Item 1
2. Item 2

<div align="left"><figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FZudvpgboyiQl91R11K5I%2FExample%20image.png?alt=media&amp;token=9c78089a-d280-4985-bc58-78701b192fbb" alt="" width="375"><figcaption></figcaption></figure></div>

3. Item 3
4. Item 4


# Task lists

Add a task list to display tasks that can be completed

Task lists allow you to create a list of items with checkboxes that you can check or uncheck.

{% hint style="info" %}
**Note:** Readers of your published site can't check or uncheck these boxes. You can decide which boxes are checked and unchecked when you create the content.
{% endhint %}

### Example of a task list

* [ ] Here’s a task that hasn’t been done
  * [ ] Here’s a subtask that has been done, indented using `Tab`.
  * [ ] Here’s a subtask that hasn’t been done.
* [ ] Finally, an item, unindented using `shift` + `tab`.

### Representation in markdown

```markdown
- [ ] Here’s a task that hasn’t been done
  - [x] Here’s a subtask that has been done, indented using `tab`
  - [ ] Here’s a subtask that hasn’t been done.
- [ ] Finally, an item, unindented using `shift` + `tab`.
```


# Hints

Add a hint to a page to draw your reader’s attention to specific pieces of important information.

Hints, or callouts, are a great way to bring the reader’s attention to specific elements in your documentation, such as tips, warnings, and other important information.

There are four different hint styles — you can change the style by opening the block’s **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> and selecting the style you want. Each style uses a default icon, but you can customize the icon by clicking on it and choosing another one from [our icons set](/docs/create-content/formatting/inline#icons).

Hint blocks support [inline content](/docs/create-content/formatting/inline) and [formatting](/docs/create-content/formatting), as well some specific block types. To see which block types you can use in a hint, hit `/` on an empty line and check the [insert palette](/docs/create-content/blocks#inserting-a-new-content-block).

### Examples of hint blocks <a href="#example-of-a-hint" id="example-of-a-hint"></a>

{% hint style="info" %}
**Info hints** are great for showing general information, or providing tips and tricks.
{% endhint %}

{% hint style="success" %}
**Success hints** are good for showing positive actions or achievements.
{% endhint %}

{% hint style="warning" %}
**Warning hints** are good for showing important information or non-critical warnings.
{% endhint %}

{% hint style="danger" %}
**Danger hints** are good for highlighting destructive actions or raising attention to critical information.
{% endhint %}

{% hint style="info" icon="books" %}
This hint block has a custom icon.
{% endhint %}

{% hint style="info" %}

#### **This is a H2 heading**

This is a line

This is an inline <img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F0FzoF68PAY3Rv297meNB%2Fcommand.svg?alt=media&amp;token=b07ff261-6e28-4879-8ab1-039a49f6ab41" alt="The Apple computer command icon" data-size="line"> image

* This is a second <mark style="color:orange;background-color:purple;">line using an unordered list and color</mark>
  {% endhint %}

To add a heading to your hint, you need to create a heading block as the the first block in the hint.

### Representation in Markdown

```markdown
{% hint style="info" %}
**Info hints** are great for showing general information, or providing tips and tricks.
{% endhint %}

{% hint style="success" %}
**Success hints** are good for showing positive actions or achievements.
{% endhint %}

{% hint style="warning" %}
**Warning hints** are good for showing important information or non-critical warnings.
{% endhint %}

{% hint style="danger" %}
**Danger hints** are good for highlighting destructive actions or raising attention to critical information.
{% endhint %}

{% hint style="info" icon="books" %}
This hint block has a custom icon.
{% endhint %}

{% hint style="info" %}
## This is a H2 heading

This is a line

This is an inline <img src="../../.gitbook/assets/25_01_10_command_icon_light.svg" alt="The Apple computer command icon" data-size="line"> image

- This is a second <mark style="color:orange;background-color:purple;">line using an unordered list and color</mark>
{% endhint %}
```


# Quotes

Add a quote block to a page to highlight copy you’re adding from elsewhere, or to draw attention to a specific part of your text

Quotes are useful when you want to include something from another source.

Start a quote by typing `>` followed by pressing `Space` in an empty paragraph, or use the[ insert palette](/docs/create-content/blocks#inserting-a-new-content-block). You can also convert a paragraph block to a quote by highlighting the entire paragraph and hitting `>`.

### Example of a quote

> "No human ever steps in the same river twice, for it’s not the same river and they are not the same human." — *Heraclitus*

### Representation in Markdown

{% code overflow="wrap" %}

```markdown
> "No human ever steps in the same river twice, for it’s not the same river and they are not the same human." — _Heraclitus_
```

{% endcode %}


# Code blocks

Add a code block to a page to include sample code, configurations, code snippets and more

You can add code to your GitBook pages using code blocks.

When you add a code block, you can choose to [set the syntax](#set-syntax...), [show line numbers](#with-line-numbers), [show a caption](#with-caption), and [wrap the lines](#wrap-code). It’s also easy to [copy the contents of a code block to the clipboard](#copying-the-code), so you can use it elsewhere

A code block may be useful for:

* Sharing configurations
* Adding code snippets
* Sharing code files
* Showing usage examples of command line utilities
* Showing how to call API endpoints
* And much more!

### Add a code block

1. To add a code block, place your cursor on an empty line and type `/`.
2. In the quick insert menu, select **Code block**.
3. GitBook inserts the block and places your cursor inside it, ready for you to paste or type code.

### Example of a code block

{% code title="index.js" overflow="wrap" lineNumbers="true" %}

```javascript
‌import * as React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(<App />, window.document.getElementById('root'));
```

{% endcode %}

You can also combine code blocks with a [tabs block](/docs/create-content/blocks/tabs) to offer the same code example in multiple different languages:

{% tabs %}
{% tab title="JavaScript" %}

```javascript
let greeting = function (name) {
  console.log(`Hello, ${name}!`);
};
greeting("Anna");
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
greeting = lambda {|name| puts "Hello, #{name}!"}
greeting.("Anna")
```

{% endtab %}

{% tab title="Elixir" %}

```elixir
greeting = fn name -> IO.puts("Hello, #{name}!") end
greeting.("Anna")
```

{% endtab %}
{% endtabs %}

### Code block options <a href="#options" id="options"></a>

When you click on the **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> next to the code block, or the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> in the block itself, you’ll see a number of options you can set.

#### Set syntax… <a href="#set-syntax" id="set-syntax"></a>

You can set the syntax in your code block to any of the supported languages. This will enable syntax highlighting in that language, too.

{% hint style="info" %}
We use [Prism](https://github.com/PrismJS/prism) for syntax highlighting. You can use [Test Drive Prism](https://prismjs.com/test.html#language=markup) to check which languages Prism supports. If you notice a mismatch between GitBook and Prism, there’s a chance we’re a version or two behind. We’ll catch up soon!
{% endhint %}

{% code title="filename.txt" %}

```
// Some code
```

{% endcode %}

#### With line numbers <a href="#with-line-numbers" id="with-line-numbers"></a>

This will toggle line numbers for your code on and off.

Showing line numbers is useful when the code represents the contents of a file as a whole, or when you have long code blocks with lots of lines. Hiding line numbers is useful for snippets, usage instructions for command line or terminal expressions and similar scenarios.

#### With caption

This will toggle a caption that sits at the top of the block, above your lines of code.

The caption is often the name of a file as shown in [our example above](#example-of-a-code-block), but you can also use it as a title, description, or anything else you’d like.

#### Wrap code

This will toggle code wrapping on and off, so long lines of code will wrap to all be visible on the page at once.

Wrapping lines is useful when your code is long and you want to avoid having the viewer scroll back and forth to read it. If you toggle **Wrap code** on, you may also want to show line numbers — this will make it easier to read the code and understand where new lines start.

#### Expandable

This will toggle showing the code in full (when the toggle is off) or a collapsed window of the code which the user can expand (when the toggle is on).

The collapsed view defaults to showing 10 lines of code with an button to expand to show the full code block. If there are less than 10 lines of code, all the content will be shown.

### Code block actions

As well as the options above, you can also change the language the code block displays, and copy your code instantly.

#### Copy the code <a href="#copying-the-code" id="copying-the-code"></a>

Hover over a code block and a number of icons will appear. Click the middle icon to copy the contents of the code block to your clipboard.

### Representation in Markdown

````markdown
{% code title="index.js" overflow="wrap" lineNumbers="true" %}

```javascript
‌import * as React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(<App />, window.document.getElementById('root'));
```

{% endcode %}
````


# Files

Manage and add files to your site such as PDFs, videos, documents and more

You can upload files to your GitBook section and add them to your page for people to view or download.

You can show some files, such as images and OpenAPI files, on the page itself for people to see without clicking anything. For others, such as PDFs, users will have to click to view or download it.

You can also optionally add a caption below any file you insert into your page to add more information if needed.

### Example of a file <a href="#example-of-a-file" id="example-of-a-file"></a>

{% file src="/files/JjxP2nmSa01O6lINhHqi" %}
This is a caption on a file.
{% endfile %}

### Uploading a file

You can manage uploaded files in the **Library** tab of your site section. The **Library** tab is beside **Pages** at the top of the left navigation.

To upload a file, drag and drop it into the **Drop your file or browse** section, or select it and use your system file dialog to select the file you want to upload.

{% hint style="warning" %}
GitBook allows you to upload files up to 100MB per file.
{% endhint %}

You can also add files to a page when you add an image block or an OpenAPI block. When you create one of these blocks, the **Library** tab opens, so you can either select a file, or upload a new file.

{% hint style="info" %}
**Tip:** You can also drag and drop images from your file system directly into the editor — or paste a copied image into your content. GitBook will automatically add them to the **Library** tab for the respective section, so you can view and manage them later.
{% endhint %}

### Renaming a file

To rename a file, open the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> for the file, and click **Edit**. In the dialog prompt, enter the new name of your file.

### Deleting a file

To delete a file, open the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> for the file and click **Delete**. After confirming in the dialog that you’re sure you want to delete the file, your file will be deleted.

{% hint style="warning" %}
**Note:** Make sure you update any pages that included your deleted file! File blocks that reference a deleted file will show an empty block, or *Could not load image* error.
{% endhint %}

### Replacing a file

If you have a file that simply needs updating to a new version, you can replace it. This will swap out the old file and put the new file in its place. Any blocks that previously referred to the old file will then refer to the new file.

To replace a file, open the **Action menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> for the file and click **Replace**. In the file replacement dialog that appears, choose the new file and wait for the upload indicator to complete. Your file automatically updates everywhere it appeared in your section.

This can be helpful if, for example, you've had a major product redesign and need to update outdated UI screenshots that appear on multiple pages. Replacing the original file would update the screenshot everywhere in your section, saving you time and effort.

{% hint style="info" %}
**Tip:** Once you've uploaded an image or a file, you can reference it anywhere in your section by creating an image or a file block and selecting it from the **Library** tab.

We recommend you do this rather than uploading the image again every time you want to include it, to make it easier to replace images later and to avoid having multiple files with the same name.
{% endhint %}

### Representation in Markdown

```markdown
{% file src="https://example.com/example.pdf" %}
    This is a caption for the example file.
{% endfile %}
```


# Images

Add an image or a gallery of images to a page, add image variants for dark mode, and resize and align images to your needs

You can insert images into your page, then choose their size and whether to align them to the left, center, or right. You can also optionally include alt text and/or a caption on your image block.

{% hint style="info" %}
**Tip:** For accessibility purposes, we recommend setting alt text for your images.
{% endhint %}

### Example of an image block <a href="#example-of-an-image-block" id="example-of-an-image-block"></a>

<div align="center"><figure><img src="https://images.unsplash.com/photo-1446776709462-d6b525c57bd3?crop=entropy&#x26;cs=srgb&#x26;fm=jpg&#x26;ixid=M3wxOTcwMjR8MHwxfHNlYXJjaHwyfHxzcGFjZXxlbnwwfHx8fDE3MzMxOTY5NTR8MA&#x26;ixlib=rb-4.0.3&#x26;q=85" alt="A photograph taken from space looking back towards Earth. A satellite is in the foreground, and in the background is an ocean-covered part of our planet with patchy clouds."><figcaption><p>Example of an image block with a caption</p></figcaption></figure></div>

### Uploading an image

There are two ways to add images to your content:

1. Drag and drop the image from your file management system directly into an empty block on your page.
2. [Add an image block](/docs/create-content/blocks#inserting-a-new-content-block) to your page and use the **Select images** side panel that appears on the right of the window.

If you follow the second process, you can choose to upload a file, select a previously-uploaded file, paste an image URL or add an image from [Unsplash](https://unsplash.com/) using the built-in search.

{% hint style="warning" %}
GitBook allows you to upload images up to 100MB per file.
{% endhint %}

There's no set limit on the total number of assets in a section, though GitBook reserves the right to block accounts for abuse. For files larger than the upload limit, store them in a service like Google Drive or Dropbox and link to them from your page.

Animated gifs have a limit of 200 frames per file. Large files — gifs included — slow your page's loading time, so avoid uploading large files directly where you can.

#### Create an image gallery

Adding more than one image to an image block will create a gallery. To do this, open the block’s **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> and choose **Add images…** to open the **Select images** side panel again.

To delete an image from a gallery, open the **Edit menu** <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt=""></picture> on the image you want to delete and press the **Delete ⌫** key.

### Adding images for light & dark mode <a href="#light-and-dark-mode" id="light-and-dark-mode"></a>

You can set different images for the light and dark mode versions of your published site. GitBook will automatically display the correct image depending on the mode your visitor is in.

To add an image for dark mode, hover over your image, open the **Edit menu** <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt=""></picture> and click **Replace image** <picture><source srcset="/files/B8EhRVkFXw7nB8Q01UEZ" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F0mPo1tPDFeEbPOr1gc4V%2Freplace%20image.svg?alt=media&amp;token=9f037f9a-0f37-4c5b-9b30-6b55ffb11f5b" alt="The Replace image icon in GitBook"></picture>.

In the drop-down menu, choose **Add image for Dark mode**. Once you’ve set this, you can replace either image from this same menu.

{% hint style="warning" %}
**Note:** GitBook doesn’t currently support light and dark mode images for certain cases, including page covers or image covers on [cards](/docs/create-content/blocks/cards).
{% endhint %}

### Light and dark mode images through GitHub/GitLab Sync <a href="#light-and-dark-mode-through-github-gitlab-sync" id="light-and-dark-mode-through-github-gitlab-sync"></a>

You can also add light and dark mode images in Markdown through HTML syntax (`<picture>` and `<source>`).

For block images, use the `<figure>` HTML element with a `<picture>` and `<source>` in it:

```html
Text before

<figure>
  <picture>
    <source
      srcset="
        https://user-images.githubusercontent.com/3369400/139447912-e0f43f33-6d9f-45f8-be46-2df5bbc91289.png
      "
      media="(prefers-color-scheme: dark)"
    />
    <img
      src="https://user-images.githubusercontent.com/3369400/139448065-39a229ba-4b06-434b-bc67-616e2ed80c8f.png"
      alt="GitHub logo"
    />
  </picture>
  <figcaption>Caption text</figcaption>
</figure>

Text after
```

For inline images (images that sit inline with text), use the `<picture>` HTML element with a `<source>` in it:

```html
Text before the image
<picture
  ><source
    srcset="
      https://user-images.githubusercontent.com/3369400/139447912-e0f43f33-6d9f-45f8-be46-2df5bbc91289.png
    "
    media="(prefers-color-scheme: dark)" />
  <img
    src="https://user-images.githubusercontent.com/3369400/139448065-39a229ba-4b06-434b-bc67-616e2ed80c8f.png"
    alt="The GitHub Logo"
/></picture>
and text after the image
```

{% hint style="warning" %}
**Note:** We don’t yet support [GitHub-only syntax](https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/) through `#gh-dark-mode-only` or `#gh-light-mode-only`.
{% endhint %}

### Resizing

To resize your image, hover over it and open the **Edit menu** <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt=""></picture>. Click the **Size** button to change the size of your image from the available options.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F1cWY3c3CgGXIK4Bgnhb6%2Fimage_resizing%402x.png?alt=media&amp;token=112c7e1d-6a04-4a59-a69d-6292a74297ff" alt="A GitBook screenshot showing how to resize an image"><figcaption><p>Resize an image</p></figcaption></figure>

* **Small** – 25% of the image size
* **Medium** – 50% of the image size
* **Large** – 75% of the image size
* **Fit** – Removes all size specifications and displays either at full size or capped at a maximum width of **735** **pixels** for larger images.

If your image is wider than the editor, GitBook will limit the image’s width to the editor’s width instead, and resizing will be based on this limit.

{% hint style="info" %}
**Note:** When resizing images in an image gallery, the results can differ from resizing an individual image.
{% endhint %}

### Resizing images through Git Sync

If you want more control over the sizing of your image, you can specify the exact size using Markdown in GitHub or GitLab.

When we export an image, we use the HTML tag `<img/>`. As per the specifications, we can specify the dimensions of the image using the `width` and `height` attributes, which only accept values in pixels or a combination of a number and a `%` sign.\
\
Valid variants for specifying the image dimensions are:\
\
`<img width="100" />` Sets the image to 100 pixels wide\
`<img width="100%" />` Sets the image to full size (although this will be limited by the editor)

### Aligning images

By default, image blocks will show your image at its full size, aligned centrally.

To change the alignment of an image, open the block’s **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> and choose the alignment you want. This will only affect images that are narrower than the editor, or images you’ve [resized](#resizing).

### Framing images

You can add a frame to image blocks to give your images a consistent look and visually separate them from their surrounding content.

<div data-with-frame="true"><figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FfL0VWcltHyuCKeqJsW0Q%2Fimage-frame-demo%402x.jpg?alt=media&amp;token=6cac6c68-c288-4c42-abb2-e2bb7de23652" alt="A black and white photograph of a lone figure walking across a stark white landscape"><figcaption><p>Framed images can have captions, and show a subtle grid behind the caption.</p></figcaption></figure></div>

To add a frame to an image, hover over it, open the block’s **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt=""></picture> and enable the **With frame** toggle.

{% hint style="info" %}
**Good to know:** You can only frame single images in a block. Image blocks that contain multiple images and inline images cannot have frames.
{% endhint %}

### Representation in Markdown

```markdown
//Simple Block
![](https://gitbook.com/images/gitbook.png)

//Block with Caption
![The GitBook Logo](https://gitbook.com/images/gitbook.png)

//Block with Alt text

<figure><img src="https://gitbook.com/images/gitbook.png" alt="The GitBook Logo"></figure>

//Block with Caption and Alt text

<figure><img src="https://gitbook.com/images/gitbook.png" alt="The GitBook Logo"><figcaption><p>GitBook Logo</p></figcaption></figure>

// Block with framed image

<div data-with-frame="true"><img src="https://gitbook.com/images/gitbook.png" alt="The GitBook Logo"></div>

//Block with different image for dark and light mode, with caption

<figure>
  <picture>
    <source srcset="https://user-images.githubusercontent.com/3369400/139447912-e0f43f33-6d9f-45f8-be46-2df5bbc91289.png" media="(prefers-color-scheme: dark)">
    <img src="https://user-images.githubusercontent.com/3369400/139448065-39a229ba-4b06-434b-bc67-616e2ed80c8f.png" alt="GitHub logo">
  </picture>
  <figcaption>Caption text</figcaption>
</figure>
```

### Why is my image not loading?

A "could not load image" error means the image was changed or deleted at its source. If you embedded an image by URL rather than uploading it, GitBook relies on that URL — if the image moves or disappears from the source, it stops displaying on your page.

To resolve it, upload the image directly to GitBook, or update the URL if the image's location changed. The error can also appear when you copy an image from one section to another, because each section has its own file directory — re-upload the image in the new section.

You can review all files uploaded to a section in the **Library** tab, beside **Pages** at the top of the table of contents.


# Embedded URLs

Embed videos, music and more directly into your page with a URL

To add an embedded URL, paste the link of the content you want to embed and press `Enter`.

### Videos

{% embed url="<https://www.youtube.com/watch?v=D_uLM5i0Z4c>" %}

{% hint style="info" %}
**Note:** You can choose to auto-play and loop YouTube and Vimeo embeds by adding `?autoplay=1&loop=1` to the end of your video’s URL.
{% endhint %}

#### Video files

Uploaded video files — such as MP4s — don't play inline; they appear as links that visitors can click to open or download. To show a playable video on your page, upload the video to a publicly accessible platform such as YouTube or Google Drive, then paste the link into an embed block. Private URLs won't display on your page.

### Codepen

{% embed url="<https://codepen.io/davidkpiano/pen/wMqXea>" %}

### Spotify

{% embed url="<https://open.spotify.com/track/4FmiciU3ZmfgABlbCSXcWw?si=65zMAhStT2ivTit-kZISWg>" %}

### Representation in Markdown

```markdown
{% embed url="URL_HERE" %}
```

### FAQ

<details>

<summary>Why isn't my URL working?</summary>

Your content must be publicly available. For Google Docs, select the *Anyone with the link* sharing setting.

GitBook embeds URLs through [Iframely](https://iframely.com/domains). Confirm that Iframely supports your provider, then [test your URL with Iframely](https://iframely.com/try).

GitBook can't embed external HTML `<iframe>` tags because of its content security policy. Use an embed block instead.

</details>


# Tables

Keep information organized and make documenting data easier with tables

You can add tables to better organize your information in a GitBook page. You can see a sample of what is possible in the example table below:

<table data-full-width="false"><thead><tr><th>Company</th><th>Status<select><option value="36bef47f343d4588bc43db3e5c701796" label="In progress" color="blue"></option></select></th><th>Contact</th><th>MRR</th><th data-hidden>Contact</th><th data-hidden>MRR</th><th data-hidden>Status<select><option value="3e7a52c673ec4a01992566d18271f7a5" label="In progress" color="blue"></option><option value="2362fd3eafc7476fb8646ac754f34b72" label="Done" color="blue"></option></select></th></tr></thead><tbody><tr><td><strong>Ace AI</strong> – Design</td><td><span data-option="36bef47f343d4588bc43db3e5c701796">In progress</span></td><td><a href="mailto:noreply@gitbook.com">rena@ace.ai</a></td><td>$450</td><td><a href="mailto:noreply@gitbook.com">rena@ace.ai</a></td><td>$420</td><td><span data-option="3e7a52c673ec4a01992566d18271f7a5">In progress</span></td></tr><tr><td><strong>Discrete Data</strong> – API</td><td><span data-option="36bef47f343d4588bc43db3e5c701796">In progress</span></td><td><a href="mailto:noreply@gitbook.com">dave@dd.inc</a></td><td>$100</td><td><a href="mailto:noreply@gitbook.com">dave@dd.inc</a></td><td>$69</td><td></td></tr><tr><td><strong>Example Co</strong></td><td></td><td><a href="mailto:pete@example.com">pete@example.com</a></td><td>$50</td><td></td><td></td><td></td></tr></tbody></table>

### Table block options

When you open the Options menu to the left of a table block, you’ll have a number of options to change the appearance and manage the data inside the table:

* **Table/Cards:** Choose to display your data as either a table block or a cards block. GitBook populates both these blocks using the same data, so you can switch between them depending on the look and design you want.
* **Add column:** Add a new column to the right of your table. You can choose column type using the menu, or just click **Add column** to add a text column.
* **Insert row:** Add a new row to the bottom of your table.
* **Show header:** Hide or show the top title row of your table.
* **Freeze header:** Keep the top row of your table visible on the page while you scroll through the rows below. This is useful for larger tables where you want the column titles to stay in view.
* **Freeze first column:** Keep the leftmost column of your table visible while horizontally scrolling through the columns to the right. This is useful for wider tables that overflow the page width, where you want the row labels or identifiers to stay in view.
* **Reset column sizing:** If you've changed the column widths, this will reset them all to be equal again.
* **Visible columns:** Choose which columns are visible and which are hidden. If you have hidden columns in your table, this menu is where you can make them visible again.
* **Delete:** Deletes the table block and all of its content.

### Merging cells

Select multiple cells by dragging across them, or by holding Shift and pressing the arrow keys. Use the knob that appears after you select cells to merge them.

Merging works with **Text** and **Number** cells only. GitBook blocks merging for unsupported fields, mixed field types, comments outside the anchor cell, and the Cards view. GitBook also blocks reordering merged cells or rows that contain merged cells.

Merges use native `colspan` and `rowspan` when you use Git Sync. Merges are positional: the anchor cell and spans follow the table’s current row order and visible-column order.

Version one doesn't support rectangular merges, such as a `2x2` selection. When you merge cells, select the value to keep. GitBook clears the other values. Unmerging doesn't restore cleared values.

### Changing a column type

Depending on the data you want to display, you can set different data types for your table columns. These add formatting, embellishments, or restrictions to every cell in the column:

* **Text:** A standard text column, with standard formatting support.
* **Number:** A number column, with or without floating digits.
* **Checkbox:** A checkbox on each line that can be checked or unchecked.
* **Select:** You can select data from a list of options that you can define by opening the **Columns options** menu and choosing **Manage options**. This can be single-choice or multiple-choice.
* **Users:** You can add the name and avatar of a member of your organization. This can be single-choice or multiple-choice.
* **Files:** Reference a file in the section. You can upload new files when populating cells in the column.
* **Rating:** A star rating. You can configure the maximum rating by opening the **Column options** menu and choosing **Max**.

Use the **Column options** menu to change a column’s type. When you change a column type, you’ll see a prompt asking you to confirm the change, as column data could be deleted or broken by this action.

### Resizing columns

Hover over a column’s edge and drag to resize it. A pixel count appears above the cursor to help you set consistent column sizes.

GitBook stores column sizes as a percentage of the overall width, which allows for relative sizing based on the overall width of the table.

### Scrolling tables

Tables that are wider than the editor container will be horizontally scrollable.

### Column options

To reorder columns, click and drag on the drag handle <picture><source srcset="/files/HXFvPsjDqbaBEhpH0WKJ" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FPnnI41SqLSaKBNwT98fW%2Factions-horizontal.svg?alt=media&amp;token=99754200-a354-4ffe-931e-aa6322ea7395" alt="The table drag handle icon in GitBook"></picture> at the top of the column you want to move.

You can add new columns by clicking the **Add column** button that appears when you hover over the right edge of the table.

Inside the **Column options** menu you can also switch automatic sizing on and off, add a new column to the right, hide the column, or delete the column.

### Row options

Hover over the row and click the **Row options** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Row options menu icon in GitBook"></picture> button that appears on the left of it to open the **Row options** menu. You’ll see a number of options:

* **Open row:** Open the row in a modal that shows all of its data. Here you can quickly change row types, edit data, and see data in hidden columns.
* **Insert above/below:** Add a new row above or below the currently-selected row.
* **Add column:** Add a new column on the right of the table.
* **Delete row:** Permanently remove all the data in the row from your table.

### Images in tables

When you click into a table cell, you can hit the / key to insert images. Images cannot be added to the header row of a table.

### Representation in Markdown

```markdown
# Table

|   |   |   |
| - | - | - |
|   |   |   |
|   |   |   |
|   |   |   |
```

<details>

<summary>Can I create nested tables in GitBook?</summary>

It's not possible to nest tables in GitBook. To ensure documents remain easy to write, reliable to render, and accessible for all users, GitBook keeps tables flat.

Once a table sits inside another table cell, it becomes difficult to edit, resize, navigate, or maintain consistent formatting across devices.

Nested tables also introduce significant complexity in the underlying document structure, often breaking clean semantics and leading to unpredictability in features such as Git Sync.

</details>


# Cards

Display information more dynamically with a set of cards — with or without images

You can use cards to create a visually pleasing page layout, combining text and images in a grid. They’re ideal for building landing pages or displaying any other content in a non-linear way.

You can adjust [switch between medium or large cards](#changing-the-size-of-cards) and link them to the relevant resources.

### Example of a card

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-card-cover-dark data-type="image">Cover image (dark)</th></tr></thead><tbody><tr><td><strong>GitBook homepage</strong></td><td>Visit our website and find out more about GitBook.</td><td><a href="https://www.gitbook.com/">https://www.gitbook.com/</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FHAbAKXyi5SHXH1rDhg4E%2FGitBook%20homepage.png?alt=media&amp;token=b2ced317-e488-408b-94a2-03bf72cce821">25_12_10_cards_3.png</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FYYaAqhyC3yLcBknZdlmW%2FGitBook%20homepage.png?alt=media&amp;token=8478251c-456e-4f30-8b32-39cbcc5640ef">25_12_10_cards_2.png</a></td><td></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FYYaAqhyC3yLcBknZdlmW%2FGitBook%20homepage.png?alt=media&amp;token=8478251c-456e-4f30-8b32-39cbcc5640ef">25_12_10_cards_2.png</a></td></tr><tr><td><strong>Developer docs</strong></td><td>Build your own GitBook integration.</td><td><a href="https://developer.gitbook.com/">https://developer.gitbook.com/</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F1wL4yuiP0Pi9Oeu0wnmm%2FDeveloper%20docs.png?alt=media&amp;token=95e0440c-530d-4ce8-8910-607902fc563c">25_12_10_cards_1.png</a></td><td></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FLpBdK9z1nnfqwZiJxOuD%2FDeveloper%20docs.png?alt=media&amp;token=32bed668-de47-427b-9371-0cb4ae6976f0">25_12_10_cards.png</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FLpBdK9z1nnfqwZiJxOuD%2FDeveloper%20docs.png?alt=media&amp;token=32bed668-de47-427b-9371-0cb4ae6976f0">25_12_10_cards.png</a></td></tr><tr><td><strong>Sign up to GitBook</strong></td><td>Click here to get started for free.</td><td><a href="https://app.gitbook.com/join">https://app.gitbook.com/join</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fg2kgdfMsxOpWQx1Meq8s%2FSign%20up.png?alt=media&amp;token=e7ef635a-1864-4944-b5a9-2ba7893f6cc0">25_12_10_cards_5.png</a></td><td></td><td></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fp4zjlQyIPTIdwuCeremo%2FSign%20up.png?alt=media&amp;token=2b8904a8-917f-4eb1-b5fe-5a5575757376">25_12_10_cards_4.png</a></td></tr></tbody></table>

### Adding links <a href="#adding-links-and-images-to-your-cards" id="adding-links-and-images-to-your-cards"></a>

Hover over a card and open its **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture>. Here you can add a target link, so readers can jump directly to a location when they click the card.

{% hint style="success" %}
When creating cards, we recommend you use **target links instead of hyperlinks**. With a target link, your readers can click anywhere on the card to access the linked URL.
{% endhint %}

### Adding images

Hover over a card and open its **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture>. Here you can add a cover image to your card. Alternatively, just click the **Add cover image** option on the card itself.

This will open the **Select file** modal. Here you can drag and drop a new image into this, or use an image file you’ve previously uploaded to your section.

#### Adding images for dark mode

You can also add cover images that will only show in dark mode.

To do this, open the card’s **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt=""></picture> and choose **Cover** > **Edit cover** > **Add cover for dark mode**. This will open the **Select file** modal, where you can drag and drop a new image or select a previously-uploaded image.

#### Choosing the right image size

GitBook will automatically crop landscape images to a 16:9 ratio on desktop and mobile. If the images you upload are portrait or have a 1:1 ratio, they will be cropped to 16:9 on desktop and display as square or portrait on mobile.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FnX5tZdJgW1Yhf61ZXpGJ%2F26_01_06_cards_desktop%402x.png?alt=media&amp;token=a49b6556-194d-47ce-a13b-773561703f5b" alt="A GitBook screenshot showing card images on desktop"><figcaption><p>On desktop, all card images will display in a landscape 16:9 ratio, regardless of their dimensions. We recommend using the same dimensions for consistency.</p></figcaption></figure>

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FxUUSyA6H7QwA8p9Nihz1%2F26_01_06_cards_mobile%402x.png?alt=media&amp;token=df76e62d-dfb4-4197-a140-48d268c52240" alt="A GitBook screenshot showing card images on mobile"><figcaption><p>On mobile, square or portrait images display as shown on the left. Landscape images display as shown on the right.</p></figcaption></figure>

To keep things consistent across desktop and mobile, we recommend uploading all the images for your cards in a 16:9 format (e.g. 1920px x 1080px).

If you want your cards to adapt their layout depending on the screen size, we’d recommend uploading images with a 1:1 ratio, and the content of your image centered.

### Changing the size of cards

You can select the card size by opening the **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> to the left of your card block. The **Medium** option creates three cards in one horizontal line, while the **Large** option shows two larger cards on each line.

### Representation in Markdown

```markdown
<table data-view="cards">
  <thead>
    <tr>
      <th></th>
      <th></th>
      <th data-hidden data-card-target data-type="content-ref"></th>
      <th data-hidden data-card-cover data-type="files"></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Example title 1</strong></td>
      <td>Example description 1.</td>
      <td><a href="https://example.com">https://example.com</a></td>
      <td><a href="https://example.com/image1.svg">example_image1.svg</a></td>
    </tr>
    <tr>
      <td><strong>Example title 2</strong></td>
      <td>Example description 2.</td>
      <td><a href="https://example.com">https://example.com</a></td>
      <td><a href="https://example.com/image2.svg">example_image2.svg</a></td>
    </tr>
    <tr>
      <td><strong>Example title 3</strong></td>
      <td>Example description 3.</td>
      <td><a href="https://example.com">https://example.com</a></td>
      <td><a href="https://example.com/image3.svg">example_image3.svg</a></td>
    </tr>
  </tbody>
</table>
```


# Tabs

Add tabs so you can display large blocks of related information without creating a long, hard-to-navigate page

A tab block is a single block with the option to add multiple tabs.

Each tab can contain multiple other blocks, of any type. So you can add code blocks, images, integration blocks and more to individual tabs in the same tab block.

### Add or delete tabs

To add a new tab to a tab block, hover over the edge of a tab and click the `+` button that appears. To delete a tab, open the tab’s **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> then select **Delete**.

### Add, change, or remove icons

To add or change an icon, open the tab’s **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture>. Then select **Set icon** or **Change icon**, and select an icon.

To remove an icon, open the tab’s **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture>. Then select **Remove icon**.

### Example

Here is an example that lists instructions relevant to specific platforms:

{% tabs %}
{% tab title="Windows" icon="windows" %}
Here are the instructions for Windows
{% endtab %}

{% tab title="macOS" icon="apple" %}
Here are the instructions for macOS
{% endtab %}

{% tab title="Linux" icon="linux" %}
Here are the instructions for Linux
{% endtab %}
{% endtabs %}

### Representation in Markdown

```markdown
{% tabs %}

{% tab title="Windows" icon="windows" %} Here are the instructions for Windows {% endtab %}

{% tab title="macOS" icon="apple" %} Here are the instructions for macOS {% endtab %}

{% tab title="Linux" icon="linux" %} Here are the instructions for Linux {% endtab %}

{% endtabs %}
```


# Expandable

Add an expandable block to a page to keep your pages shorter, hide longer content, or create FAQs

Expandable blocks are helpful in condensing what could otherwise be a lengthy paragraph. They are also great in step-by-step guides and FAQs.

By default, expandable blocks will be collapsed on your published docs site. If you want an expandable block to be expanded by default, open the block’s **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt=""></picture> and choose **Expanded by default**.

### Example

<details open>

<summary>Step 1: Start using expandable blocks</summary>

To add an expandable block hit `/` on an empty block, or click the `+` on the left of the editor, and select **Expandable**.

Optionally, you can set expanded blocks to be **Expanded by default** in the block’s **Options menu** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt=""></picture> — just like this block.

</details>

<details>

<summary>Step 2: Add content to your block</summary>

Once you’ve inserted an expandable block, you can add content to it — including lists and code blocks.

</details>

## Representation in Markdown

{% code overflow="wrap" %}

```markdown
# Expandable blocks

<details open>

<summary>Add your expandable title here</summary>

Add your expandable body text here. This expandable is expanded by default.

</details>

<details>

<summary>Add your expandable title here</summary>

Add your expandable body text here. This expandable is collapsed by default.

</details>
```

{% endcode %}

### Limitations

There are some limitations on which blocks you can create inside of an expandable block. You can insert the following types of content into expandable blocks:

* Paragraphs
* Headings (1, 2, and 3)
* Unordered, ordered, and task lists
* Inline images

To check the full list at any time, start a new line in an expandable block and press `/` to bring up the insert palette.


# Stepper

Add a step-by-step guide to a page — perfect for guides, walkthroughs and technical troubleshooting processes

Stepper blocks let you break down a tutorial or guide into separate, but clearly linked steps. Each step can contain multiple different blocks, allowing you to add detailed information.

### Example

{% stepper %}
{% step %}

#### Add a stepper block

To add a stepper block, hit `/` on an empty line or click the `+` on the left of the editor and select **Stepper** from the insert menu.
{% endstep %}

{% step %}

#### Add some content

Once you’ve inserted your stepper block, you can start adding content to it — including code blocks, drawings, images and much more.
{% endstep %}

{% step %}

#### Add more steps

Click the `+` below the step numbers or hit `Enter` twice to add another step to your stepper block. You can remove or change the style of the step header or step body if you wish.
{% endstep %}
{% endstepper %}

## Representation in Markdown

<pre class="language-markdown"><code class="lang-markdown"><strong>## Example
</strong>




### Step 1 title
Step 1 text





### Step 2 title
Step 2 text




</code></pre>

### Limitations

There are some limitations on which blocks you can create inside of a stepper block — for example, you cannot add expandable blocks or another stepper block. See all the blocks you can add by starting a new line within a stepper block and pressing `/` to bring up the insert palette.


# Updates

Add one or more updates to a page — perfect for adding a changelog to your site

An updates block lets you add a changelog to any page. Each update has a date, optional tags, and supports any block content inside it — text, images, code blocks, lists, and more.

### Adding updates

Insert an updates block on any page. Once it's on the page, hover above or below an existing update to add another in sequence.

To change the date format, click the date in the block. You can display the full date, a shortened version, or numbers only (for example, 12/25/2025).

### Tags

Each update can have its own tags. Use the tag picker below the date to add, remove, or reorder them.

### RSS feed

Any page with an updates block automatically gets an RSS feed — no extra setup required.

Your readers can open the feed from the button at the top of the page, copy the URL, and add it to their preferred reader. New updates you publish are pushed to that reader automatically.

If a page doesn't have an updates block, it won't have an RSS feed. Adding one to the page is all you need to generate it.

#### Plan availability

The updates block is available on \[paid plans]. If you don't see the option to add an updates block, check that your plan includes access to it.

#### If your feed isn't appearing

If the RSS button isn't showing on a published page, confirm that the page includes at least one updates block. The feed is tied to the presence of that block — if it's missing, the feed won't generate. If the block is in place and the feed still isn't appearing, contact [GitBook support](https://www.gitbook.com/contact).

### Example

{% updates format="full" %}
{% update date="2025-12-25" tags="beta" %}

## A brand new update

Use this block to tell users about a new update. Add any additional blocks you need inside it — images, code, lists, and more.
{% endupdate %}
{% endupdates %}

{% code overflow="wrap" %}

```markdown
{% updates format="full" %}
{% update date="2025-12-25" tags="beta" %}
## A brand new update

This block is perfect for telling users all about a brand new update to your product. You can easily add other blocks within this update block, including images, code, lists and much more.
{% endupdate %}
{% endupdates %}
```

{% endcode %}


# Drawings

Create drawings within GitBook and add them to your page

You can create a drawing or sketch directly through GitBook using the integrated [Excalidraw](https://excalidraw.com/) editor, then add it right into your GitBook page.

To create a drawing, press `/` on an empty line to bring up the insert palette and choose **Drawing**. This will open a popover with Excalidraw tools — simply close the popover when you’re done and your diagram will appear on your GitBook page.

GitBook stores drawings as special SVG files in the section. Those files have an extension of `drawing.svg`.

### Example of a drawing block

<img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FEU4IQ0zVbLLZ2o7ivizA%2Ffile.excalidraw.svg?alt=media&amp;token=789b9484-cf49-41d7-88ac-61bb1480e85f" alt="A diagram drawn in GitBook" class="gitbook-drawing">

### Draw with GitBook AI

When using drawing block, you can ask GitBook AI to generate an illustration by specifying a prompt. Simply type in a prompt and hit **Generate**, or choose one of the suggested prompts to get started.

Once GitBook AI has finished the drawing, you can double-click to open the full drawing palette and edit it however you like.

When editing a drawing, click the **Use AI to generate** button to bring up GitBook AI’s prompt editor again and generate a new drawing.

### Representation in Markdown

```markdown
<img src="https://example.com/file.svg" alt="Example diagram description" class="gitbook-drawing">
```


# Mermaid blocks

Add a Mermaid block to create diagrams in GitBook using Mermaid syntax

Mermaid blocks let you create diagrams using the [Mermaid](https://mermaid.ai/) syntax.

Use them when you want to show flows, sequences, states, or relationships in a format that's easy to update.

### Add a Mermaid block

1. Place your cursor on an empty line and type `/`.
2. Click **Mermaid** in the insert menu.
3. Enter or paste your Mermaid syntax. GitBook renders the diagram automatically.

You can also click the **+** to the left of any line in the editor and click **Mermaid**.

### Example

```mermaid
flowchart TD
    A[Open the insert palette] --> B[Select Mermaid]
    B --> C[Add Mermaid syntax]
    C --> D[GitBook renders the diagram]
```

### Representation in Markdown

````markdown
```mermaid
flowchart TD
    A[Open the insert palette] --> B[Select Mermaid]
    B --> C[Add Mermaid syntax]
    C --> D[GitBook renders the diagram]
```
````

GitBook renders code blocks with the `mermaid` language identifier as native Mermaid blocks.<br>

### Troubleshooting

If your Mermaid diagram isn't rendering, check these common causes:

* **Syntax errors** — review your Mermaid code for typos, compare it with examples in the Mermaid documentation, or test it in the [Mermaid Live Editor](https://mermaid.live/) to isolate the issue.
* **Code block instead of Mermaid block** — Mermaid code won't render inside a standard code block. Press `/` and select **Mermaid diagram** to insert the right block type.
* **Older Mermaid content** — Mermaid is a native block, so no integration is needed. If you created Mermaid content before native block support, GitBook converts it automatically the next time you edit the page.


# Math & TeX

Add a mathTeX block to a page when you want to display a mathematical formula in your documentation

You can use the mathTeX format to include mathematical formulae in your documentation. We offer this through the [KaTeX](https://katex.org/docs/supported.html) library.

You can also add mathTeX [as inline content](/docs/create-content/formatting/inline#math-and-tex).

### Example of Math & TeX block

$$
s = \sqrt{\frac{1}{N-1} \sum\_{i=1}^N (x\_i - \overline{x})^2}
$$

### Representation in Markdown

$$f(x) = x \* e^{2 pi i \xi x}$$

```markdown
# Math and TeX block

$$f(x) = x * e^{2 pi i \xi x}$$
```


# Page links

Add a page link block to show relations between pages in your section.

Page link blocks are the best way create relations between different pages within your content. Page links stand out on the page as they fill their own block — compared to a hyperlink added to some text.

### Example of page link block

The links below point to [blocks](/docs/create-content/blocks) and [inline content](/docs/create-content/formatting/inline):

{% content-ref url="/pages/xm6T8EpV4FqtdPLzZ8qN" %}
[Blocks](/docs/create-content/blocks)
{% endcontent-ref %}

{% content-ref url="/pages/DfnNkU49mvLe2ythHAyx" %}
[Inline content](/docs/create-content/formatting/inline)
{% endcontent-ref %}

## Representation in Markdown

```markdown
{% content-ref url="./" %} . {% endcontent-ref %}
```


# Prompt

Add a prompt block to a page to share reusable AI prompts

Prompt blocks let you share reusable AI prompts in your docs. Readers can copy the prompt in one click, or open it in a supported AI tool.

### Add a prompt block

1. On an empty line, type `/`.
2. Click **Prompt** in the insert menu.
3. Add the block content and settings.

### Prompt block fields

Each prompt block includes these fields:

* **Description**: A short summary of what the prompt does.
* **Icon**: An optional icon that helps readers scan the block.
* **Prompt**: The prompt text you can copy or send to an AI tool.

The prompt field supports Markdown, so you can structure longer prompts with headings, lists, and other formatting.

### Prompt options

#### Open in AI providers

The **Open in AI providers** setting controls whether the block shows a menu of AI tools that can open the prompt directly.

If you enable this setting, readers can open the prompt from the provider menu in published docs.

If you leave this setting unset, GitBook derives its initial value from the site-level **Open in AI providers** page action. You can manage that setting in [Extra configuration](/docs/manage-your-site/customization/extra-configuration#open-in-ai-providers).

#### Default visibility

The **Default visibility** setting controls how much of the prompt readers can see initially.

Choose **Hidden** to hide the prompt. Choose **Partially visible** for a 10-line preview, or **Fully visible** for the full prompt.

### Example

Use a prompt block when you want readers to reuse a prompt exactly as written. For example:

{% prompt description="Example prompt" icon="rectangle-terminal" defaultExpanded="full" %}

```markdown
Summarize the key changes in this release note. Group the response into: new features, breaking changes, and recommended next steps. Keep the answer under 150 words.
```

{% endprompt %}

### When to use a prompt block

Prompt blocks work well for:

* Reusable prompts for support, onboarding, or troubleshooting
* Prompt templates for summaries, analysis, or drafting
* Workflows that start in your docs and continue in an AI tool

### Best practices

Write prompts the same way you want readers to use them:

* State the task clearly.
* Define the output format.
* Add constraints like length, tone, or required inputs.

### Published docs behavior

On a published page, a prompt block helps readers move faster.

* **Copy prompt** copies the full prompt to the clipboard.
* **Open in AI providers** shows a provider menu when enabled.

## Representation in Markdown

{% code overflow="wrap" %}

````markdown
{% prompt description="Example prompt" icon="rectangle-terminal" openInAIProviders="true" defaultExpanded="full” %}
```markdown
Summarize the key changes in this release note. Group the response into: new features, breaking changes, and recommended next steps. Keep the answer under 150 words.
```
{% endprompt %}
````

{% endcode %}


# Columns

Add a column to create different layouts in your documentation.

Columns are a great way to create different layouts for your documentation. You can add many different types of blocks inside a column, and adjust the width of each side to customize it to the design you need.

{% columns %}
{% column width="50%" %}
**Create a seamless experience between your docs and product**

Integrate your documentation right into your product experience, or give users a personalized experience that gives them what they need faster.

<a href="https://www.gitbook.com/#alpha-waitlist" class="button primary">Learn more</a>
{% endcolumn %}

{% column %}

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FNMfJRm6dUVv7erqeWmAk%2Fcolumns.png?alt=media&amp;token=925af10f-1f4e-40cc-9cd2-cccf213460ff" alt="An image of GitBook icons demonstrating side by side column functionality"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

## Representation in Markdown

<pre class="language-markdown" data-overflow="wrap"><code class="lang-markdown"><strong>## Example
</strong>




### Create a seamless experience between your docs and product

Integrate your documentation right into your product experience, or give users a personalized experience that gives them what they need faster.

&#x3C;a href="https://www.gitbook.com/#alpha-waitlist" class="button primary">Learn more&#x3C;/a>





&#x3C;figure>&#x3C;img src="../../.gitbook/assets/GitBook vision post.png" alt="An image of GitBook icons demonstrating side by side column functionality">&#x3C;figcaption>&#x3C;/figcaption>&#x3C;/figure>




</code></pre>


# Conditional content

Conditional content blocks let you control who can see a given block of content on your page based on user data and variables. These variables can be passed in via cookies, feature flags, authenticated access, or URL parameters.

### Create conditional content

To add a conditional block, begin a new line in the editor, type <kbd>/</kbd>, then select <picture><source srcset="/files/QtQtLiYwc1oJj119cgUz" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F51vQZhUqnkdsYpyUo1Pj%2Fpage-condition.svg?alt=media&amp;token=31dd334a-5097-4081-915c-db460e610ec6" alt="The Page condition icon in GitBook"></picture> **Conditional content**.

After inserting the block, click the red condition badge in the top right of the block.

Clicking this will allow you to add a condition through the [condition editor](/docs/publish/adaptive-content/adapting-your-content#working-with-the-condition-editor). You’ll be able to write your condition as an [expression](/docs/create-content/variables-and-expressions) that will run against data defined in your site. You can reference data from [variables](/docs/create-content/variables-and-expressions), or data coming from visitors through their [claims](/docs/publish/adaptive-content/enabling-adaptive-content#set-your-visitor-schema).

You can also target human visitors or AI agents. See [targeting human visitors and AI agents](/docs/publish/adaptive-content/adapting-your-content#target-human-visitors-and-ai-agents).

See [adaptive content](/docs/publish/adaptive-content) for more details.

### Example

The examples below use a URL parameter linked from the button to control which conditional content block is visible.

This block is only visible to users **without** attribute A.

<a href="https://gitbook.com/docs/create-content/blocks/conditional-content?visitor.example_attribute_A=true" class="button primary">View with attribute A</a>

## Representation in Markdown

```markdown
## Example

{% if visitor.claims.unsigned.example_attribute_A %}
This block is only visible to users **with** attribute A.
<a href="https://gitbook.com/docs/create-content/blocks/conditional-content?visitor.example_attribute_A=false" class="button primary">View without attribute A</a>
{% endif %}

{% if !visitor.claims.unsigned.example_attribute_A %}
This block is only visible to users **without** attribute A.
<a href="https://gitbook.com/docs/create-content/blocks/conditional-content?visitor.example_attribute_A=true" class="button primary">View with attribute A</a>
{% endif %}
```


# Reusable content

Create reusable blocks of content that can be used across sections, and all updated at once when you change an instance

Reusable content lets you sync content across multiple pages and sections, so you can edit all instances of the block at the same time.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F21nR8UJaA970B2iHPCWL%2Fcreating-content-reusable-content%402x.png?alt=media&amp;token=ec03b404-3254-485c-bbee-9d4864cf3aac" alt="A GitBook screenshot showing reusable content"><figcaption><p>Create reusable content within a section.</p></figcaption></figure>

## Fundamentals

Reusable content works just like any other content—you can modify it via change requests, include it in review workflows, and it will render correctly on any published site.

While reusable content can be referenced across multiple sections, it belongs to a single *parent section*.

### The "parent section" concept

The parent section is the section that owns the reusable content. It's the only place where that content can be edited.

Even though updates to reusable content will appear instantly in all instances, all changes must originate from the parent section—either as a direct edit or through a change request.

Sections support both editorial workflows and security. Because GitBook enforces permission-based editing, reusable content can only be changed from its parent section. This ensures that editing rights are respected, even when the content is reused across the organization.

### Known limitations

#### Integrations

Blocks provided by integrations are not supported in reusable content. This is because integrations in GitBook are installed per section, and limiting access ensures that third-party integrations only have the permissions you grant. Referencing reusable content across sections would break this security boundary.

#### Search

Currently, reusable content only appears in search results within its parent section. We're actively working to remove this limitation so that reusable content shows up in search results wherever it's referenced.

## In the app

### **Create reusable content**

To create reusable content, select one or more blocks, then open the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> , select **Turn into**, and choose **Reusable content**. You can also give your block a name to make it easier to find and reuse later.

Alternatively, you can select one or more blocks and then hit **Cmd + C** to open a prompt asking if you want to create reusable content.

### **Insert reusable content**

You can insert reusable content as you would with any other block. Press `/` on an empty line to open the **Insert palette**. You can also click the `+` beside any block or empty line.

The reusable content panel in the pages sidebar lists previously created content blocks in your current section.

To insert reusable content from the current section or another section you can access:

1. Open the reusable-content picker from the **Insert palette** or `+` menu.
2. Use the section selector at the top to select the source section.
3. Search for the reusable block by name, then select it to insert it.

Inserting content from another section doesn't transfer ownership. Only the parent section can edit the reusable content. Updates from that parent section continue to sync to every instance.

### **Edit reusable content**

Reusable content is like any other content — you can edit any instance directly if live edits are enabled, or through a change request if not. Any changes you make will be synced everywhere the content is used.

If you’re making changes inside a change request, the content will be synced to all other instances once that change request is merged.

### **Detach reusable content**

You can detach reusable content by opening the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> and selecting **Detach**. Detaching will convert the content back to regular blocks.

Once detached, any changes you make to the block(s) will not be reflected across the other instances, and changes you make in those instances will not be reflected in the detached block(s). All other instances of the reusable content remain synced together.

### Delete reusable content

You can delete reusable content from your section entirely, if you wish. Find the reusable content in the page's table of contents, then open the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> next to the content you'd like to delete, and select **Delete**.

Deleting reusable content will **delete it from all pages it is used in**. This action cannot be undone.

## Syncing with GitHub & GitLab

Reusable content is fully supported when syncing to GitHub & GitLab. Your reusable content will be exported to a dedicated `includes` folder, each content being a separate Markdown file.

Your content is then referenced in your other pages using the `includes` directive.

{% hint style="info" %}
When syncing, the `.gitbook/includes` directory is created in the root of each synced section (which may not be the root of the whole repository). If your `.gitbook/includes` folder or its files appear in your section's table of contents, you may need to hide them manually from the TOC.
{% endhint %}

#### Example

{% hint style="success" %}
If you're writing on the GitHub side, ensure the path to the include is relative to the file containing the reference (not the root of the repository).
{% endhint %}

```markdown
{% include "../../.gitbook/includes/reusable-block.md" %}
```


# Variables and expressions

Create reusable variables that can be referenced in pages and sections

With variables you can create reusable text that can be conditionally referenced in [expressions](/docs/create-content/formatting/inline#expressions) and [conditions for adaptive content](/docs/publish/adaptive-content/adapting-your-content#working-with-the-condition-editor).

If you repeat the same name, phrase or version number multiple times within your content, you can create a **variable** to help keep all those instances in sync and accurate — which is useful if you ever need to update them, or they’re complex and often mistyped.

You can create variables that are scoped to a single page, or a single section.

### Create a new variable

To create a new variable, click the **Library** in your Table of Contents when editing an open [change request](/docs/collaborate/change-requests). Then, click **Variables**.

You can use the toggle at the top to view and create variables scoped either to the current page you’re on, or all pages within the current section.

Clicking **Create a variable** will launch a modal where you can give your variable a name and a value.

Click **Add variable** to save your variable.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwfTEGjsxDThqQFvgOm8%2FAdd%20variable%402x.png?alt=media&amp;token=955216f0-67df-4c96-aece-490cfbbf0271" alt="A GitBook screenshot showing the Add variables screen. The variable Name box has been filled with the text ‘latest_version’ and the Value box has been filled with the text ‘v3.04.1’"><figcaption><p>You can add variables to a single page or an entire section. When you update the value of a variable, every instance of it will update.</p></figcaption></figure>

{% hint style="info" %}
Variable names must start with a letter, and can contain letters, numbers and underscores.
{% endhint %}

### Use variables in your content

Variables can be referenced and used within an [expression](/docs/create-content/formatting/inline#expressions) — which you can insert into your content inline. After inserting an expression, double click it to open the expression editor.

{% hint style="info" %}
Expressions can only be used in the page content of a document. They don’t work in page titles or page metadata.
{% endhint %}

Variables defined under your page are accessible under the `page.vars` object. Similarly, variables defined across your entire section are accessible under the `space.vars` object.

{% hint style="info" %}
In expressions, section-scoped variables live under `space.vars` — the GitBook API represents sections as `space` objects.
{% endhint %}

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaRWyFWMI24Cy2nVZmSzE%2FUsing%20variable%402x.png?alt=media&amp;token=a1999774-f0da-4232-8533-b7e806ddd87c" alt="A GitBook screenshot showing an expression block within the editor. The expression editor is open below it and the ‘space.vars.latest_version’ variable has been selected"><figcaption><p>You can add variables to your content within expressions. The expression editor offers autocomplete options to help you find the variable you need.</p></figcaption></figure>

### Update a variable

You can update a variable at any point when within a change request. Updating its value will update the value across any expression blocks referencing it. The changed variable will go live to any published site once the change request is merged.


# Document an API

Add an OpenAPI spec to a page and let your users test endpoints right on the page with interactive blocks.

Manually writing REST API documentation can be a time-consuming process. Fortunately, GitBook streamlines this task by allowing you to import OpenAPI documents, which detail your API’s structure and functionality.

The OpenAPI Specification (OAS) is a framework that developers use to document REST APIs. Written in JSON or YAML, it outlines all your endpoints, parameters, schemas, and authentication schemes.

Once imported into GitBook, these documents are transformed into interactive and testable API blocks that visually represent your API methods—whether the specification is provided as a file or loaded from a URL.

### OpenAPI compatibility

GitBook supports importing and rendering these specification versions:

* [Swagger 2.0](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md) — supported.
* [OpenAPI 3.0](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md) — supported.
* [OpenAPI 3.1](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md) — supported, including OpenAPI 3.1-only features such as `webhooks`.

{% openapi src="<https://petstore3.swagger.io/api/v3/openapi.json>" path="/pet" method="post" %}
<https://petstore3.swagger.io/api/v3/openapi.json>
{% endopenapi %}

### Test it (powered by Scalar)

GitBook's OpenAPI block also supports a "test it" functionality, which allows your users to test your API methods with data and parameters filled in from the editor.

Powered by [Scalar](https://scalar.com/), you won't need to leave the docs to see your API methods in action. See an example of this above.

#### FAQ

<details>

<summary>Why isn’t my spec loading?</summary>

{% hint style="info" %}
**Note:** This information only applies to **specs added by URL**.
{% endhint %}

If you added your specification via URL, your API must [allow cross-origin](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Allow-Origin) GET requests from your docs site. In your API’s CORS settings, allow the exact origin where your docs are hosted (e.g., `https://your-site.gitbook.io` or `https://docs.example.com`).\
\
If your endpoint is public and doesn’t use credentials, you can also return: `Access-Control-Allow-Origin: *`\ <br>

</details>


# Add an OpenAPI specification

Learn how to add and update an OpenAPI specification in GitBook application or from CLI

If you have an OpenAPI spec, you can add it to your organization by uploading the file directly, linking to a hosted URL, or using the [GitBook CLI](https://gitbook.com/docs/developers/integrations/reference).

GitBook accepts [Swagger 2.0](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md), [OpenAPI 3.0](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md), and [OpenAPI 3.1](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md) specifications for file uploads, hosted URLs, and CLI publishing. For the current compatibility summary, see [OpenAPI compatibility](/docs/create-content/openapi#openapi-compatibility).

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F6pg8vIZeVQESjhTw5yI2%2Fgenerate-api-docs%402x.png?alt=media&amp;token=6b72cd8d-7943-465a-88d5-04f8f0f13245" alt="A GitBook screenshot showing the modal for generating API docs automatically"><figcaption></figcaption></figure>

### How to add a specification

1. Open the **OpenAPI** section in the sidebar
2. Click on **Add specification**
3. Give your specification a name. This helps identify it, especially if you manage multiple specs
4. Choose one of the following:
   * Upload a file (e.g. *openapi.yaml*)
   * Enter a URL to a hosted spec
   * Use the CLI to publish the spec

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FpTRwMrbHyYlKZy07CsAp%2Fapi_spec_modal%402x.png?alt=media&amp;token=77edbf02-aed7-43cc-a1e3-9a61fc001271" alt="A GitBook screenshot showing the Add an OpenAPI specification modal"><figcaption><p>Add an OpenAPI specification modal.</p></figcaption></figure>

### Update your specification

You can update your OpenAPI specification at any time using the GitBook UI or the CLI, regardless of how it was initially added.

#### In GitBook Application

In the OpenAPI panel:

* If your spec is linked to a URL:
  * GitBook checks for updates automatically **every 6 hours**.
  * To fetch updates immediately, click **Check for updates**.
* If your spec was uploaded as a file:
  * Click **Update** to upload a new version.
* You can switch from a File to a URL source by clicking on **Edit** in the breadcrumb actions menu.

#### Using the CLI

Use the same command to update your specification:

```bash
gitbook openapi publish --spec api-spec-name --organization organization_id <path-or-url>
```

You can also use the CLI to **Check for updates** by running the publish command on the same URL.

Read our [Integrating with CI/CD](/docs/create-content/openapi/guides/support-for-ci-cd-with-api-blocks) guide to learn how to automate the update of your specification.


# Insert API reference in your docs

Insert complete API reference from your OpenAPI spec or pick individual operation or schemas

GitBook allows you to automatically generate pages related to the endpoints you have in your OpenAPI spec. These pages will contain OpenAPI operation blocks, allowing you and your visitors to test your endpoints and explore them further based on the information found in the spec.

{% hint style="success" %}
Endpoints added from your spec will continue to be updated anytime your spec is updated. See the [Update your specification](/docs/create-content/openapi/add-an-openapi-specification#update-your-specification) section for more info.
{% endhint %}

### Automatically create OpenAPI pages from your spec

After you’ve [added your OpenAPI spec](/docs/create-content/openapi/add-an-openapi-specification), you can generate endpoint pages by inserting an **OpenAPI Reference** in the table of contents of a section.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FYy8gCqxfaO4xjv2eqiL5%2Fcreate_api_pages%402x.png?alt=media&amp;token=62b8386b-9fea-4233-b961-b6a1e582411e" alt="A GitBook screenshot showing how to insert API references into the table of contents of a section"><figcaption><p>Insert API References in the table of contents of a section.</p></figcaption></figure>

{% stepper %}
{% step %}
**Generate pages from OpenAPI**

In the section you’d like to generate endpoint pages, click the **Add new\...** button from the bottom of your section’s [table of contents](/docs/reference/gitbook-ui#table-of-contents).

From here, click **OpenAPI Reference**.
{% endstep %}

{% step %}
**Choose your OpenAPI spec**

Choose your previously uploaded OpenAPI spec. Then choose a **Page structure**:

* **One page per tag**
* **One page per operation**

You can also choose to add a models page and a download link. Click **Insert** to generate the reference.
{% endstep %}

{% step %}
**Manage your API operations**

GitBook will automatically generate pages based on your OpenAPI spec and the tags set inside its definition. If you choose **One page per operation**, GitBook groups the generated operation pages by tag.

Head to [OpenAPI layouts](/docs/create-content/openapi/guides/openapi-layouts) to compare layouts, or [Structuring your API reference](/docs/create-content/openapi/guides/structuring-your-api-reference) to organize pages with tags.
{% endstep %}
{% endstepper %}

### Add an individual OpenAPI block

Alternatively, you can add OpenAPI operations or schemas from your spec individually to pages throughout your docs.

{% stepper %}
{% step %}
**Add a new OpenAPI block**

Open the block selector by pressing **/**, and search for OpenAPI.
{% endstep %}

{% step %}
**Choose your OpenAPI spec**

Choose your previously uploaded OpenAPI spec, and click **Continue** to choose the endpoints you’d like to use.
{% endstep %}

{% step %}
**Choose the operations or schemas you’d like to insert**

Pick the operations and the schemas you want to insert in your docs and click **Insert**.
{% endstep %}
{% endstepper %}


# Extensions reference

The complete reference of OpenAPI extensions supported by GitBook

You can enhance your OpenAPI specification using extensions—custom fields that start with the `x-` prefix. These extensions let you add extra information and tailor your API documentation to suit different needs.

GitBook allows you to adjust how your API looks and works on your published site through a range of different extensions you can add to your OpenAPI spec.

Head to our [guides section](/docs/create-content/openapi/guides) to learn more about using OpenAPI extensions to configure your documentation.

<details>

<summary><code>x-page-title | x-displayName</code></summary>

Change the display name of a tag used in the navigation and page title.

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
tags:
  - name: users
    x-page-title: Users
```

{% endcode %}

</details>

<details>

<summary><code>x-page-description</code></summary>

Add a description to the page.

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
tags:
  - name: "users"
    x-page-title: "Users"
    x-page-description: "Manage user accounts and profiles."
```

{% endcode %}

</details>

<details>

<summary><code>x-page-icon</code></summary>

Add a Font Awesome icon to the page. See available icons [here](https://fontawesome.com/search).

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
tags:
  - name: "users"
    x-page-title: "Users"
    x-page-description: "Manage user accounts and profiles."
    x-page-icon: "user"
```

{% endcode %}

</details>

<details>

<summary><code>parent | x-parent</code></summary>

Add hierarchy to tags to organize your pages in GitBook.

{% hint style="warning" %}
`parent` is the official property name in OpenAPI 3.2+. If using OpenAPI versions prior to 3.2 (3.0.x, 3.1.x), use `x-parent` instead.
{% endhint %}

{% code title="openapi.yaml" %}

```yaml
openapi: '3.2'
info: ...
tags:
  - name: organization
  - name: admin
    parent: organization
  - name: user
    parent: organization    
```

{% endcode %}

</details>

<details>

<summary><code>x-hideTryItPanel</code></summary>

Show or hide the “Test it” button for an OpenAPI block.

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
tags: [...]
paths:
  /example:
    get:
      summary: Example summary
      description: Example description
      operationId: examplePath
      responses: [...]
      parameters: [...]
      x-hideTryItPanel: true
```

{% endcode %}

</details>

<details>

<summary><code>x-expandAllResponses</code></summary>

Expand all response sections by default, instead of showing only one at a time.

Add it at the root to apply it to every operation. Add it on an operation to apply it to that one endpoint.

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">openapi: '3.0'
info: ...

# Expand all responses for every operation
<strong>x-expandAllResponses: true
</strong>
paths:
  /pets:
    get:
      summary: List pets
      responses: [...]
      # Opt out for a single operation
<strong>      x-expandAllResponses: false
</strong></code></pre>

</details>

<details>

<summary><code>x-expandAllModelSections</code></summary>

Expand all model/schema sections by default, showing nested object properties without requiring user interaction.

Add it at the root to apply it to every operation. Add it on an operation to apply it to that one endpoint.

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">openapi: '3.0'
info: ...

# Expand all model sections for every operation
<strong>x-expandAllModelSections: true
</strong>
paths:
  /pets:
    post:
      summary: Create a pet
      requestBody: [...]
      responses: [...]
      # Opt out for a single operation
<strong>      x-expandAllModelSections: false
</strong></code></pre>

</details>

<details>

<summary><code>x-enable-proxy</code></summary>

Route “Test it” requests through GitBook’s OpenAPI proxy.

Add it at the root to apply it to every operation. Add it on an operation to apply it to that one endpoint. Operations override the root value.

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0.3'
info: ...

# Enable proxy for all operations
x-enable-proxy: true

paths:
  /health:
    get:
      summary: Health check
      # Opt out for a single operation
      x-enable-proxy: false
      responses:
        '200':
          description: OK
```

{% endcode %}

Read more in [Using OpenAPI proxy](/docs/create-content/openapi/guides/using-openapi-proxy).

</details>

<details>

<summary><code>x-codeSamples</code></summary>

Show, hide, or include custom code samples for an OpenAPI block.

**Fields**

<table><thead><tr><th width="103.625">Field Name</th><th width="88.07421875" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>lang</code></td><td align="center">string</td><td>Code sample language. Value should be one of the following <a href="https://github.com/github/linguist/blob/master/lib/linguist/popular.yml">list</a></td></tr><tr><td><code>label</code></td><td align="center">string</td><td>Code sample label, for example <code>Node</code> or <code>Python2.7</code>, <em>optional</em>, <code>lang</code> is used by default</td></tr><tr><td><code>source</code></td><td align="center">string</td><td>Code sample source code</td></tr></tbody></table>

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
tags: [...]
paths:
  /example:
    get:
      summary: Example summary
      description: Example description
      operationId: examplePath
      responses: [...]
      parameters: [...]
      x-codeSamples:
        - lang: 'cURL'
          label: 'CLI'
          source: |
            curl -L \
            -H 'Authorization: Bearer <token>' \
            'https://api.gitbook.com/v1/user'
```

{% endcode %}

</details>

<details>

<summary><code>x-enumDescriptions</code></summary>

Add an individual description for each of the `enum` values in your schema.

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
components:
  schemas:
    project_status:
      type: string
      enum:
        - LIVE
        - PENDING
        - REJECTED
      x-enumDescriptions:
        LIVE: The project is live.
        PENDING: The project is pending approval.
        REJECTED: The project was rejected.
```

{% endcode %}

</details>

<details>

<summary><code>x-internal | x-gitbook-ignore</code></summary>

Hide an endpoint from your API reference.

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
tags: [...]
paths:
  /example:
    get:
      summary: Example summary
      description: Example description
      operationId: examplePath
      responses: [...]
      parameters: [...]
      x-internal: true
```

{% endcode %}

</details>

<details>

<summary><code>x-stability</code></summary>

Mark endpoints that are unstable or in progress.

Supported values: `experimental`, `alpha`, `beta`.

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
tags: [...]
paths:
  /example:
    get:
      summary: Example summary
      description: Example description
      operationId: examplePath
      x-stability: experimental
```

{% endcode %}

</details>

<details>

<summary><code>deprecated</code></summary>

Mark whether an endpoint is deprecated or not. Deprecated endpoints will give deprecation warnings in your published site.

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
tags: [...]
paths:
  /example:
    get:
      summary: Example summary
      description: Example description
      operationId: examplePath
      responses: [...]
      parameters: [...]
      deprecated: true
```

{% endcode %}

</details>

<details>

<summary><code>x-deprecated-sunset</code></summary>

Add a sunset date to a deprecated operation.

Supported values: **ISO 8601** format (YYYY-MM-DD)

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
tags: [...]
paths:
  /example:
    get:
      summary: Example summary
      description: Example description
      operationId: examplePath
      responses: [...]
      parameters: [...]
      deprecated: true
      x-deprecated-sunset: 2030-12-05
```

{% endcode %}

</details>


# Guides

Explore guides for customizing and managing your API reference

***


# OpenAPI layouts

Choose between one page per tag and one page per operation for your API reference

When you insert an **OpenAPI Reference**, GitBook can organize operations in two ways.

Choose the layout that matches how you want people to browse your API.

### Access this setting

To choose a layout:

1. In your section, click **Add new\...** → **OpenAPI Reference**. You can also edit an existing OpenAPI Reference.
2. Choose your OpenAPI spec.
3. In **Page structure**, select **One page per tag** or **One page per operation**.

For the full setup flow, see [Insert API reference in your docs](/docs/create-content/openapi/insert-api-reference-in-your-docs).

### Available layouts

GitBook supports two layouts:

* **One page per tag** creates one page for each tag. Each page lists all operations with that tag.
* **One page per operation** creates one page for each operation. GitBook groups those pages by tag in the table of contents.

### Example input

Both layouts start from the same OpenAPI data:

{% code title="openapi.yaml" %}

```yaml
paths:
  /users:
    get:
      tags:
        - users
      summary: List users
    post:
      tags:
        - users
      summary: Create user
```

{% endcode %}

### One page per tag

Use this layout when each tag represents a clear section of your API.

It works well when you want overview pages, fewer entries in the navigation, and related endpoints on the same page.

With this layout, both operations appear on the same generated page for the `users` tag.

### One page per operation

Use this layout when you want direct links to individual endpoints.

It works well for large APIs, or when each endpoint needs its own page in the navigation.

With this layout, GitBook creates one page for `GET /users` and one page for `POST /users`. Both pages appear under the `users` tag group.

### Quick recommendation

Choose **One page per tag** for smaller APIs, or when each tag is a clear section.

Choose **One page per operation** for larger APIs, or when you want a dedicated page for each endpoint.

### Control the generated navigation

In both layouts, GitBook uses your OpenAPI tags to organize the reference.

To control order, hierarchy, page titles, icons, and descriptions, see [Structuring your API reference](/docs/create-content/openapi/guides/structuring-your-api-reference).


# Structuring your API reference

Learn how to structure your API reference across multiple pages with icons and descriptions

GitBook does more than just render your OpenAPI spec. It lets you customize your API reference for better clarity, navigation, and branding.

To choose between **One page per tag** and **One page per operation**, see [OpenAPI layouts](/docs/create-content/openapi/guides/openapi-layouts).

This page explains how to control the generated navigation with tags.

### Use tags to organize generated pages

GitBook uses tags to organize generated API reference pages in both layouts.

With **One page per tag**, GitBook creates one page for each tag. With **One page per operation**, GitBook creates one page for each operation and uses tags to group those pages in the table of contents.

To group related operations, assign the same tag to each operation:

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
<strong>      tags:
</strong><strong>        - pet
</strong>      summary: Update an existing pet.
      description: Update an existing pet by Id.
      operationId: updatePet
</code></pre>

### Reorder pages in your table of contents

The order of generated tag pages or tag groups matches the order of tags in your OpenAPI `tags` array:

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">tags:
<strong>  - name: pet
</strong><strong>  - name: store
</strong><strong>  - name: user
</strong></code></pre>

### Nest pages into groups

To build multi-level navigation, use `x-parent` (or `parent`) in tags to define hierarchy. This works with both page structures:

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">tags:
  - name: everything
  - name: pet
<strong>    x-parent: everything
</strong>  - name: store
<strong>    x-parent: everything
</strong></code></pre>

The above example creates a table of contents like this:

```
Everything
├── Pet
└── Store
```

If GitBook generates a parent page and that page has no description, it shows a card-based layout for its sub-pages.

### Customize page titles, icons, and descriptions

You can enhance generated tag pages and navigation labels with custom extensions in the `tags` section. All [Font Awesome icons](https://fontawesome.com/search) are supported via `x-page-icon`.

{% code title="openapi.yaml" %}

```yaml
tags:
  - name: pet
    # Page title displayed in table of contents and page
    x-page-title: Pet
    # Icon shown in table of contents and next to page title
    x-page-icon: dog
    # Description shown just above the title
    x-page-description: Pets are amazing!
    # Content of the page
    description: Everything about your Pets
```

{% endcode %}

### Build rich descriptions with GitBook Blocks

Tag description fields support GitBook markdown, including [advanced blocks](/docs/create-content/blocks) like tabs:

{% code title="openapi.yaml" %}

```yaml
---
tags:
  - name: pet
    description: |
      Here is the detail of pets.

      {% tabs %}
      {% tab title="Dog" %}
      Here are the dogs
      {% endtab %}

      {% tab title="Cat" %}
      Here are the cats
      {% endtab %}

      {% tab title="Rabbit" %}
      Here are the rabbits
      {% endtab %}
      {% endtabs %}
```

{% endcode %}

### Highlight schemas

You can highlight a schema in a GitBook description by using GitBook markdown. Here is an example that highlights the “Pet” schema from the “petstore” specification:

{% code title="openapi.yaml" %}

```yaml
---
tags:
  - name: pet
      description: |
          {% openapi-schemas spec="petstore" schemas="Pet" grouped="false" %}
              The Pet object
          {% endopenapi-schemas %}
```

{% endcode %}

### Document a webhook endpoint

GitBook supports OpenAPI 3.1, including webhook endpoints.

The `webhooks` field is part of OpenAPI 3.1, so your specification must declare an OpenAPI 3.1 version. You can define webhooks directly in your OpenAPI file, and GitBook renders them alongside your other API operations. For version support across OpenAPI docs, see [OpenAPI compatibility](/docs/create-content/openapi#openapi-compatibility).

{% code title="openapi.yaml" %}

```yaml
---
openapi: 3.1.0 # Webhooks are available starting from OpenAPI 3.1

webhooks:
  newPet:
    post:
      summary: New pet event
      description: Information about a new pet in the system
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Pet"
      responses:
        "200":
          description: Return a 200 status to indicate that the data was received successfully
```

{% endcode %}


# Adding custom code samples

Learn how to configure custom code samples to display alongside your API endpoints

GitBook can automatically generate generic code examples for each API operation. If you’d prefer to showcase custom or more detailed snippets, add `x-codeSamples` to your OpenAPI definition. This way, you control how your endpoints are demonstrated and can offer language or SDK-specific examples.

{% code title="openapi.yaml" %}

```yaml
paths:
  /users:
    get:
      summary: Retrieve users
      x-codeSamples:
        - lang: JavaScript
          label: Node SDK
          source: |
            import { createAPIClient } from 'my-api-sdk';

            const client = createAPIClient({ apiKey: 'my-api-key' });
            client.users.list().then(users => {
              console.log(users);
            });
        - lang: Java
          label: Java SDK
          source: |
            MyApiClient client = new MyApiClient("my-api-key");
            List<User> users = client.getUsers();
            System.out.println(users);
```

{% endcode %}

**Key Points**

* `x-codeSamples` is an array of code sample objects.
* Each object defines:
  * `lang`: The language of the code (e.g., JavaScript, Java).
  * `label`: A short label for the code block.
  * `source`: The actual code snippet.

### Quick guide

<details>

<summary>How do I add custom code samples from Fern?</summary>

Use Fern-generated SDK examples as custom code samples in your OpenAPI definition.

This guide covers finding the generated examples, formatting `x-codeSamples`, and adding them to an API operation.

<button type="button" class="button secondary" data-action="ask" data-query="How do I add custom code samples from Fern to my GitBook API documentation? Show me how to find Fern-generated SDK examples, format x-codeSamples, and add them to an OpenAPI operation. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I add custom code samples from Stainless?</summary>

Use Stainless-generated SDK examples as custom code samples in your OpenAPI definition.

This guide covers finding the generated examples, formatting `x-codeSamples`, and adding them to an API operation.

<button type="button" class="button secondary" data-action="ask" data-query="How do I add custom code samples from Stainless to my GitBook API documentation? Show me how to find Stainless-generated SDK examples, format x-codeSamples, and add them to an OpenAPI operation. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I add custom code samples from HeyAPI?</summary>

Use HeyAPI-generated SDK examples as custom code samples in your OpenAPI definition.

This guide covers finding the generated examples, formatting `x-codeSamples`, and adding them to an API operation.

<button type="button" class="button secondary" data-action="ask" data-query="How do I add custom code samples from HeyAPI to my GitBook API documentation? Show me how to find HeyAPI-generated SDK examples, format x-codeSamples, and add them to an OpenAPI operation. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>


# Managing API operations

Learn how to mark an OpenAPI API operation as experimental, deprecated or hide it from your documentation

It’s common to have operations that are not fully stable yet or that need to be phased out. GitBook supports several OpenAPI extensions to help you manage these scenarios.

### Marking operation as experimental, alpha, or beta

Use `x-stability` to communicate that an endpoint is unstable or in progress. It helps users avoid non-production-ready endpoints. Supported values: `experimental`, `alpha`, `beta`.

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
      operationId: updatePet
<strong>      x-stability: experimental
</strong></code></pre>

### Deprecating an operation

To mark an operation as deprecated, add the `deprecated: true` attribute.

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
      operationId: updatePet
<strong>      deprecated: true
</strong></code></pre>

Optionally specify when support ends by including `x-deprecated-sunset`

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
      operationId: updatePet
<strong>      deprecated: true
</strong><strong>      x-deprecated-sunset: 2030-12-05
</strong></code></pre>

### Hiding an operation from the API reference

To hide an operation from your API reference, add `x-internal: true` or `x-gitbook-ignore: true` attribute.

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
      operationId: updatePet
<strong>      x-internal: true
</strong></code></pre>

### Hiding a response sample

Add the `x-hideSample: true` attribute to a response object to exclude it from the response samples section.

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
      operationId: updatePet
<strong>      responses:
</strong><strong>        200:
</strong><strong>          x-hideSample: true
</strong></code></pre>

### Customizing the authorization prefix and token placeholder

You can customize the authorization prefix (for example, `Bearer`, `Token`, or a custom string) and the token placeholder shown when using security schemes in GitBook.

In your OpenAPI spec, under `components.securitySchemes`, define your scheme like this:

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
<strong>      x-gitbook-prefix: Token
</strong><strong>      x-gitbook-token-placeholder: YOUR_CUSTOM_TOKEN
</strong></code></pre>

These extensions:

* `x-gitbook-prefix` defines the prefix added before the token.
  * example: `Authorization: <x-gitbook-prefix> YOUR_API_TOKEN`
* `x-gitbook-token-placeholder` sets the default token value.
  * example: `Authorization: Bearer <x-gitbook-token-placeholder>`

{% hint style="warning" %}
`x-gitbook-prefix` is not supported for `http` security schemes because these schemes must follow standard IANA authentication definitions. [Learn more](https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml)
{% endhint %}


# Configuring the “Test it” button

You can configure the "Test It" button and accompanying window in GitBook using several OpenAPI extensions. These extensions can help improve and configure the testing suite for users.

### Hiding the “Test it” button

You can hide the “Test it” button from your endpoints by adding the `x-hideTryItPanel` to an endpoint, or at the root of your OpenAPI spec.

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
tags: [...]
paths:
  /example:
    get:
      summary: Example summary
      description: Example description
      operationId: examplePath
      responses: [...]
      parameters: [...]
      x-hideTryItPanel: true
```

{% endcode %}

### Proxy “Test it” requests

Some APIs block browser requests, often because of CORS.

Route **Test it** traffic through GitBook by adding `x-enable-proxy` to your spec.

See [Using OpenAPI proxy](/docs/create-content/openapi/guides/using-openapi-proxy) for examples.

### Enable authentication in the testing window

The request runner can only present and apply auth if your spec declares it. Define schemes under `components.securitySchemes`, then attach them either globally via `security` (applies to all operations) or per-operation (overrides global).

#### Declare your auth scheme

Below are common patterns. Use straight quotes in YAML.

{% tabs %}
{% tab title="HTTP Bearer (e.g., JWT)" %}

```yaml
openapi: '3.0.3'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
```

{% endtab %}

{% tab title="API Key in header" %}

```yaml
openapi: '3.0.3'
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
```

{% endtab %}

{% tab title="OAuth2 (authorizationCode)" %}

```yaml
openapi: '3.0.3'
components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: 'https://auth.example.com/oauth/authorize'
          tokenUrl: 'https://auth.example.com/oauth/token'
          scopes:
            read:items: 'Read items'
            write:items: 'Write items'
```

{% endtab %}
{% endtabs %}

#### Apply schemes globally or per operation

{% tabs %}
{% tab title="Gloabl" %}

```yaml
openapi: '3.0.3'
security:
  - bearerAuth: []
paths: ...
```

{% endtab %}

{% tab title="Per-operation" %}

```yaml
paths:
  /reports:
    get:
      summary: Get reports
      security:
        - apiKeyAuth: []
      responses:
        '200':
          description: OK
```

{% endtab %}
{% endtabs %}

### Control the endpoint URL with `servers`

The request runner targets the URL(s) you define in the `servers` array. Declare one or more servers; you can also parameterize them with variables.

{% tabs %}
{% tab title="Single server" %}

```yaml
openapi: '3.0.3'
servers:
  - url: https://instance.api.region.example.cloud
```

{% endtab %}

{% tab title="Multiple servers" %}

```yaml
servers:
  - url: https://api.example.com
    description: Production
  - url: https://staging-api.example.com
    description: Staging
```

{% endtab %}

{% tab title="Server variables" %}

```yaml
servers:
  - url: https://{instance}.api.{region}.example.cloud
    variables:
      instance:
        default: acme
        description: Your tenant or instance slug
      region:
        default: eu
        enum:
          - eu
          - us
          - ap
        description: Regional deployment
```

{% endtab %}

{% tab title="Per-operation servers" %}

<pre class="language-yaml"><code class="lang-yaml"><strong>paths:
</strong>  /reports:
    get:
      summary: Get reports
      servers:
        - url: https://reports.api.example.com
      responses:
        '200':
          description: OK
</code></pre>

{% endtab %}
{% endtabs %}


# Using OpenAPI proxy

GitBook can proxy **Test It** requests so they work even when your API server doesn't support CORS.

### Why this exists

Browsers block cross-origin requests unless the API server opts in with CORS headers. Without CORS configured, **Test It** requests fail in the browser. The proxy routes those requests server-side through GitBook, bypassing that restriction.

### Enable the proxy for your whole spec

Add `x-enable-proxy: true` at the root of your OpenAPI spec.

<pre class="language-yaml"><code class="lang-yaml">openapi: '3.0.3'
<strong>x-enable-proxy: true
</strong>info:
  title: Example API
  version: '1.0.0'
servers:
  - url: https://api.example.com
</code></pre>

### Enable or disable for a specific operation

Add `x-enable-proxy` on an operation.

<pre class="language-yaml"><code class="lang-yaml">openapi: '3.0.3'
info:
  title: Example API
  version: '1.0.0'
servers:
  - url: https://api.example.com
paths:
  /reports:
    get:
      summary: List reports
<strong>      x-enable-proxy: true
</strong>      responses:
        '200':
          description: OK
    post:
      summary: Create report
<strong>      x-enable-proxy: false
</strong>      responses:
        '201':
          description: Created
</code></pre>

{% hint style="info" %}
Operation-level `x-enable-proxy` takes precedence over the root-level value.
{% endhint %}

### What the proxy supports

GitBook forwards all `HTTP` methods (`GET`, `POST`, `PUT`, `DELETE`, `PATCH`), headers, cookies, and request bodies.

### Security

The proxy only forwards requests to the URLs listed in your spec’s `servers` array. It can’t be used to reach arbitrary URLs.

{% hint style="info" %}
Make sure your `servers` array includes every base URL you want to test against. If a URL isn't listed, **Test It** requests to that host will bypass the proxy.
{% endhint %}


# Describing enums

Learn how to add descriptions to enums

When an API operation includes an enum, you can add `x-enumDescriptions` to provide more context about each option. GitBook will display the enum values and their descriptions in a table next to the operation.

{% code title="openapi.yaml" %}

```yaml
openapi: '3.0'
info: ...
components:
  schemas:
    project_status:
      type: string
      enum:
        - LIVE
        - PENDING
        - REJECTED
      x-enumDescriptions:
        LIVE: The project is live.
        PENDING: The project is pending approval.
        REJECTED: The project was rejected.
```

{% endcode %}


# Integrating with CI/CD

Learn how to automate the update of your OpenAPI specification in GitBook

GitBook can work with any CI/CD pipeline you already have for managing your OpenAPI specification. By using the GitBook CLI, you can automate updates to your API reference.

### Upload a specification file

If your OpenAPI spec is generated during your CI process, you can upload it directly from your build environment:

```bash
# Set your GitBook API token as an environment variable
export GITBOOK_TOKEN=<api-token>

gitbook openapi publish \
  --spec spec_name \
  --organization organization_id \
  example.openapi.yaml
```

### Set a new source URL or trigger a refresh

If your OpenAPI specification is hosted at a URL, GitBook automatically checks for updates. To force an update (for example, after a release), run:

```bash
# Set your GitBook API token as an environment variable
export GITBOOK_TOKEN=<api-token>

gitbook openapi publish \
  --spec spec_name \
  --organization organization_id \
  https://api.example.com/openapi.yaml
```

### Update your spec with GitHub Actions

If you’re setting up a workflow to publish your OpenAPI spec, complete these steps in your repository:

1. In your repo, go to “Settings → Secrets and variables → Actions”.
2. Add a secret: `GITBOOK_TOKEN` (your GitBook API token).
3. Add variables (or hardcode them in the workflow):
   * `GITBOOK_SPEC_NAME` → your spec’s name in GitBook
   * `GITBOOK_ORGANIZATION_ID` → your GitBook organization ID
4. Save the workflow file as `.github/workflows/gitbook-openapi-publish.yml`.
5. Push changes to “main” (or run the workflow manually).

You can then use this action to update your spec:

{% code title=".github/workflows/gitbook-openapi-publish.yml" %}

```yaml
name: Publish OpenAPI to GitBook

on:
  push:
    branches: [ "main" ]
    paths:
      - "**/*.yaml"
      - "**/*.yml"
      - "**/*.json"
  workflow_dispatch:

jobs:
  publish:
    runs-on: ubuntu-latest
    env:
      # Required secret
      GITBOOK_TOKEN: ${{ secrets.GITBOOK_TOKEN }}
      # Prefer repo/org variables; fallback to inline strings if you like
      GITBOOK_SPEC_NAME: ${{ vars.GITBOOK_SPEC_NAME }}
      GITBOOK_ORGANIZATION_ID: ${{ vars.GITBOOK_ORGANIZATION_ID }}

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Publish spec file to GitBook
        run: |
          npx -y @gitbook/cli@latest openapi publish \
            --spec "$GITBOOK_SPEC_NAME" \
            --organization "$GITBOOK_ORGANIZATION_ID" \
            <path_to_spec>
```

{% endcode %}


# Style guide

Define your team's writing rules in a dedicated style guide and keep every contributor, human or GitBook Agent, consistent.

A style guide holds your team's writing rules and conventions. It's the single source of truth for how content on your site should be written — voice and tone, terminology, formatting, and structure.

A style guide serves two audiences:

* **Your team:** writers and reviewers have one shared reference for how to write, so documentation stays consistent no matter who edits it.
* **GitBook Agent:** the Agent reads your style guide and treats it as the source of truth it must follow whenever it writes, edits, or reviews content. It overrides the Agent's own defaults and general writing conventions.

### How GitBook Agent uses your style guide

GitBook Agent loads your style guide's first page in full into its context on every task, so that page always drives its work. It reads other pages only on demand, using the table of contents.

**Put your main rules on the first page.** Keep every rule you want enforced there, and use additional pages for detail the Agent can pull in when relevant. Your edits always win: change a rule and the Agent follows your version; delete a rule and the Agent stops enforcing it.

The style guide is the Agent's only source of rules. If your style guide mentions an upstream guide — like Google's or Microsoft's — as its base, that mention is background for human readers, not an instruction to the Agent. If a convention matters to you, write it down.

#### Enforceable rules and guidance

Style guides distinguish between two tiers of content, and the difference is whether a rule carries a numbered ID:

* **Numbered rules** (like `G-10` or `MS-9`) are the enforceable tier. The Agent flags violations of them directly and cites the ID, so you can trace any flag back to the exact rule that produced it.
* **Unnumbered guidance** — like a voice description — is judgment territory. The Agent applies it when writing and offers it as suggestions for human review, but never flags it as a violation.

To add an enforceable rule, give it the next number after the current highest, wherever the rule lives. Never renumber or reuse an ID — past flags and your decision log refer to them. Over time, numbers won't match page order; that's normal. An ID's only job is to stay stable.

{% hint style="info" %}
In the starter template, the `SG-` prefix is yours to change — but keep it stable once you start using the guide.
{% endhint %}

### Create a style guide

You can start style guide setup from two places:

* In your site's sidebar, under **Tools**, click **Styleguide**, then click **Set up**.
* Open **Settings → Styleguide** and set it up from there.

Then choose a starting point (detailed below):

* Reuse an existing style guide from your organization.
* Pick a template — Starter, Google, or Microsoft.
* Upload a file or import from a URL, if you already have a style guide.

The first time you open your style guide, GitBook shows a short intro explaining that you edit it like any other content.

#### Use an existing style guide

If your organization already has style guides in use elsewhere, they appear at the top of the setup screen, along with the sites that use them. When you choose one, you can:

* **Use it as-is** — attach it shared with the other sites that use it. Edits apply everywhere it's used.
* **Fork it** — create a dedicated copy for this site (named `Styleguide - {site name}`) that you can evolve independently.

#### Pick a template

GitBook offers three templates to start from:

<table><thead><tr><th width="204.75390625">Template</th><th>Best for</th></tr></thead><tbody><tr><td><strong>Starter template</strong></td><td>Defining your own voice and rules from scratch. Each section explains what belongs there and why, with scaffolding you fill in yourself.</td></tr><tr><td><strong>Google style guide</strong></td><td>Clear, precise, and professional writing for a developer audience. Generated from the Google developer documentation style guide.</td></tr><tr><td><strong>Microsoft style guide</strong></td><td>Warm, simple, and human writing for a broad audience — including readers who aren't technology experts. Generated from the Microsoft Writing Style Guide.</td></tr></tbody></table>

The Google and Microsoft templates come pre-filled with enforceable rules from their source guides — covering voice, word lists, grammar, formatting, procedures, accessible writing, and inclusive language — and are ready to use as-is. Everything is yours to edit: a template is a starting point, not a contract.

{% hint style="info" %}
GitBook reviews and updates base templates when the source guides change, so templates stay current with the guides they're generated from.
{% endhint %}

**Customize the "Needs your input" sections**

Every template marks the parts you must customize with a **Needs your input** hint. Before your styleguide is ready to use, work through these — they typically include:

* The snapshot date of the base guide version the template reflects (Google and Microsoft templates)
* Your product name and documentation mission
* Who reads and writes your documentation, and what the guide covers
* Your product names, feature names, and any terms your team debates, added to the word list
* An owner, a review cadence, and how to propose changes
* A first entry in the decision log

Everything without a hint is pre-filled and ready to use as-is. Placeholder rules that you haven't filled in yet are inactive — the Agent won't enforce them until you replace the placeholders with real content.

#### Upload a file

If you already keep a style guide in another tool, you can import it instead of starting from a template:

1. In the setup screen, click **Upload a file**.
2. Drop your Markdown, HTML, DOCX, or ZIP files — or browse to choose them.
3. Optionally, enable **Enhance import with AI** to automatically refine and clean up the imported content.
4. Click **Start import**.

#### Import from a URL

If your style guide is published online, GitBook can import it directly:

1. In the setup screen, click **Import from a URL**.
2. Enter the docs link you want to import.
3. Optionally, enable **Enhance import with AI** to automatically refine and clean up the imported content.

GitBook imports all public pages under the URL you enter, up to 200 pages. For example, if you import `website.com/docs/`, it will include `website.com/docs/article`, but not `website.com/other-parent/page`. For larger sites, import smaller sub-paths separately.

### What to put in your style guide

A style guide is most useful when it captures the decisions that are easy to get wrong or inconsistent across a team. The templates share a common structure, and each section settles a different class of style debate:

* **Introduction:** what the guide is for and what your documentation is for. A guide with a stated purpose gets maintained; one without gets abandoned.
* **Audience and scope:** who reads your docs, who writes them, and what the guide covers. Half of all style debates are really audience debates in disguise; settle them once here.
* **Voice and tone:** how you address the reader and how formal or friendly you are, plus enforceable rules for anything mechanically checkable, like punctuation and contractions.
* **Word list:** your product names, exact casing, preferred terms, and settled terminology debates. Record only the terms your team has debated; keep entries terse.
* **Grammar and mechanics:** sentence-level defaults for person, tense, and voice. The exception column matters as much as the rule: it keeps the Agent from flagging legitimate text.
* **Formatting:** heading case, UI elements, links, code, and when to use lists, steppers, hints, and other blocks.
* **Writing procedures:** step format, imperative verbs, one action per step.
* **Error messages and failure states:** tone rules for the moments readers are most stressed. Optional; delete it if your docs don't include error text.
* **Accessible writing** and **Inclusive language:** near-universal, checkable rules most teams adopt as written.
* **Content types and templates:** your page types, so writers and the Agent know which structure a page should follow. Many teams use a framework like [Diátaxis](https://diataxis.fr/).
* **Ownership and updates:** the owner, review cadence, and how to propose a change. A guide nobody owns drifts into fiction.
* **Decision log:** your institutional memory. Changing a rule changes what the Agent enforces; the log remembers why, so settled debates stay settled. Record every deliberate departure from a base guide here.

### Edit your style guide

You edit a style guide the same way you edit the rest of your documentation:

* **In GitBook:** make your changes in a change request, then merge them when you're ready.
* **With Git Sync:** if the style guide is synced to GitHub or GitLab, edit it as Markdown in your repository.

To open your style guide, use the **Styleguide** entry in your site's sidebar, or the **Edit** action in **Settings → Styleguide**.

### Share a style guide across sites

A style guide belongs to your organization, so several sites can rely on the same one — the editing agent applies the same writing rules everywhere, and all your documentation follows one voice.

After you create a style guide, GitBook offers to link it to any other sites in your organization that don't have one yet. You can also attach an existing style guide — shared or forked — when setting up a site, as described earlier.

To see every style guide in your organization and which sites use each one, open the **Styleguides** entry in your organization sidebar.

#### Detach a style guide

To stop a site from using its style guide, open **Settings → Styleguide** and click **Detach**. Detaching keeps the style guide — it may still be used by other sites. If no other site references it, GitBook offers to delete it permanently.

### Put your style guide to work

With your style guide in place, ask GitBook Agent to do a pass on your existing documentation to align it with the style guide. From then on, the Agent checks that your style guide is respected every time it writes, edits, or reviews content — flagging violations of numbered rules with their IDs, and offering unnumbered guidance as suggestions for human review.

There are two main ways to run a style guide review on your changes:

#### Review a page before requesting a review

While you're working on a page, you can ask the Agent to check the page against your style guide — use **Check consistency against styleguide** in the Improve menu, or ask in chat. The Agent reviews the page and leaves comments summarizing what it found.

#### Request a styleguide review on a change request

When your site has a style guide, GitBook Agent appears as a suggested reviewer on your change requests, tagged **Styleguide review**:

1. In your change request, click **Request review**.
2. Add a title and description for your changes — or click **Generate** to let the Agent write them from your changes.
3. Under **Reviewers**, click **Request** next to **GitBook Agent** to have it run a styleguide review of the change request. You can add human reviewers alongside it, or leave the list empty to notify all reviewers in your organization.

The Agent reviews your changes against the style guide and requests changes on the change request if it finds violations, citing the rules that produced each flag.

### How the Agent enforces your style guide

When GitBook Agent works with your style guide, its job is conformance to your rules — not general writing improvement. It's designed to be precise, conservative, and consistent: the same content checked against the same style guide always produces the same findings.

#### Your style guide is the only source of rules

The Agent never applies a rule from an upstream guide, from general knowledge of good style, or from any style guide it knows, unless the rule is written in your style guide.

The Agent also respects a few things about how your rules are written:

* **Placeholder rules are inactive.** Template pages contain bracketed placeholder text like `[Product name]` or `[Add a rule]`. A rule whose substance is still placeholder text isn't yet a rule — the Agent won't enforce it. If your style guide is mostly placeholders, the Agent tells you it's largely unfilled and that enforcement is limited to the rules you've completed, rather than presenting a partial pass as comprehensive.
* **Exceptions are respected.** Many rules carry exceptions ("passive is fine when the actor is unknown"). Text that falls under a listed exception is not a violation.
* **Definite rules count even without an ID.** If you write a rule without a numbered ID but it reads as a definite, checkable instruction ("never use semicolons"), the Agent enforces it and cites it by a short quote instead of an ID.

#### When the Agent reviews

During a style guide review — on a page, or on a change request — the Agent flags issues but changes nothing. Each flag includes:

* **Rule:** the rule ID from your styleguide (for example `G-10`), or a short quote of your rule if it has no ID.
* **Location:** the heading or line where the issue occurs, plus the offending text.
* **Issue:** one sentence stating the violation.
* **Fix:** the corrected text, ready to paste.

Reviews are capped at **5 flags per pass**. If more issues exist, the Agent reports the 5 highest-priority ones and ends with a one-line note that further issues exist, with a count. Flags are ranked by category — word choice and terminology first, then formatting and punctuation, then grammar, then procedures — and within a category, in page order.

Unnumbered guidance — voice, tone, and structural advice — never appears as a flag. At most, the Agent adds one combined "worth a human look" note per pass covering anything from the judgment tier.

#### When the Agent edits

When you ask the Agent to fix content or align it with your style guide, it applies numbered rules directly wherever the fix is unambiguous. When a rule has two defensible outcomes, the Agent leaves the text unchanged and lists it as a suggestion instead of guessing.

After editing, the Agent outputs a change summary grouped by rule ID, with counts — for example, "G-7: replaced 'click on' with 'click', 6 instances." Judgment-tier suggestions appear in a separate short list at the end.

#### What the Agent never touches

In both reviews and edits, the Agent never flags or changes:

* Content inside code blocks, inline code, command output, or API and product identifiers
* Direct quotations and cited material
* Text exempted by a rule's own exception
* The meaning or facts of your content
* Anything covered only by a rule that isn't in your styleguide

#### Consistency

The Agent enforces rules as written, even where it might "disagree" — it never softens, strengthens, or reinterprets a rule to fit the content. If a rule is ambiguous as written, the Agent applies its literal reading and notes the ambiguity in its human-review note, rather than inventing intent. And if your site has no style guide configured, the Agent doesn't fall back to general judgment — it offers to help you start one instead.

### Style guides and custom instructions

A style guide complements the site-level custom instructions you can give GitBook Agent. Custom instructions are short, site-specific directions; a style guide is a full, shared document of your writing rules.


# Version control

Keep track of changes, roll back to a previous version and more

You can monitor all the changes people have made to your content using to the **Version history** side panel.

### Version history <a href="#see-the-activity-of-a-specific-draft" id="see-the-activity-of-a-specific-draft"></a>

In the Version history of a section, you can see a list of all the actions that changed the content within it. These include:

* When someone made live edits to the section.
* When someone merged a change request.
* When someone performed a Git Sync operation.

### View historical versions of content

To view past versions of your content and see the changes that were made, click the **Version history** <picture><source srcset="/files/WVfSPMgIbWWq12Hy83TC" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FVEyYlyeOFMIwGJkpdIWh%2Fhistory.svg?alt=media&amp;token=60e30952-2289-4eec-b185-bcc7308347af" alt="The Version history icon in GitBook"></picture> button in the section header, or open the **Action menu** <picture><source srcset="/files/HXFvPsjDqbaBEhpH0WKJ" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FPnnI41SqLSaKBNwT98fW%2Factions-horizontal.svg?alt=media&amp;token=99754200-a354-4ffe-931e-aa6322ea7395" alt="The Actions menu icon in GitBook"></picture> next to the section or change request title and click **Version history**.

Click on any item in the list to see how your content looked at the point this change was made. This is very similar to how you view change requests.

### Show changes

When you are viewing an old version of your content, you can choose to highlight the differences between the old and current content — similar to diff view in a change request.

To enable or disable this, use the **Show changes** toggle at the bottom of the **Version history** side panel.

With show changes enabled, content that has changed will be highlighted by an icon on the left of its content block.

### Viewing historical published versions

If you're investigating the version history of a published section, you can also view previews of what the previous versions looked like in the published context (i.e. what the end user would see).

You can do this by:

{% stepper %}
{% step %}
From the version history side panel, select the revision
{% endstep %}

{% step %}
Copy the ID at the end of the URL
{% endstep %}

{% step %}
Add it at the end of your published docs URL as `/~/revisions/<id>`
{% endstep %}
{% endstepper %}

### Roll back to a previous version

Rolling back allows you to revert a section's content to the way it was at a previous point in time. This is helpful if you've accidentally made a breaking change or deleted content and need to quickly get back to a previous version of the section.

To roll back to a previous version of your section, hover over the version in the side panel, click the **Actions button** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> and click **Rollback**.


# Searching internal content

Find what you’re looking for faster with keyword search and AI-powered smart search

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F7pjBia2KWrxVdItCWgA1%2FSearching%20internal%20content%402x.png?alt=media&amp;token=a4855c09-ddcc-40d9-9218-af68cc343432" alt="A GitBook screenshot showing the search bar"><figcaption><p>Ask questions or search through your content using the built in search bar.</p></figcaption></figure>

Whether you’re working within the GitBook app or your visitors are reading your published content, GitBook’s search functions help to make it easy to find what you’re looking for.

You can use quick find to look for specific words or phrases, or you can ask GitBook AI a question. It’ll scan through your docs and summarize an answer in seconds, with references to help you find out more.

{% hint style="success" %}
**Global search**

If your site has multiple sections, visitors can use the **Ask or search** bar to find information across all of them.
{% endhint %}


# Search & Quick find

Search and navigate your documentation fast with quick find

GitBook’s **Quick find** palette lets you search for content in your current organization, and jump to pages fast.

### Use Quick find

**​**You can open the **Quick find** palette by hitting the **Quick find** <picture><source srcset="/files/zQV3twxlViZn2AoK3a7F" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FPnAIpi7l7NOqFoTvAx11%2Fquick-find.svg?alt=media&amp;token=7b2c5f2d-04d7-44de-9751-3a985679c2a1" alt=""></picture> button at the top of the sidebar or by pressing **⌘ + K** on Mac or **Ctrl + K** on PC.

### Search results <a href="#display-of-results" id="display-of-results"></a>

Results from the section you're currently in appear at the top, followed by results from elsewhere in your organization.

To search another organization, switch organizations first using the switcher at the top of the sidebar.

{% hint style="info" %}
We do not currently support the ability to prioritize certain content in Quick find results.
{% endhint %}

### Permissions <a href="#team-permissions" id="team-permissions"></a>

**Quick find** is compliant with your team’s permission settings, meaning that users will only be able to search the content they have permission to access.‌

### Content indexing <a href="#indexation" id="indexation"></a>

We index your content by grouping it into sections. Sections are denoted using H1, H2 or H3 Headings, with the content that follows them forming part of a section.

Each result shows the first three lines of information below the section header. If your section is too big, your keyword match may not appear in the preview — but don’t worry, quick find still found a match!


# GitBook AI

GitBook uses AI to help you find the knowledge you need within your organization, faster

When engaging with GitBook AI, you have the ability to ask questions or elaborate on specific requirements. This AI-driven tool is designed to review your documentation in real-time, providing you with quick, direct answers.

{% hint style="info" %}
GitBook AI search is available both within the GitBook app to search internal content, and [in published content to search that specific docs site](/docs/ai-for-your-readers/gitbook-ai-assistant).
{% endhint %}

## GitBook AI helps you find answers in the GitBook app

You can enable GitBook AI for your organization’s internal content, allowing you to ask questions and get semantic answers about your internal knowledge base.

Head to the **Organization settings** page and, in the **General** tab, toggle the **Enable GitBook AI** setting on.

### Using GitBook AI search <a href="#how-do-i-use-gitbook-ai" id="how-do-i-use-gitbook-ai"></a>

Once GitBook AI is enabled, open the **Ask or search** <picture><source srcset="/files/zQV3twxlViZn2AoK3a7F" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FPnAIpi7l7NOqFoTvAx11%2Fquick-find.svg?alt=media&amp;token=7b2c5f2d-04d7-44de-9751-3a985679c2a1" alt=""></picture> menu from the left sidebar and simply type out a question. GitBook AI will take a few seconds to scan your documentation and summarize the results.

### FAQs

#### How long does it take for GitBook AI to index changes?

When someone makes a change to your content — such as a merged [change request](/docs/collaborate/change-requests) — it can take **up to one hour** for GitBook to index the changes to and reflect them in AI search results.

#### How does GitBook AI handle my data?

We pass your content to OpenAI to index and process data. OpenAI **does not** use this content for service improvements (including model training). You can find out more about how OpenAI handles data [here](https://openai.com/blog/introducing-chatgpt-and-whisper-apis#developer-focus).

#### How do I prevent hallucinations with GitBook AI search?

If you’re seeing GitBook produce answers that are incorrect, the best method for correcting this is write explicit content around the topic so the AI does not have to guess.


# Guides

Explore guides for creating and structuring documentation in GitBook

GitBook’s editor makes it easy to create and customize documentation, whether you’re starting fresh or working in an existing space.

#### Explore

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-pen-ruler">:pen-ruler:</i></h4></td><td><h4>How to use GitBook’s editor</h4></td><td>Create pages, add content blocks, and publish documentation</td><td><a href="/docs/guides/editing-and-publishing-documentation/how-to-use-gitbooks-editor">How to use GitBook’s editor</a></td></tr><tr><td><h4><i class="fa-file-import">:file-import:</i></h4></td><td><h4>Import content from a CSV file</h4></td><td>Import documentation from Zendesk or another CSV export</td><td><a href="/docs/guides/editing-and-publishing-documentation/import-zendesk-csv-to-gitbook">How to import docs from a CSV</a></td></tr><tr><td><h4><i class="fa-circle-play">:circle-play:</i></h4></td><td><h4>Embed a playable video</h4></td><td>Add video content directly to your documentation</td><td><a href="/docs/guides/editing-and-publishing-documentation/upload-and-embed-a-playable-video-into-your-gitbook-docs">How to embed videos in docs</a></td></tr><tr><td><h4><i class="fa-magnifying-glass">:magnifying-glass:</i></h4></td><td><h4>Make batch changes with Git Sync</h4></td><td>Update repeated content across your documentation from a code editor</td><td><a href="/docs/guides/editing-and-publishing-documentation/find-and-replace-or-make-batch-changes-across-your-gitbook-docs-with-git-sync">How to find and replace content</a></td></tr></tbody></table>

#### Quick guides

<details>

<summary>How do I structure my documentation?</summary>

Organize pages and groups around the tasks readers need to complete.

This guide covers planning page hierarchy, creating groups, and refining navigation.

<button type="button" class="button secondary" data-action="ask" data-query="How do I structure GitBook documentation around reader tasks? Show me how to plan page hierarchy, create groups, organize pages, and refine navigation. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I reuse content across pages?</summary>

Reusable content keeps shared text consistent across your documentation.

This guide covers creating reusable blocks, inserting them into pages, and updating shared content.

<button type="button" class="button secondary" data-action="ask" data-query="How do I reuse content across GitBook pages? Show me how to create reusable blocks, insert them into pages, and update shared content. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I manage repeated values with variables?</summary>

Variables let you define a value once and reuse it across your content.

This guide covers creating variables, referencing them in pages, and maintaining shared values.

<button type="button" class="button secondary" data-action="ask" data-query="How do I manage repeated values with GitBook variables? Show me how to create variables, reference them in pages, and maintain shared values. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I create a documentation style guide?</summary>

A style guide keeps your documentation consistent across contributors and AI-assisted changes.

This guide covers defining writing rules, adding terminology guidance, and maintaining the guide.

<button type="button" class="button secondary" data-action="ask" data-query="How do I create a GitBook documentation style guide? Show me how to define writing rules, add terminology guidance, and maintain the guide. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>


# Overview

Work with an AI teammate to keep your documentation accurate, complete, and up to date

GitBook Agent is an AI teammate that works alongside you. It helps you keep your documentation accurate, complete, and current. GitBook Agent is deeply integrated into GitBook. You don’t need new workflows to use it.

{% hint style="info" %}
If you edit your docs locally with an AI assistant, use [GitBook’s skill.md file](/docs/docs-as-code/ai-coding-assistants-and-skillmd).
{% endhint %}

### What can GitBook Agent do?

GitBook Agent can:

* **Write docs based on a prompt:** Ask GitBook Agent to update a page, rename a product, or make any other change you need.
* **Import content into GitBook:** Attach files like PDFs and Microsoft Word documents in the GitBook Agent chat sidebar. GitBook Agent extracts and formats the content into pages in your section.
* **Plan and implement bigger changes:** Describe what you need. GitBook Agent opens a change request, explains its edits, responds to feedback, and implements the plan you create together.
* **Follow your styleguide:** Define your team's writing rules in a [styleguide](/docs/create-content/styleguide), and GitBook Agent treats it as the source of truth when writing or reviewing content.
* **Follow custom, site-level instructions:** Give GitBook Agent site-specific instructions, such as how to add links or which block types to avoid.
* **Translate your documentation:** Choose the content you want to translate, select a language, and GitBook Agent localizes your docs.
* **Summon from a comment:** Add a comment to any block on your page, type `@gitbook`, and tell GitBook Agent what you need.
* **Review change requests:** Add GitBook Agent as a reviewer on your change request. It can act as a docs linter, flag style guide issues, and suggest or fix errors.

#### Automatic documentation suggestions

{% hint style="warning" %}
**Automatic docs suggestions are in early access**

Head to [Automatic docs improvements](/docs/gitbook-agent/automatic-docs-improvements) to learn more.
{% endhint %}

GitBook Agent can also connect to the signals your team uses to understand your product and your customers’ needs: support conversations, tickets, and threads from your connected tools.

With this context, GitBook Agent can identify gaps, propose updates, and generate docs changes automatically.

As your docs evolve with your product, your customers get the right information when they need it.

### Explore GitBook Agent’s features

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Write with GitBook Agent</strong></td><td>Create content from a prompt, or edit a single block</td><td><a href="/docs/gitbook-agent/write-and-edit-with-ai">Writing with GitBook Agent</a></td></tr><tr><td><strong>Review with GitBook Agent</strong></td><td>Ask GitBook Agent to check your work for spelling, grammar, and style</td><td><a href="/docs/gitbook-agent/review-change-requests-with-gitbook-agent">Review change requests with GitBook Agent</a></td></tr><tr><td><strong>Translate your docs site</strong></td><td>GitBook Agent can create auto-updating localizations</td><td><a href="/docs/gitbook-agent/translations">Translations</a></td></tr></tbody></table>

### Add a style guide and custom instructions

You can configure GitBook Agent with your team’s style guide or site-specific instructions.

GitBook Agent uses this context whenever it creates or edits content for that site.

To add a style guide or custom instructions, open your site’s **Settings**, under **General** in the site sidebar, and click **Agents**. Add your instructions in the custom instructions field.

You can also open this screen from a change request. Open the GitBook Agent chat window, then open the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt=""></picture> and click **Configure GitBook Agent** <picture><source srcset="/files/CG9bVSmdbJnQxrYiNbRI" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FwkBqgOPry9HAcW4cxJk0%2Fsettings.svg?alt=media&amp;token=67bdbb00-ebf3-4a2d-9df8-0c822406f71c" alt=""></picture>.

#### Custom instructions example

Here’s an example of the custom instructions you can add in GitBook Agent’s settings.

{% code overflow="wrap" %}

```
You are a technical writer at Stripe. Use clear, direct language and prioritize accuracy over flourish. For guides, always introduce the concept with a one-sentence summary and break content into well-structured sections. For quickstarts, always use a stepper and keep every step action-first and concise.
```

{% endcode %}

### FAQs

<details>

<summary>How does GitBook Agent use my data?</summary>

We follow our data protection practices to keep your data private.

GitBook Agent does not use your data to train AI models. We share the information you add to GitBook Agent with OpenAI only to provide GitBook Agent. See OpenAI’s privacy policy for more information.

</details>

<details>

<summary>How much does GitBook Agent cost?</summary>

GitBook Agent is free for all plans while in beta. If you’re not on Pro and not on a trial, free usage includes 10 messages per week.

[Translations](/docs/gitbook-agent/translations) are priced separately as a monthly add-on. Visit [the pricing section](/docs/gitbook-agent/translations#pricing) to find out more.

</details>

<details>

<summary>Can I override the default tone of GitBook Agent’s output?</summary>

Yes. You can override GitBook Agent’s default personality and tone.

If you want more detailed output, or a specific style or tone, tell GitBook Agent in site-level instructions or in a prompt in a change request.

</details>


# Writing with GitBook Agent

Use GitBook Agent to generate and build content for your page

GitBook Agent is a powerful tool for generating content for your documentation in GitBook.

The Agent can do everything from write short passages of text on your page, to edit existing blocks and create new pages and more in a change request.

{% hint style="info" %}

#### GitBook Agent follows your styleguide

Define your team's writing rules in a [styleguide](/docs/create-content/styleguide), and the Agent treats it as the source of truth whenever you ask it to help. It loads your styleguide's **first page** into context on every task, so keep your main rules there.

You can also [add short custom instructions](/docs/gitbook-agent/overview#add-a-style-guide-and-custom-instructions) at a site level.
{% endhint %}

### What can GitBook Agent do?

GitBook Agent is deeply integrated into the GitBook app, so it understands the blocks you can create in the editor, and the wider content of your section.

That means you can use the Agent to:

* Write new content based on your prompts
* Search through existing pages and update specific content
* Reformat content to make the most of GitBook’s different blocks
* Update code samples
* Move content around between pages
* Add new pages in specific locations

### How to interact with GitBook Agent

There are a few ways to work with GitBook Agent:

* Open the Agent within an existing change request and tell it what you need
* Plan and implement a new change request with GitBook Agent
* Tag the Agent in a comment on a block
* Create new content on an empty line on your page

Let’s run through each of these to find out how they work.

#### Open GitBook Agent chat window in any change request

You can open the Agent chat window in a change request at any time by clicking the **GitBook Agent** button in the section header bar. This will open the Agent’s chat window on the right of the app.

<div data-with-frame="true"><figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FPQtoLdPQWjOsz0vdowMn%2FCleanShot%202025-12-08%20at%2021.41.29%402x.png?alt=media&amp;token=d3ea84f8-723e-463c-b84b-be6f02db490a" alt=""><figcaption><p>Open GitBook Agent in a change request</p></figcaption></figure></div>

Here you can write a prompt for the Agent to follow — it will explain what it’s doing as it follows your instructions, with the changes appearing in your section as it works.

You can give follow-up instructions or clarify steps, or edit the content of your section directly at any point, allowing you to work alongside GitBook Agent.

#### Implement a change request with GitBook Agent

Click the **GitBook Agent** part of the **Edit** button in the top-right of a section to open a modal.

Here you can write a prompt to tell the Agent what you want your change request to include, then add reference pages that might be useful as context for the changes.

Once you click **Start change request** the Agent will open a change request for you and start carrying out your instructions. At every stage, the Agent will tell you what it’s doing in the chat window on the right-hand side of the app.

When it’s done, you can edit the content yourself directly on the page, or give the Agent more instructions to continue refining your changes.

#### Tag GitBook Agent in a comment

If you want the Agent to review a specific block on your page, you can tag it in a comment and tell it what you need. Simply click **Comment on block** and tag @gitbook to tag the Agent, then tell it what you want it to do.

GitBook Agent will update the content based on your prompt, then reply to your comment telling you what it did.

#### Improve page content with GitBook Agent

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FFTJDHOlJcYyh2M3tK6Xe%2Fpage-actions.png?alt=media&amp;token=65358b13-2bef-4fda-bbe6-9308b7daba6f" alt=""><figcaption></figcaption></figure>

The **Improve** menu gives you a choice of presets that tell GitBook Agent to carry out common actions to improve your page content.

You can access the **Improve** menu from the editor by hovering over the page title, or by opening the page’s **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt=""></picture>.

From the Improve menu, you can tell the Agent to:

* Add an icon for the page
* Generate a page description based on its content
* Fix spelling and grammar
* Rewrite for consistency with other pages
* Optimize for SEO
* Add a summary and next steps section
* Link to related topics and pages
* Divide the single page into multiple pages

The first two options are conditional — they change based on your page content. So if your page already has an icon and description, you won’t see those choices in the menu.

Click any option and the Agent will instantly get to work on your task.

#### Create new content in an empty block

You can use GitBook Agent to create content on any empty line on your page. It can create all kinds of content — formatted in Markdown — including code samples, templates, page summaries and more.

Press `Space` on any empty line, or type `/` and choose **Write with AI** to launch GitBook Agent.

You can instantly start typing any prompt you want. GitBook Agent will analyze the prompt and generate content based on it. For example:

> Write me a two-paragraph overview explaining why documentation is important for product teams.

Alternatively, you can choose from one of the suggested prompts or prompt starters:

* **Continue writing** – GitBook Agent will analyze the content on your current page and then generate more content based on that.
* **Explain…** – Choose this, then tell GitBook Agent what you want it to explain. This isn’t limited by content on your page, so you can ask it to explain anything at all.
* **Summarize** – Summarize all the content on your page. This is great for writing a TL;DR at the bottom of a detailed document, or adding a quick summary at the top for people just checking in.
* **Explain this** – This will explain the complex information on your page in simpler language — including explaining acronyms and other jargon. This is perfect if the page you’re reading involves a lot of complex information, or you want to add an explainer for less technical folks.
* **Translate** – Translate your current page into one of a set number of languages. If you want to translate into a language that’s not on the list, simply type it into the prompt box.

### Write effective prompts for GitBook Agent <a href="#write-effective-prompts" id="write-effective-prompts"></a>

GitBook Agent is like a teammate that’s great at taking directions. You need to give it clear instructions and context to get the best results from it.

Here are some quick tips for writing good prompts:

* **Break it down** – The Agent is best at completing focused tasks. Break down complex projects into smaller steps and ask the Agent to complete them one at a time.
* **Be specific** – Generic prompts like `@gitbook improve this page` will apply general best practices, but without more specific guidance the Agent may not achieve the goal you had in mind.
* **Focus on outcomes** – If you’re hearing about a specific problem customers are having, tell the Agent about those problems — or the outcomes you want to achieve. It will suggest improvements based on those outcomes.
* **Give direct instructions** – If you want the Agent to use a stepper block for a step-by-step guide, or add an FAQ section with a bunch of expandable blocks, tell it precisely what to do to get the right results first time.
* **Use broad prompts for wider improvements** – For maintenance tasks like fixing typos, updating a feature name across pages or removing specific block types from your docs, you can use commands like `@gitbook replace all instances of v2.3.9 with v2.4.0`.


# Review change requests with GitBook Agent

Collaborate with GitBook Agent to review or work on change requests

As well as [creating content](/docs/gitbook-agent/write-and-edit-with-ai), GitBook Agent can review your change requests to quickly find and fix errors, suggest improvements and more.

The Agent understands the context of the rest of your docs content, and you can also add [your team’s style guide](/docs/gitbook-agent/overview#add-a-style-guide-and-custom-instructions) to ensure it reviews your changes while sticking to your team’s style.

### Review change requests with GitBook Agent

You can request a review from GitBook Agent in any [open change request](/docs/collaborate/change-requests/change-requests-screen) in your site.

When viewing an open change request, you can add GitBook Agent as a reviewer. Once added as a reviewer, GitBook Agent will go through your changes, and review for accuracy, clarity, and more — through the context of your published site and style guide.

If you want to inspect the changes yourself, open the change request in the editor and switch to the **Changes** tab. At the bottom of the editor, the floating diff navigator lets you jump between changed blocks, continue to the next page with diffs, and finish the review from the last change with the available review actions.

It will suggest further changes if needed — and if you want the Agent to implement them, you can tell it to do so either [through the chat window](/docs/gitbook-agent/write-and-edit-with-ai#open-gitbook-agent-chat-window-in-any-change-request) or by [tagging it in a comment](/docs/gitbook-agent/write-and-edit-with-ai#tag-gitbook-agent-in-a-comment).

Once you’re happy with your changes, you can [merge the change request](/docs/collaborate/change-requests#merge) to publish the changes live.

### Update change requests with GitBook Agent

GitBook Agent works with you like another member of your team. [Inside of a change request](/docs/collaborate/change-requests/change-requests-in-a-space), you can [open the GitBook Agent chat window](/docs/gitbook-agent/write-and-edit-with-ai#open-gitbook-agent-chat-window-in-any-change-request) to start collaborating.

You can ask it to do things like:

* Write new content or expand existing sections
* Fix typos and spelling errors
* Rewrite unclear or outdated explanations
* Review pages for accuracy, clarity, and completeness
* Generate or update code examples
* Identify missing docs or gaps in workflows.

Find out more about [writing with GitBook Agent here](/docs/gitbook-agent/write-and-edit-with-ai).


# Automatic docs improvements

Identify incorrect and outdated pages in your documentation, review the findings, and fix them automatically with GitBook Agent

{% hint style="warning" %}
**This feature is currently in early access.**

We’re slowly rolling out access. Stay tuned for more progress on the features below.
{% endhint %}

GitBook Agent can identify issues in your documentation — such as content gaps, outdated pages, and incorrect information — and suggest and implement improvements.

## What can GitBook Agent detect?

* **Content gaps** occur when GitBook sees users asking questions about your product that the docs struggle to answer, such as:
  * a customer asking a question to your support team that they couldn’t find on the docs.
  * an API endpoint missing complete documentation.
* **Outdated content** is detected when the content on your page has been superseded by content found in an external source, such as:
  * an SDK update that changed the signature of a function.
  * a paid feature that moved to the free tier, where the docs haven’t been updated.
* **Incorrect content** is flagged when the content on the docs site is explicitly wrong, such as:
  * a guide pointing to APIs that do not exist anymore, or where the feature has been sunsetted.
  * external sources such as your marketing website disagreeing with the documentation.

## How identification works

{% stepper %}
{% step %}

#### Connect sources

GitBook Agent works best when it’s connected to external sources like your support ticketing system, public forums, or marketing website. Some sources require an additional API key or authentication before setup is complete. [Learn more about our connections.](/docs/ai-for-your-readers/connections)
{% endstep %}

{% step %}

#### GitBook Agent generates findings

GitBook regularly reviews your sources and generates findings based on the results. GitBook collects these findings for your team to review. [Learn more about how we ingest data.](/docs/ai-for-your-readers/connections)
{% endstep %}

{% step %}

#### Review your findings

Review your findings to start fixing issues. Each finding includes a summary of the issue, the topic it belongs to, supporting evidence, and links to the pages GitBook used as context.
{% endstep %}

{% step %}

#### Fix or archive

Some findings can be fixed automatically by GitBook Agent. When that option is available, you can create [change requests](/docs/collaborate/change-requests) directly from the finding. You can also archive findings you don’t want to keep in your active list.
{% endstep %}
{% endstepper %}

To request access to GitBook Agent’s automatic documentation improvement features, open your site’s **Settings**.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FTO7pu11GsUcHQGwM4fRw%2F2026-07-13_connections%402x.png?alt=media&amp;token=0eb31f4e-1602-4ba3-9fd7-c202c23d113b" alt=""><figcaption></figcaption></figure>

## Automatic fixes

When a finding supports automatic fixes, GitBook shows a **Create change request** action so the GitBook Agent can generate a proposed fix for your team to review. To skip the suggestion, archive the finding instead. GitBook won’t re-open findings that you’ve archived.


# Translations

Auto-translate your content into multiple languages using GitBook’s AI Agent and keep it synced

{% hint style="info" %}
Only [organization admins](/docs/collaborate/member-management/roles#admin) can create and access translations, as it’s [a billable feature](#pricing).
{% endhint %}

Auto translations make it easy to keep your documentation up-to-date in multiple languages, with minimal manual effort. You can create a section as a translation of another, and let GitBook Agent handle the rest.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FhOOp6fNMYks6U4M6UXTO%2FCreate%20translation%402x.png?alt=media&amp;token=a142a9cd-6ecd-49c4-9670-2226897afc1f" alt=""><figcaption></figcaption></figure>

## How translations work

* **Create a translation section:** Set up a new section as a translation of an existing one. Choose your source section and target language.
* **Continuous updates:** Every time you make changes to the source content, the translation workflow only runs for the **pages that have been changed**.
* **Automatic sync:** After changes are merged, the translation workflow **runs automatically** and syncs with its source, so your translated section always reflects the latest updates.

{% hint style="info" %}
Page slugs in auto-translated sections may change unless the page has a fixed slug. To keep URLs stable across languages, set a fixed slug before translating. To update a slug, see [How can I change the slug in the URL?](https://app.gitbook.com/s/Ua3kTfM3iWAoECzM0u90/published-documentation/custom-domains/how-can-i-change-the-slug-in-the-url)
{% endhint %}

## Set up an auto translation

To translate a section to a new language, go back to your organization **Home** and click **Translations** in the sidebar, then click **Create translation**.

In the **Create translation** modal, choose a:

* **Source** — the section you want to translate
* **From** language
* **To** language

Click **Create** to start the translation workflow. These options will be used to translate your section into a duplicated, translated section in your organization.

The **Translations** screen also lists your configured translation workflows, including their status, source, runs, and translated pages and words. Workflows re-run every time the source content is updated.

### Advanced configuration

Click **Show advanced instructions** in the **Create translation** modal to configure these options.

**Custom AI instructions:** Add advanced instructions to guide the AI on tone of voice, style, or other preferences. This helps ensure your translations match your brand or audience.

{% hint style="info" %}
Adding custom instructions to your translation workflow can be helpful, but is limited in certain cases.

Custom instructions cannot be used to create new elements on a translated section, add extra text, or change the structure of the source content.
{% endhint %}

**Glossary support:** Define a glossary to control how specific terms are translated. This keeps terminology consistent across all supported languages.

Your glossary terms must match the source-language wording you want to control. GitBook applies them during translation runs to keep terminology consistent.

For example, if your source language is English and your glossary includes `SSO` → `SSO` and `Git Sync` → `Git Sync`, a sentence like “Set up SSO with Git Sync” keeps those terms unchanged in the translated output.

{% hint style="warning" %}
**Changing your glossary will trigger a full re-translation of your content**. There is currently no workaround: we cannot reliably detect which pages might contain a glossary keyword, so the safest approach is to re-translate all pages. Updating the glossary may therefore be time- and cost-intensive.
{% endhint %}

## Add a translation to a variant

After creating a translation, you’ll be able to add it to published docs site as a [variant](/docs/manage-your-site/site-structure/variants). This will allow users to toggle between languages in the upper right corner when viewing your main docs site.

{% hint style="info" %}
To provide the best experience for your users, you’re able to set the default language of a variant when setting it in your settings.

It’s best practice to add the language of your translated section when setting up your variant.
{% endhint %}

To set up a new variant for a translation, open the structure editor from **Site structure**, under **General** in the site sidebar.

## Pricing

Translations are a paid add-on. We bill translations on the same monthly or annual cycle as your main subscription.

* Monthly rate: $25 per month for up to 50,000 translated words each month
* Annual rate: $250 per year for up to 50,000 translated words each month
* $0.20 per additional 1,000 words

The monthly allowance resets at the start of each month. The $0.20 rate applies to every additional 1,000 words, including on annual subscriptions.

“Monthly” describes the rate and word allowance. It doesn't describe the billing cycle.

In your first translation, every word will count towards your bill. After that, only **pages** with new or updated words are charged. For example, if you edit your docs later, only the pages with new words will count towards your word limit — you won’t be re-billed for the entire document.

{% hint style="warning" %}
Be cautious when working on multiple translations with large pages, as translated word count includes all words within a page that contains a change — meaning if only a few words are changed in a large page, the entire page will be re-translated.
{% endhint %}

## FAQ

<details>

<summary>Why use auto-translations?</summary>

* **Effortless multilingual docs:** Reach a global audience without manual translation work.
* **Smart updates:** Only changed pages are re-translated, saving time and resources.
* **Full control:** Customize translations with advanced instructions and glossary management.

</details>

<details>

<summary>Can I edit the translation?</summary>

You currently can't edit translations.

As translations are done as a pure transformation of the source content, we can't reconcile potential edits made on the translation result with a new translation.

To workaround it, we recommend the following flow:

* Use the glossary to define specific translations that you want the AI to use
* Use the custom instructions to iterate on the output

</details>

<details>

<summary>How many translations do I need to create?</summary>

You should only create **one translation workflow per language** of any given source content. Creating multiple workflows will accrue extra, duplicated costs in your organization.

</details>

<details>

<summary>What are some current limitations?</summary>

* Translations do not localize UI elements in your variant automatically. Open **Customize**, under **Tools** in the site sidebar, to [localize the interface](/docs/manage-your-site/customization/extra-configuration#localize-user-interface) for a [specific variant](/docs/manage-your-site/customization#customizing-sites-with-multiple-sections-or-variants).
  * This includes user-input customizations, such as announcement banners.
* Translations cannot add extra content to the page - like a hint or a banner noting that a page was translated by AI. Consider adding an extra page in the translated section to note this, or the [announcement banner](/docs/manage-your-site/customization/layout-and-structure#announcement-premium-and-ultimate) in your site variant.
* Changing the glossary triggers a full re-translation of all pages, which can increase processing time and cost. There is no partial re-translation based on glossary usage at this time.

</details>

If you need help getting started or want to learn more about configuring auto-translations, [contact our support team](broken://pages/4XKM0YebpgpW3W1I3TpP).


# Channels

Use GitBook Assistant and GitBook Agent in Slack, GitHub, and Linear

{% hint style="warning" %}

#### Channels are currently in early access

We’re slowly rolling out access to channels. Stay tuned for more progress on the features below.
{% endhint %}

Channels bring [GitBook Assistant](/docs/ai-for-your-readers/gitbook-ai-assistant) and [GitBook Agent](/docs/gitbook-agent/overview) into the tools your team already uses. Once connected, your team can mention `@GitBook` in Slack, GitHub, or Linear to ask questions, open change requests, and keep your docs up to date — without leaving their existing workflow.

When you add a channel, you choose how GitBook shows up in that tool. Each configuration runs in one of two modes:

**Support agent:** GitBook Assistant answers questions from your team or visitors directly in the channel. Ask a question, get an answer pulled from your docs. In Slack, citations in these replies link to the published site URL for the docs they reference. For example, a cited answer links to your docs site, not `app.gitbook.com`.

**Collaborator:** GitBook Agent joins as a teammate. Mention `@GitBook` to open change requests, request edits, or keep your docs in sync with what's happening in that tool. In Slack, messages can link to `app.gitbook.com` when they reference internal workflow context, such as a change request or draft content. When Agent creates a change request from a channel, it automatically links it to the originating thread, issue, or pull request.

You can run multiple configurations per channel — for example, Support Agent mode for one customer-facing Slack channel, and Collaborator mode in another channel for your docs team.

To add a channel, open your site’s **Settings** and click on **Channels**.

Use Channels when support questions, bug reports, or product feedback start in Slack, GitHub, or Linear and you want GitBook to respond in place.

{% hint style="info" %}

#### Looking to embed GitBook Assistant in your website or product?

Head to [Embed in your product](/docs/publish/embedding) to learn how to embed GitBook Assistant.
{% endhint %}

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FvdGn4ibGuysRhvoOiAkI%2F26_05_01_channels%402x.png?alt=media&amp;token=e6cececa-7769-4e66-8f27-2995a822c946" alt=""><figcaption></figcaption></figure>

### Available channels

<table data-view="cards"><thead><tr><th></th><th><select><option value="mjZVekTsgGQo" label="In progress" color="blue"></option><option value="exlMMXLVjkth" label="Planned" color="blue"></option><option value="WK4vEyJjJM8h" label="Available" color="blue"></option></select></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Slack</strong></td><td><span data-option="WK4vEyJjJM8h">Available</span></td><td></td><td></td></tr><tr><td><strong>Linear</strong></td><td><span data-option="WK4vEyJjJM8h">Available</span></td><td></td><td></td></tr><tr><td><strong>GitHub</strong></td><td><span data-option="WK4vEyJjJM8h">Available</span></td><td></td><td></td></tr></tbody></table>

### Coming soon

<table data-view="cards"><thead><tr><th></th><th><select><option value="mjZVekTsgGQo" label="In progress" color="blue"></option><option value="exlMMXLVjkth" label="Planned" color="blue"></option><option value="WK4vEyJjJM8h" label="Available" color="blue"></option></select></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Discord</strong></td><td><span data-option="exlMMXLVjkth">Planned</span></td><td></td><td></td></tr><tr><td><strong>Intercom</strong></td><td><span data-option="exlMMXLVjkth">Planned</span></td><td></td><td></td></tr><tr><td><strong>Microsoft Teams</strong></td><td><span data-option="exlMMXLVjkth">Planned</span></td><td></td><td></td></tr><tr><td><strong>Google Chat</strong></td><td><span data-option="exlMMXLVjkth">Planned</span></td><td></td><td></td></tr><tr><td><strong>Request a channel</strong></td><td></td><td><i class="fa-arrow-up-right-from-square">:arrow-up-right-from-square:</i></td><td><a href="https://github.com/orgs/GitbookIO/discussions/new?category=feature-requests">https://github.com/orgs/GitbookIO/discussions/new?category=feature-requests</a></td></tr></tbody></table>

### Overview

Channels connect GitBook to external workflows.

They let you:

* Answer questions without leaving the source conversation.
* Bring existing docs context into support and product workflows.
* Turn important conversations into docs updates with [GitBook Agent](/docs/gitbook-agent/overview).

Use Channels when the conversation starts outside GitBook, but the answer or follow-up belongs in your docs process.

### Supported platforms

Channels currently support these platforms:

* **Slack** for conversations and support threads.
* **GitHub** for issues, pull-request context, and discussion workflows.
* **Linear** for issue tracking and product feedback workflows.

Each platform uses the same core model.

GitBook receives supported events from the connected platform, gathers context from your knowledge, and responds through either [GitBook Assistant](/docs/ai-for-your-readers/gitbook-ai-assistant) or [GitBook Agent](/docs/gitbook-agent/overview).

### Roles and permissions

Channels support two roles:

* **Collaborator** — can make changes.
* **Support agent** — provides read-only information.

Choose the role based on what the channel needs to do.

#### Collaborator

Use **Collaborator** when the channel must help turn conversations into documentation work.

A collaborator channel can use GitBook Agent to help create or update docs work in GitBook, such as opening or progressing a change request.

#### Support agent

Use **Support agent** when the channel only needs to answer questions.

A support agent channel uses existing docs and connected knowledge to reply with read-only context. It does not make content changes.

### How it works

Channels handle incoming events from your connected platform.

An incoming event can be a new message, a mention, an issue update, or other supported activity from Slack, GitHub, or Linear.

GitBook processes those events in four steps:

{% stepper %}
{% step %}

### Receive an event

The connected platform sends a supported event to GitBook through the channel you installed.
{% endstep %}

{% step %}

### Gather context

GitBook looks up the relevant docs context and any other knowledge available to the site.
{% endstep %}

{% step %}

### Apply the channel role

If the channel is a **Support agent**, GitBook returns read-only information.

If the channel is a **Collaborator**, GitBook can also turn the conversation into docs work through GitBook Agent.
{% endstep %}

{% step %}

### Reply in the source tool

The response appears back in Slack, GitHub, or Linear, so the workflow stays in one place.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Exact event coverage depends on the platform and your early access rollout. If a trigger is not available in your workspace yet, it has not been documented publicly.
{% endhint %}

### Install and authorization

To install a channel, open your site dashboard and choose **Settings** → **Channels**.

Then choose the platform you want to connect.

Each platform uses an OAuth or app-install flow. GitBook sends you to the platform, you approve access, and then you return to GitBook to finish setup.

{% hint style="warning" %}
Platform-specific permission scopes and admin requirements are not fully documented yet.

Review the authorization screen carefully before you approve access.
{% endhint %}

{% tabs %}
{% tab title="Slack" %}
{% stepper %}
{% step %}

### Start the install

In **Settings** → **Channels**, select **Slack**.
{% endstep %}

{% step %}

### Authorize Slack

Sign in to Slack if needed.

Then choose the Slack workspace where you want to install the channel and approve the requested access.
{% endstep %}

{% step %}

### Finish setup in GitBook

After Slack redirects you back, finish the channel setup in GitBook.

Choose the role the channel should use and save the configuration.
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="GitHub" %}
{% stepper %}
{% step %}

### Start the install

In **Settings** → **Channels**, select **GitHub**.
{% endstep %}

{% step %}

### Authorize GitHub

Sign in to GitHub if needed.

Then choose the personal account or organization where you want to install the GitBook app and approve the requested access.
{% endstep %}

{% step %}

### Finish setup in GitBook

After GitHub redirects you back, finish the channel setup in GitBook.

Choose the role the channel should use and save the configuration.
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="Linear" %}
{% stepper %}
{% step %}

### Start the install

In **Settings** → **Channels**, select **Linear**.
{% endstep %}

{% step %}

### Authorize Linear

Sign in to Linear if needed.

Then choose the Linear workspace you want to connect and approve the requested access.
{% endstep %}

{% step %}

### Finish setup in GitBook

After Linear redirects you back, finish the channel setup in GitBook.

Choose the role the channel should use and save the configuration.
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

### Feedback and reactions

Reactions let your team give quick feedback on channel replies.

Use reactions when you want to signal whether a response was helpful.

That feedback helps GitBook understand which responses are working well in real workflows.

{% hint style="info" %}
The exact reaction mapping is not documented yet and can vary by platform during early access.
{% endhint %}


# Guides

Explore guides for creating, improving, and maintaining documentation with GitBook Agent

GitBook Agent helps you create, improve, and maintain documentation with AI. These guides cover practical workflows for your team.

#### Explore

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-pen-to-square">:pen-to-square:</i></h4></td><td><h4>How to write documentation with AI</h4></td><td>Use GitBook Agent as an AI teammate for your documentation</td><td><a href="/docs/guides/editing-and-publishing-documentation/how-to-write-documentation-with-ai">How to write documentation with AI</a></td></tr><tr><td><h4><i class="fa-wand-magic-sparkles">:wand-magic-sparkles:</i></h4></td><td><h4>Streamline docs workflows with GitBook Agent</h4></td><td>Find practical workflows for content updates and maintenance</td><td><a href="/docs/guides/editing-and-publishing-documentation/gitbook-agent-prompt-examples">How to streamline your docs workflow with GitBook Agent</a></td></tr><tr><td><h4><i class="fa-brain-circuit">:brain-circuit:</i></h4></td><td><h4>Introduce AI into your documentation workflow</h4></td><td>Plan an AI-assisted process that keeps people in control</td><td><a href="/docs/guides/docs-workflow-optimization/introducing-ai-into-your-product-documentation-workflow">How to use AI in your docs</a></td></tr><tr><td><h4><i class="fa-code-pull-request">:code-pull-request:</i></h4></td><td><h4>Collaborate on change requests</h4></td><td>Review, discuss, and merge documentation changes with your team</td><td><a href="/docs/guides/editing-and-publishing-documentation/how-to-collaborate-on-change-requests">How to collaborate on change requests</a></td></tr></tbody></table>

#### Quick guides

<details>

<summary>How do I create a first draft with GitBook Agent?</summary>

GitBook Agent can turn a scoped request into a draft change.

This guide covers adding context, reviewing the draft, and refining the content.

<button type="button" class="button secondary" data-action="ask" data-query="How do I create a first documentation draft with GitBook Agent? Show me how to add context, request a draft, review the change, and refine the content. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I review a change request with GitBook Agent?</summary>

GitBook Agent can review documentation changes and identify issues before you merge.

This guide covers requesting a review, addressing feedback, and approving the change.

<button type="button" class="button secondary" data-action="ask" data-query="How do I review a documentation change request with GitBook Agent? Show me how to request a review, address feedback, and approve the change. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I find and fix documentation gaps automatically?</summary>

GitBook Agent can identify outdated or incomplete documentation and prepare fixes.

This guide covers running improvements, reviewing suggested changes, and publishing updates.

<button type="button" class="button secondary" data-action="ask" data-query="How do I find and fix documentation gaps with GitBook Agent? Show me how to run automatic improvements, review suggested changes, and publish updates. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I translate documentation with GitBook Agent?</summary>

GitBook Agent can translate content and keep translated versions aligned with the source.

This guide covers creating translations, reviewing localized content, and managing updates.

<button type="button" class="button secondary" data-action="ask" data-query="How do I translate documentation with GitBook Agent? Show me how to create translations, review localized content, and manage source updates. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>


# GitHub & GitLab Sync

Synchronize your GitBook docs with GitHub or GitLab with GitBook’s bi-directional integration

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FdfcOvA0AfLVpJN5AGk3M%2FSite-wide%20Git%20Sync.png?alt=media&amp;token=a67abfc8-2516-450d-9c43-0d079cafe122" alt="A GitBook screenshot showing the Git Sync setup"><figcaption><p>Set up Git Sync for your GitBook docs.</p></figcaption></figure>

### Overview

Git Sync allows technical teams to sync GitHub or GitLab repositories with GitBook and turn a repo of Markdown files into beautiful, user-friendly docs. Edit directly in GitBook’s powerful editor while keeping content synchronized with your codebase on GitHub or GitLab.

Git Sync is bi-directional, so changes you make directly in GitBook’s editor are automatically synced, as are any commits made on GitHub or GitLab. This allows developers to commit directly from GitHub or GitLab and technical writers, instructional designers, and product managers to edit, discuss and feedback changes directly in GitBook.

### Set up Git Sync

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-github">:github:</i></h4></td><td><h4>Set up GitHub Sync</h4></td><td>Set up and authorize the GitHub integration for GitBook.</td><td><a href="/docs/docs-as-code/git-sync/enabling-github-sync">Enabling GitHub Sync</a></td></tr><tr><td><h4><i class="fa-gitlab">:gitlab:</i></h4></td><td><h4>Set up GitLab Sync</h4></td><td>Set up and authorize the GitLab integration for GitBook.</td><td><a href="/docs/docs-as-code/git-sync/enabling-gitlab-sync">Enabling GitLab Sync</a></td></tr></tbody></table>

{% hint style="info" %}
Git Sync supports IP allowlisting for Enterprise customers. If your GitHub, GitLab, or internal network only accepts traffic from approved IPs, allowlist these outbound Git Sync IPs before you enable the integration:

* `34.136.22.210`
* `34.29.189.57`
* `35.223.181.150`
* `34.72.115.112`
* `136.116.236.109`
  {% endhint %}

{% hint style="info" %}
Only [administrators and creators](/docs/collaborate/member-management/roles) can enable and configure Git Sync.
{% endhint %}

### Working with AI Agents

When working on your docs locally with Git Sync, you can use GitBook's [skill.md file](/docs/docs-as-code/ai-coding-assistants-and-skillmd) to provide an AI coding assistant with context about GitBook's blocks, features, and best practices.

Head to [Agent skills](/docs/docs-as-code/ai-coding-assistants-and-skillmd) to learn more.


# Enabling GitHub Sync

Sync your GitHub repo with GitBook

This guide will take you through setting up your GitBook site with a repo on GitHub.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fr60MP09ALOfZOwCXOgKz%2FGit%20Sync%20-%20GitHub.png?alt=media&amp;token=4289a896-e828-44d7-8c1a-8a752f8eaa4c" alt="A GitBook screenshot showing GitHub Sync configuration options"><figcaption><p>GitHub Sync configuration options.</p></figcaption></figure>

{% stepper %}
{% step %}

### Open Git Sync for your site

From your site, open Git Sync in the sidebar.
{% endstep %}

{% step %}

### Connect GitHub

Connect the GitHub account that has access to the repository you want to sync.

{% hint style="warning" %}
If you see a **'Potential duplicated accounts'** error message at this step, this means your GitHub account is already linked with another GitBook user account.

To help you identify which accounts are linked, you will have to log out from this session and log in using the sign-in with GitHub method.

If you already know your GitBook account associated with GitHub you can log into that user account and unlink your GitHub account (done in settings) before logging back in and linking your current account.

Read more on our [troubleshooting page](/docs/docs-as-code/git-sync/troubleshooting#potential-duplicated-accounts-when-signing-in).
{% endhint %}
{% endstep %}

{% step %}

### Select a repository and branch

Under **Source repository**, select the repository that contains your documentation. Select the branch that GitBook syncs with. If the branch doesn’t exist, GitBook creates it during the initial sync.

{% hint style="info" %}
**Can’t find your repository?** If you can't find your repository in the list, make sure that you've installed the [GitBook GitHub app](https://github.com/apps/gitbook-com) in the right scope (i.e. your personal account or the GitHub org where the repository lives). You should also check that you’ve configured the correct repository access in the GitBook GitHub app.
{% endhint %}
{% endstep %}

{% step %}

### Choose an initial sync direction

Choose the source of truth for the initial sync. Select **Swap direction** if the repository content should replace the GitBook content.

{% hint style="warning" %}
**GitHub → GitBook can replace your section’s content.** If you select an empty repository, GitBook can replace your section with the repository’s empty content.

Before you start the initial sync, confirm the repository, branch, and direction. Make sure the destination content is safe to replace.
{% endhint %}
{% endstep %}

{% step %}

### Set the project directory

If your documentation lives in a subdirectory, enter it under **Project directory**. GitBook stores your site’s `docs.yaml` file in this directory. Use this configuration if your docs live within a [monorepo](/docs/docs-as-code/git-sync/monorepos).
{% endstep %}

{% step %}

### Map your spaces

Under **Content mapping**, assign each space to a directory in the repository. Use `./` for paths relative to the project directory. Use `/` for paths from the repository root. Newly linked spaces sync automatically.
{% endstep %}

{% step %}

### Review advanced options

If needed, configure agent instruction files, a commit message template, or fork previews.
{% endstep %}

{% step %}

### Sync your site

Click **Sync** to start the initial sync.
{% endstep %}

{% step %}

### Write and commit

Merge a change request in GitBook to commit its changes to GitHub. Commits to GitHub sync back to GitBook.
{% endstep %}
{% endstepper %}

#### Exclude a space from site-wide Git Sync

In the site’s Git Sync content mapping, click the remove icon next to the space you want to exclude. You can then configure Git Sync from that space.

If the site already has Git Sync, GitBook asks you to choose a scope:

* Select the site’s repository and branch to add the space to site-wide Git Sync.
* Select an independent repository and branch to configure Space Git Sync.

If the site doesn’t use Git Sync, GitBook configures Git Sync independently for the space.

To configure Git Sync for a single space, in the space you want to sync, click **Set up** next to **Git Sync** in the [space header](/docs/reference/gitbook-ui#space-header). From the provider list, click **GitHub Sync**.

{% hint style="warning" %}
The GitHub app that powers our GitHub integration is currently not available to customers on GitHub Enterprise Server instances.
{% endhint %}


# Enabling GitLab Sync

Sync your GitLab repo with GitBook

This guide will take you through setting up your GitBook site with a repo on GitLab.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FjSaHb62zdd8xp9NpBCif%2FGit%20Sync%20-%20GitLab.png?alt=media&amp;token=c532c019-fd10-4da2-b910-d4aff0e053fb" alt="A GitBook screenshot showing GitLab Sync configuration options"><figcaption><p>GitLab Sync configuration options.</p></figcaption></figure>

{% stepper %}
{% step %}

### Open Git Sync for your site

From your site, open Git Sync in the sidebar.
{% endstep %}

{% step %}

### Connect GitLab

Create a Personal access token in your GitLab user settings. Enable `api`, `read_repository`, and `write_repository`, then enter the token in GitBook.

{% hint style="info" %}
If your token has a role, select `Maintainer` or `Admin`.
{% endhint %}
{% endstep %}

{% step %}

### Select a repository and branch

Under **Source repository**, select the repository that contains your documentation. Select the branch that GitBook syncs with. If the branch doesn’t exist, GitBook creates it during the initial sync.

{% hint style="info" %}
**Can’t find your repository?** Make sure your Personal access token has the required scopes and repository access.
{% endhint %}

{% hint style="warning" %}
If your `main` branch is protected, select a separate branch for Git Sync. You can merge that branch into `main` while keeping its protection.
{% endhint %}
{% endstep %}

{% step %}

### Choose an initial sync direction

Choose the source of truth for the initial sync. Select **Swap direction** if the repository content should replace the GitBook content.

{% hint style="warning" %}
**GitLab → GitBook can replace your site’s content.** Before you start the sync, confirm the repository, branch, and direction. Make sure the destination content is safe to replace.
{% endhint %}
{% endstep %}

{% step %}

### Set the project directory

If your documentation lives in a subdirectory, enter it under **Project directory**. GitBook stores your site’s `docs.yaml` file in this directory. Use this configuration if your docs live within a [monorepo](/docs/docs-as-code/git-sync/monorepos).
{% endstep %}

{% step %}

### Map your spaces

Under **Content mapping**, assign each space to a directory in the repository. Use `./` for paths relative to the project directory. Use `/` for paths from the repository root. Newly linked spaces sync automatically.
{% endstep %}

{% step %}

### Review advanced options

If needed, configure agent instruction files, a commit message template, or fork previews.
{% endstep %}

{% step %}

### Sync your site

Click **Sync** to start the initial sync.
{% endstep %}

{% step %}

### Write and commit

Merge a change request in GitBook to commit its changes to GitLab. Commits to GitLab sync back to GitBook.
{% endstep %}
{% endstepper %}

#### Exclude a space from site-wide Git Sync

In the site’s Git Sync content mapping, click the remove icon next to the space you want to exclude. You can then configure Git Sync from that space.

If the site already has Git Sync, GitBook asks you to choose a scope:

* Select the site’s repository and branch to add the space to site-wide Git Sync.
* Select an independent repository and branch to configure Space Git Sync.

If the site doesn’t use Git Sync, GitBook configures Git Sync independently for the space.

To configure Git Sync for a single space, in the space you want to sync, click **Set up** next to **Git Sync** in the [space header](/docs/reference/gitbook-ui#space-header). From the provider list, click **GitLab Sync**, and click **Configure**.


# Content configuration

Configure Git Sync through code

Git Sync uses three files. Choose the file that controls the part of Git Sync you need:

* `gitbook-docs.yaml` configures the site and maps spaces to repository directories.
* `.gitbook.yaml` configures how GitBook reads one space’s content.
* `SUMMARY.md` defines a space’s navigation.

### Configure the site with gitbook-docs.yaml

`gitbook-docs.yaml` configures the entire site. It lives in the Git Sync Project directory. GitBook uses the repository root when you don't set a **Project directory**.

Use `gitbook-docs.yaml` to define your site structure and map each space to a directory. Each item in `site.structure` has a stable `key`. A space’s `content.directory` sets its repository directory. If a space in a site does not sync to the site’s repository, its `content.directory` is `null`.

#### Keys identify your spaces

Git Sync recognizes each space and section by its `key`, not by its title, path, or directory. The key is how GitBook matches an entry in `gitbook-docs.yaml` to existing content from one sync to the next.

{% hint style="danger" %}
**Changing a space’s `key` replaces that space.** GitBook treats the old key as removed and the new key as a new space. It creates a new space, imports your content into it from the mapped directory, and leaves the original space in your organization, detached from the site.

Your pages come back, but in a new space with a new space ID. Links, cards, and API calls that reference the old ID stop resolving, and anything that exists only in GitBook rather than in your repository stays with the original space.

Restoring the original key doesn’t undo this. It creates another new space and imports into that one.
{% endhint %}

Keys are safe to choose freely when you first create an entry, and GitBook generates them for you when it saves the site content mapping. Once a space is live, treat its key as permanent:

* To rename a space, change its `title`. The key stays the same.
* To change a space’s URL, change its `path`. The key stays the same.

This example maps English and French spaces to separate directories:

{% code title="gitbook-docs.yaml" expandable="true" %}

```yaml
$schema: https://api.gitbook.com/gitbook-docs.yaml
site:
  title: Documentation
  structure:
    - type: section
      key: documentation
      title: Documentation
      path: documentation
      children:
        - type: space
          key: docs-en
          title: English
          path: docs
          default: true
          content:
            directory: ./docs/en
            language: en
        - type: space
          key: docs-fr
          title: Français
          path: fr
          content:
            directory: ./docs/fr
            language: fr
```

{% endcode %}

<details>

<summary>Configure additional site properties</summary>

Use these optional properties to refine your site structure:

| Property               | Use it for                                                |
| ---------------------- | --------------------------------------------------------- |
| `type: section-group`  | Group related sections under a shared navigation heading. |
| `description`          | Add a description to a section.                           |
| `icon`                 | Add an icon to a section or section group.                |
| `localizedTitle`       | Translate a section, section group, or space title.       |
| `localizedDescription` | Translate a section description.                          |
| `hidden`               | Hide a space from site navigation.                        |

GitBook creates or updates `gitbook-docs.yaml` when it saves the site content mapping.

</details>

### Configure a space with .gitbook.yaml

`.gitbook.yaml` configures one space. It lives in that space’s mapped directory. Use it to set the content root, first page, navigation file, and redirects.

The main settings are:

* `root` sets the directory GitBook reads. It defaults to `./`.
* `structure.readme` sets the first page. It defaults to `README.md`.
* `structure.summary` sets the navigation file. It defaults to `SUMMARY.md`.
* `redirects` maps old paths to new paths within the space.

Here is a typical configuration:

{% code title=".gitbook.yaml" %}

```yaml
root: ./

structure:
  readme: README.md
  summary: SUMMARY.md

redirects:
  previous/page: new-folder/page.md
```

{% endcode %}

#### Set the content root

Set `root` when a space’s content lives inside a subdirectory:

{% code title=".gitbook.yaml" %}

```yaml
root: ./docs/
```

{% endcode %}

{% hint style="warning" %}
Paths in `.gitbook.yaml` are relative to `root`. With `root: ./docs/`, `structure.summary: ./product/SUMMARY.md` resolves to `./docs/product/SUMMARY.md`.
{% endhint %}

In a monorepo, `root` only applies inside the mapped space directory. It doesn’t make sibling directories available. For multi-space repository setups, see [Monorepos](/docs/docs-as-code/git-sync/monorepos).

#### Set the first page and navigation file

Use `structure.readme` and `structure.summary` to set custom file paths:

{% code title=".gitbook.yaml" %}

```yaml
structure:
  readme: ./product/README.md
  summary: ./product/SUMMARY.md
```

{% endcode %}

{% hint style="warning" %}
When Git Sync is enabled, manage `README.md` files in your repository. Editing them in GitBook can create conflicts or duplicate pages.
{% endhint %}

#### Configure redirects

Configure space-level redirects in `.gitbook.yaml`. Redirect paths only apply within that space.

You can also manage site-level redirects in the GitBook app. See [Site redirects](/docs/publish/site-redirects).

### Configure navigation with SUMMARY.md

`SUMMARY.md` defines a space’s table of contents. GitBook looks for it in the configured `root` directory.

If GitBook doesn't find `SUMMARY.md`, it infers navigation from your folders and Markdown files. GitBook creates or updates `SUMMARY.md` when you change navigation in GitBook.

Use headings for page groups and nested links for child pages:

{% code title="SUMMARY.md" %}

```markdown
# Summary

## Product

* [Overview](README.md)
  * [Getting started](getting-started.md)
  * [Configuration](configuration.md)

## Reference

* [API reference](api.md)
```

{% endcode %}

Each Markdown file can appear once in `SUMMARY.md`. A page can only have one URL in a space.

#### Set navigation labels

Add a page link title when the navigation label differs from the page title:

{% code title="SUMMARY.md" %}

```markdown
# Summary

* [Page main title](page.md "Navigation label")
```

{% endcode %}

GitBook uses the page link title in the sidebar, pagination, and relative links. Without one, GitBook uses the page title.


# GitHub pull request preview

See a preview of your content when making a pull request in GitHub

When you submit a pull request (PR) to a GitHub branch that has been synced to a GitBook section, you can preview the content before merging. This allows you to check the impact of changes before merging them.

You can use this feature to have a final layer of checks before merging a PR, allowing you to see your changes in a non-production environment before merging it into your synced branch.

### How to access preview links

This behavior works out of the box, provided you have given the [GitBook GitHub app](https://github.com/apps/gitbook-com) the necessary read-only permissions to PRs.

For every PR created using a target branch synced with a GitBook section, you’ll see a status added to the PR with a unique preview URL. Clicking the **Details** link on the status will take you to the preview URL for your content. You can then make sure the content is as expected before merging the PR.

{% hint style="info" %}
Preview links are only accessible by users with a GitBook account.
{% endhint %}

### Security considerations

For security reasons, by default GitBook doesn’t currently generate previews for PRs opened from forks of your repository. Because the content of the PR preview is accessible under your own domain, whether on `.gitbook.io` or your custom domain, a user could generate malicious content in a fork of your public repository and have it served under your name.

We allow users to explicitly configure this through an option in the Git Sync settings.

### FAQ

#### Why can’t I see a preview of my GitBook documentation in my pull request?

Common causes:

* **Your site isn’t published.** PR preview URLs are served from your published docs site (on `.gitbook.io` or your custom domain).
* **Your site is behind authenticated access.** Git Sync PR previews aren’t available for sites published behind [authenticated access](/docs/publish/site-audience/authenticated-access).


# Commit messages & Autolink

By default, when exporting content from GitBook to the Git repository, GitBook will generate a commit message based on the merged change request:

```
GITBOOK-14: Improve documentation about users management
```

## Autolink `GITBOOK-<num>` in GitHub and GitLab

If you want to automatically resolve your GitBook change request IDs (e.g. *GITBOOK-123*) in commits to links, you can enable this using GitHub’s *Autolink references* feature. See instructions on [GitHub](https://help.github.com/en/github/administering-a-repository/configuring-autolinks-to-reference-external-resources).

Use the following URL format, where `spaceId` corresponds to your section’s URL:

`<https://app.gitbook.com/s/{spaceId}/~/changes/<num>/`

<div data-full-width="false"><figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FXMOX8gtwZIZGwdSWhSdX%2Fgitsync-autolink%402x.png?alt=media&amp;token=bebbbb78-1a5f-4e90-af21-29803b3d2a7a" alt="A GitBook screenshot showing autolink setup"><figcaption><p>Autolink setup.</p></figcaption></figure></div>

## Customize the commit message template

When using GitBook with a [monorepo](/docs/docs-as-code/git-sync/monorepos), or when you have specific guidelines for commit messages; you might want to customize the message used by GitBook when pushing a commit to Git.

The template can contain the following placeholders:

* `{change_request_number}` unique numeric ID for the change request
* `{change_request_subject}` the subject of the change request when merged, or `No subject` if none has been provided.

The default template is:

```
GITBOOK-{change_request_number}: {change_request_subject}
```


# Monorepos

Use Git Sync with monorepos and map spaces to separate directories

Use site-wide Git Sync to sync multiple spaces from one repository and branch. Map each space to its own directory in `gitbook-docs.yaml`.

### How site-wide Git Sync works

The site’s **Project directory** sets the Git Sync installation directory. `gitbook-docs.yaml` lives there. If you leave it empty, GitBook uses the repository root.

In `gitbook-docs.yaml`, each space has a `content.directory`. That directory contains the space’s `.gitbook.yaml`, `README.md`, `SUMMARY.md`, and content files.

For an overview of these files, see [Content configuration](/docs/docs-as-code/git-sync/content-configuration).

### Map spaces to directories

Use **Content mapping** in the Git Sync panel to map each space. GitBook saves the mapping in `gitbook-docs.yaml`.

Directory paths work as follows:

| Path     | Meaning                                          |
| -------- | ------------------------------------------------ |
| `./docs` | A directory inside the site’s Project directory. |
| `/docs`  | A directory from the repository root.            |
| `docs`   | The same as `./docs`.                            |

For example, this repository maps three spaces:

```
/
  gitbook-docs.yaml
  documentation/
    .gitbook.yaml
    README.md
    SUMMARY.md
    .gitbook/
      assets/
        logo.png
  developers/
    .gitbook.yaml
    README.md
    SUMMARY.md
  changelog/
    .gitbook.yaml
    README.md
    SUMMARY.md
```

This `gitbook-docs.yaml` maps each space to its directory:

{% code title="gitbook-docs.yaml" %}

```yaml
$schema: https://api.gitbook.com/gitbook-docs.yaml
site:
  structure:
    - type: space
      key: documentation
      title: Documentation
      path: documentation
      content:
        directory: ./documentation
    - type: space
      key: developers
      title: Developers
      path: developers
      content:
        directory: ./developers
    - type: space
      key: changelog
      title: Changelog
      path: changelog
      content:
        directory: ./changelog
```

{% endcode %}

### Keep space content self-contained

Each space only syncs the directory assigned to it. GitBook doesn’t automatically share content or assets between mapped directories.

Keep every referenced asset inside its space’s mapped directory. If several spaces need an asset, add a copy to each directory or reorganize the repository.

The `.gitbook.yaml` `root` setting controls where GitBook reads content within that space’s mapped directory. It doesn’t make sibling directories available.

### Move a mapped directory

Move a space’s content by updating its files and mapping together:

1. In the repository, move the space’s content files and assets.
2. In `gitbook-docs.yaml`, update that space’s `content.directory`. Leave its `key` unchanged.
3. Commit both changes in the same commit.

{% hint style="info" %}
If GitBook imports before both changes exist, the mapped space can appear empty.
{% endhint %}

{% hint style="danger" %}
**Don’t rename the `key` to match the new directory.** Keys and directory names are independent. Changing a space’s key replaces the space with a new one that has a new space ID, and restoring the original key doesn’t bring the old ID back. See [Keys identify your spaces](/docs/docs-as-code/git-sync/content-configuration#keys-identify-your-spaces).
{% endhint %}

Keys generated by GitBook — `space-1`, `space-2` — don’t reflect directory names, and there’s no benefit to keeping the two aligned.

### Use individual space Git Sync

Use individual space Git Sync when a space needs another repository or branch. For example, use it when a private space must sync separately.

Remove the space from the site’s content mapping first. Then configure Git Sync from that space.

To configure the space, follow [Enabling GitHub Sync](/docs/docs-as-code/git-sync/enabling-github-sync) or [Enabling GitLab Sync](/docs/docs-as-code/git-sync/enabling-gitlab-sync). In the scope step, select **Space Git Sync**.


# Troubleshooting

Resolve common Git Sync, repository, redirects, and sign-in issues

Use these solutions to resolve common Git Sync and repository issues. Expand a topic to find the relevant checks and next steps.

### Sync errors and access

<details>

<summary>Error when pushing to a repository with a protected branch</summary>

This error occurs when your Git branch is protected:

```
Error: Missing permissions to push to the refs/heads/main protected branch. Check your branch configuration on your git provider.
```

Git Sync requires the GitBook app to push changes to your repository without restrictions, including during setup. Allow the GitBook app to bypass branch protections for the sync to work.

GitBook supports these branch protections, as long as the app is allowed to bypass them:

* Require a pull request before merging
* Restrict who can push to matching branches

In GitHub, open your repository's branch protection settings and allow `gitbook-com` to bypass those restrictions.

</details>

<details>

<summary>Git Sync status shows an unexpected error</summary>

**If the error appeared when merging a change request in GitBook:** create a new change request with a small change — such as adding a word — and merge it. This retriggers the sync and GitBook exports all content again, including the changes from the failed sync.

**If the error appeared when merging a commit from GitHub or GitLab:** create a new commit in your repository with a small change. When it merges, GitBook imports all content from the repository again, including the changes from the failed sync.

**If the error appeared during first-time setup:** remove the GitHub or GitLab integration, enable it again in your section, and go through the setup process once more.

If none of these steps help, [contact support](/docs/help/contact-support).

</details>

<details>

<summary>Git authentication failed</summary>

This message appears when you attempt to push to a repository that hasn't granted GitBook access. In that case, syncing from your repository to GitBook works, but not the other way — and your repositories may not be listed correctly.

For GitHub, grant access in your GitHub settings: open **Manage Organization → Integrations → Applications**, click **Configure** next to GitBook, and select the repositories the GitBook app can access.

For GitLab, make sure your access token is configured with `api`, `read_repository`, and `write_repository` access.

</details>

<details>

<summary>GitHub preview isn't showing</summary>

If your GitHub preview is not showing, it might be because your GitSync integration was configured before January 2022. Versions of GitSync configured before this date do not include GitHub Preview.

You should have received a notification requesting you to accept an updated permission request to enable read-only access to PRs.

In case you did not receive the notification, to troubleshoot you need to update to the new version:

1. Uninstall the GitSync integration from your organization.
2. Reinstall the new version with the updated permissions.

Note that uninstalling the GitSync integration will require reconfiguring the integration again on any sections it was previously connected to.

</details>

### Repository content and structure

<details>

<summary>Git Sync file size limitations</summary>

Git Sync limits individual file sizes to a maximum of 100MB. To improve performance and synchronization speed, optimize the size of files and assets in your repository.

</details>

<details>

<summary>My table of contents isn't correctly structured</summary>

Your `SUMMARY.md` file mirrors your table of contents on GitBook — the way it's structured is reflected in your content. Make sure the file reflects the structure you want to see in your documentation. See [Content configuration](/docs/docs-as-code/git-sync/content-configuration#summary) for the expected format.

</details>

<details>

<summary>My links to another space return 404 after I edited <code>gitbook-docs.yaml</code></summary>

Cross-space links resolve through space IDs. Git Sync identifies each space in `gitbook-docs.yaml` by its `key`, so changing a space’s key replaces that space: GitBook creates a new one, imports your content into it from the mapped directory, and leaves the original space in your organization, detached from the site.

Your pages come back, but the space ID changes. Links, cards, and `SUMMARY.md` entries that point at the old ID break.

The new ID is permanent. Restoring the original key doesn’t bring the old one back — it creates another new space with another new ID. Repoint the affected references at the current space, and add [site redirects](/docs/publish/site-redirects) for the published URLs that changed.

The original space is still in your organization if you need something from it that isn’t in your repository. [Contact support](/docs/help/contact-support) with the original space ID if you can’t find it.

</details>

<details>

<summary>Does Git Sync also sync pull requests?</summary>

No. Creating a pull request in GitHub or GitLab doesn't create a change request in GitBook, and creating a change request in GitBook doesn't create a pull request in your repository.

</details>

### Common Git Sync issues

<details>

<summary>I have a GitHub sync error</summary>

#### Create README files in your repository

When Git Sync is enabled, be careful not to create readme files through the GitBook UI. Creating readme files through the GitBook UI:

* Creates duplicate README files in your repository
* Causes rendering conflicts between GitBook and GitHub
* May break builds and deployment processes
* Results in unpredictable file precedence

This includes files named README.md, readme.md, Readme.md, and README (without extension). Instead, remember to manage your README file directly in your git repository.

#### Still facing errors?

Make sure that:‌

* Your repository **has a** `README.md` **file** at its root (or at the `root` folder specified in your `.gitbook.yaml`) that was created directly in your git repository. This file is required and is used as the homepage for your documentation. For more details, refer to our [content configuration](/docs/docs-as-code/git-sync/content-configuration).
* If you have YAML frontmatters in your Markdown files, make sure they are valid using a [linter](http://www.yamllint.com).​

</details>

<details>

<summary>GitBook isn't using my <code>docs</code> folder</summary>

By default, GitBook uses the root of the repository as a starting point. A specific directory can be specified to scope the markdown files. Take a look at our documentation on [content configuration](/docs/docs-as-code/git-sync/content-configuration) for more details.‌

</details>

<details>

<summary>GitBook is creating new Markdown files</summary>

**When synchronizing and editing from GitBook** with an existing Git repository, GitBook may create new markdown files instead of using the existing ones.‌ This is done to ensure GitBook doesn't overrite files that existed in your repository before.

</details>

<details>

<summary>Redirects aren't working correctly</summary>

The YAML file needs to be correctly formatted for the redirects to work. Errors such as incorrect indentation or whitespace can result in your redirects not working. [Validating your YAML file](https://www.yamllint.com/) can ensure that the redirects will work smoothly.

When setting redirects, do not add any leading slashes. For example, trying to redirect to `./misc/support.md` will not work.

It's also important to consider that as long as a page exists for a path, GitBook won’t be looking for a possible redirect. So if you're setting up a redirect for an old page to a new one, you will need to remove the old page in order for the redirect to work.

</details>

<details>

<summary>My repository isn't listed</summary>

#### GitHub repositories

Make sure that you have installed the GitBook GitHub app to the correct locations (when installing the app, you can choose to install it to your personal GitHub, or to any organization you have permissions for) and that you have given the app the correct repository permissions.

#### GitLab repositories

Make sure that your access token has been configured with the following access:

* `api`
* `read_repository`
* `write_repository`

</details>

<details>

<summary>Nothing happens after I add a file to my repository</summary>

{% hint style="warning" %}
**This section specifically addresses problems when a `SUMMARY.md` file already exists**

If your repository does not include a `SUMMARY.md` file, GitBook will automatically create one upon the first sync. This means that if you edited your content from GitBook at least once after setting up Git sync, GitBook should have created this file automatically.‌
{% endhint %}

If after updating your repository by adding or modifying a markdown file, you do not see the update reflected on GitBook and the sidebar doesn’t indicate an error during the sync, your modified file(s) is probably not listed in [your `SUMMARY.md` file](/docs/docs-as-code/git-sync/content-configuration#summary).‌

This could either be because you created the file manually, or because you made an edit on GitBook and the GitBook to Git export phase of the sync created it for you.

The content of this file mirrors your [table of contents](/docs/reference/gitbook-ui#table-of-contents) on GitBook and is used during the Git to GitBook import phase of the sync to recreate your table of contents and re-conciliate upcoming updates from the repository with your existing content on GitBook.‌

If after ensuring that all your files are included in the `SUMMARY.md` file there’s still nothing happening on GitBook, don’t hesitate to [contact support](/docs/help/contact-support) for assistance.

</details>

<details>

<summary>I have duplicate accounts when signing in</summary>

This error usually occurs when the GitHub account that you use to set up the sync is already associated with a different GitBook user account.

A good way to identify which GitBook account the GitHub account is already linked to is:

1. Log out from your current GitBook user session (i.e. `name@email.com`)
2. Log out from any GitHub user sessions.
3. Go to [the Log in page](https://app.gitbook.com/login).
4. Select the "Sign in with GitHub" option.
5. Enter your GitHub credentials.
6. Once logged in, go to [the account settings](https://app.gitbook.com/account) and either:
   1. Unlink the account from the "Third-party Login > GitHub" section in the Personal setting
   2. Delete the account altogether if you do not need it.
7. Log out from the session.
8. Log back in using your `name@email.com` GitBook account.
9. Try to set up Git Sync again.

</details>

<details>

<summary>Unsafe files are blocking Git Sync</summary>

Git Sync can fail if your space contains files that GitBook considers unsafe to export (e.g. `.js`).

You may see an error like:

> `File "<filename>" cannot be exported as it is considered unsafe`

Unsafe files must be removed from the GitBook space, not just from the Git repository.

1. Create a change request in the affected space
2. Open the **Files** tab
3. Delete the unsafe file(s)
4. Merge the change request

Once the unsafe files are removed from the space, Git Sync should resume normally.

</details>


# GitBook MCP

Connect AI coding assistants to GitBook so they can create sites, open change requests, and edit content through GitBook’s API

GitBook exposes an MCP server that lets AI tools act on content in your organization.

Tools like Claude Code, Codex, Cursor, and other MCP clients can use it to create and configure sites, open change requests, draft content, edit pages, and restructure docs.

<p align="center">Install our official plugins:</p>

<p align="center"><a href="https://claude.ai/directory/connectors/gitbook-mcp" class="button secondary" data-icon="claude">Install Claude plugin</a> <a href="https://chatgpt.com/apps/gitbook/asdk_app_6a576f075ec4819196c203b7049542be" class="button secondary" data-icon="openai">Install ChatGPT plugin</a> <a href="https://cursor.com/marketplace/gitbook" class="button secondary" data-icon="cursor">Install Cursor plugin</a></p>

{% hint style="info" %}
Need a read-only MCP server for a published docs site? GitBook creates one for you automatically — see [MCP servers for published docs](/docs/ai-for-your-readers/mcp-servers-for-published-docs) to find out more.
{% endhint %}

## GitBook’s MCP Endpoint

Point your MCP client at:

```http
https://mcp.gitbook.com/mcp
```

{% hint style="info" %}
Opening this URL in a browser returns an error. Use it in an MCP client that can make HTTP requests.
{% endhint %}

## Connect your client

Add GitBook MCP in your client of choice:

{% tabs %}
{% tab title="Claude" icon="claude" %}
Install the official GitBook plugin for Claude:

<a href="https://claude.ai/directory/connectors/gitbook-mcp" class="button secondary" data-icon="claude">Install Claude plugin</a>

Or add the server from your terminal:

```bash
claude mcp add --transport http gitbook https://mcp.gitbook.com/mcp
```

Then start Claude Code with `claude` and run `/mcp` to finish the browser sign-in.

If you prefer a personal access token, pass it as an authorization header:

```bash
claude mcp add --transport http gitbook https://mcp.gitbook.com/mcp \
  --header "Authorization: Bearer <YOUR_TOKEN>"
```

{% endtab %}

{% tab title="ChatGPT" icon="openai" %}
Install the official GitBook plugin for ChatGPT:

<a href="https://chatgpt.com/apps/gitbook/asdk_app_6a576f075ec4819196c203b7049542be" class="button secondary" data-icon="openai">Install ChatGPT plugin</a>

Or add the server from your terminal:

```bash
codex mcp add gitbook --url https://mcp.gitbook.com/mcp
```

Then sign in through the browser.

To use a personal access token instead, add this to `~/.codex/config.toml`:

```toml
[mcp_servers.gitbook]
url = "https://mcp.gitbook.com/mcp"
bearer_token_env_var = "GITBOOK_MCP_TOKEN"
enabled = true
```

{% endtab %}

{% tab title="Cursor" icon="cursor" %}
Install the official GitBook plugin for Cursor:

<a href="https://cursor.com/marketplace/gitbook" class="button secondary" data-icon="cursor">Install Cursor plugin</a>

Or add the server to `~/.cursor/mcp.json`, or to your project at `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "gitbook": {
      "url": "https://mcp.gitbook.com/mcp"
    }
  }
}
```

Then sign in when Cursor prompts you.
{% endtab %}

{% tab title="VS Code" icon="vscode" %}
Add the server to `.vscode/mcp.json` in your workspace:

```json
{
  "servers": {
    "gitbook": {
      "type": "http",
      "url": "https://mcp.gitbook.com/mcp"
    }
  }
}
```

Then start it from the MCP view and sign in.
{% endtab %}

{% tab title="Other" %}
Any MCP-compatible client can connect over streamable HTTP.

Point it at:

```
https://mcp.gitbook.com/mcp
```

GitBook supports streamable HTTP only. `stdio` and `SSE` aren't supported.

If you use OAuth, you usually don't need any extra auth fields.

If you use a personal access token instead, send it as a bearer token:

```http
Authorization: Bearer <YOUR_PAT>
```

{% endtab %}
{% endtabs %}

## Authenticate GitBook’s MCP

GitBook MCP supports two authentication methods: OAuth and personal access tokens.

{% tabs %}
{% tab title="OAuth" %}
Point your client at the MCP server URL. The client discovers the authorization server, registers itself, and opens the browser sign-in flow automatically.

If you use OAuth, don't add a bearer token manually. The client gets one during sign-in.
{% endtab %}

{% tab title="Personal access token" %}
To skip the browser flow, send your token as a bearer token:

```http
Authorization: Bearer <YOUR_PAT>
```

You can create a personal access token in your [developer settings](https://app.gitbook.com/account/developer).

Use this for scripted setups, or when your client already manages secrets locally.
{% endtab %}
{% endtabs %}

## Using GitBook’s MCP

{% prompt description="Create and configure a new docs site." %}

```markdown
Using the GitBook MCP tools, create a new docs site for me.

1. List my organizations and confirm which one to use before creating anything.
2. Ask what the site is for and what content I have (folder, repo, or just a description). If I point you at a source, echo back what you find there so I can confirm it's right.
3. Show me a short plan — site name, spaces, page structure — and wait for my yes.
4. Create the site, add the content, and publish. Then fetch the live URL to confirm it works and share it with me.
```

{% endprompt %}

{% prompt description="Open a change request and draft content." %}

```markdown
Using the GitBook MCP tools, draft new content for my docs in a change request — don't edit anything live.

1. List my organizations and sites, and confirm which space to work in.
2. Ask me what the content should cover, then open a change request and draft the pages inside it.
3. Match the tone and structure of my existing pages — read a few first.
4. When done, share the change request preview link so I can review and merge it in GitBook.
```

{% endprompt %}

{% prompt description="Move, rename, or restructure pages across a site." %}

```markdown
Using the GitBook MCP tools, help me restructure my docs site.

1. List my organizations and sites, confirm which one, then fetch its current structure and show it to me.
2. Ask what I want changed, then propose the new structure as a simple before/after tree — don't move anything until I approve.
3. Apply the changes, keeping URLs and internal links intact where possible; flag anything that will break.
4. Show me the final structure and the change request or live result to verify.
```

{% endprompt %}

## The difference between the GitBook MCP and published docs MCP

GitBook has two MCP patterns:

* [**MCP servers for published docs**](/docs/ai-for-your-readers/mcp-servers-for-published-docs) give AI tools read-only access to published content.
* **GitBook MCP** gives AI tools access to your content and workflows through the GitBook API.

Use published docs MCP when you want documentation readers and end-users to find information from your published docs.

Use GitBook MCP when you want your team’s agents to edit and manage your documentation through automated workflows.

## FAQ

<details>

<summary>Which transport does GitBook MCP support when I connect an MCP client?</summary>

GitBook MCP supports streamable HTTP.

GitBook MCP doesn't support `stdio` or `SSE`.

If your client asks for extra fields, you can usually leave them empty.

</details>

<details>

<summary>Do I need to add a bearer token when I connect a client to GitBook MCP?</summary>

You only need to add a bearer token if you authenticate with a [personal access token](https://app.gitbook.com/account/developer).

If you use OAuth, don't add a bearer token manually. Your client gets it during the sign-in flow.

</details>

<details>

<summary>Why does nothing happen after I add the GitBook MCP server to my client?</summary>

Yes. That's expected in some MCP clients.

Adding a server often only saves the configuration. Some clients start authentication only when they first connect, list tools, or open the MCP panel.

</details>

<details>

<summary>Why doesn't anything happen after I click Authenticate for GitBook MCP?</summary>

Some clients open the browser sign-in flow after a short delay.

That delay can be longer on a slow or unstable network.

If no browser tab opens after about a minute, check your network, pop-up settings, and default browser.

</details>

<details>

<summary>What happens during the GitBook MCP authentication flow?</summary>

When authentication works, the flow usually looks like this:

1. The client connects to the MCP server.
2. Your browser opens the sign-in flow.
3. You sign in and approve access.
4. The client shows the server as connected, or the MCP tools become available.

</details>

<details>

<summary>How can I tell if my client authenticated successfully with GitBook MCP?</summary>

The exact signal depends on your client, but the result is usually clear.

Most clients remove the auth prompt, show the server as connected, or let the assistant list and call MCP tools.

If the **Authenticate** button stays visible and no tools appear, the flow likely didn't finish.

</details>

<details>

<summary>What should I check if GitBook MCP authentication still seems stuck?</summary>

Try these checks:

* Confirm the server URL points to the MCP endpoint.
* Confirm the client uses HTTP transport.
* Retry on a stable network.
* Remove and re-add the server if the client cached a failed state.

</details>


# GitBook CLI

Work with your GitBook content from the command line — sign in, query the API, and drive docs workflows from scripts or AI coding agents.

The GitBook CLI (`@gitbook/cli`) is a command-line tool for working with your GitBook content and organizations directly from your terminal.

It wraps the GitBook API as a set of commands, so you can list organizations, inspect spaces and pages, ask questions against your docs, and build and publish integrations — all without leaving the shell.

## Human and agentic workflows

The CLI is built for two kinds of use:

* **Human-driven** — you type commands in your terminal to look things up, script one-off tasks, or manage integrations by hand. Output is formatted for readability in an interactive shell.
* **Agentic coding** — an AI coding agent (Claude Code, Codex, Cursor, and similar) runs the CLI on your behalf as part of a larger task. Machine-readable output (`--json`) and predictable command structure make it easy for an agent to call commands, parse results, and chain them together.

{% hint style="info" %}
If you want an AI agent to create and edit content through GitBook’s API using a purpose-built protocol, see [GitBook MCP](/docs/docs-as-code/gitbook-mcp). The CLI is a good fit when you want scriptable commands, integration development, or an agent that already works comfortably in a terminal.
{% endhint %}

## Install

The GitBook CLI requires Node v18 or later. Install it globally from npm:

```bash
npm install @gitbook/cli -g
```

This installs the `gitbook` command. Check it's working:

```bash
gitbook --version
```

## Authenticate

Sign in once and the CLI stores your credentials locally, refreshing them as needed.

{% tabs %}
{% tab title="Browser (OAuth)" %}
The quickest way to sign in is through your browser:

```bash
gitbook login
```

This opens GitBook in your browser, asks you to authorize the CLI, and stores the resulting token locally. Sessions are refreshed automatically.

This is the recommended path for everyday use.
{% endtab %}

{% tab title="Personal API token" %}
To skip the browser flow — for CI, scripts, or publishing integrations — authenticate with a personal API token. Create one at [app.gitbook.com/account/developer](https://app.gitbook.com/account/developer), then run:

```bash
gitbook auth --token <token>
```

If you omit `--token`, the CLI prompts you for it.
{% endtab %}
{% endtabs %}

Confirm who you're signed in as at any time:

```bash
gitbook whoami
```

To sign out, run `gitbook logout`.

{% hint style="warning" %}
Publishing integrations (`gitbook integration publish` / `unpublish`) requires a personal API token — the browser (OAuth) session can't perform those operations. Run `gitbook auth --token <token>` for publishing workflows. The two credentials can coexist, so you can use browser sign-in for everyday commands and a token for publishing.
{% endhint %}

## Run your first commands

Most commands are generated from the GitBook API and grouped by resource — `organizations`, `spaces`, `collections`, and so on. Start by listing the organizations you belong to:

```bash
gitbook organizations list
```

Grab an organization ID from that output, then list its spaces:

```bash
gitbook spaces list --organization <organizationId>
```

Fetch the details of a single space:

```bash
gitbook spaces get <spaceId>
```

List the pages in a space:

```bash
gitbook spaces content pages list <spaceId>
```

{% hint style="info" %}
Path parameters like `<spaceId>` can be passed as a positional argument or as a flag — `gitbook spaces get <spaceId>` and `gitbook spaces get --spaceId <spaceId>` are equivalent.
{% endhint %}

Run `gitbook --help` to browse the full command tree, or add `--help` to any command (for example `gitbook spaces --help`) to see its subcommands and options.

## Output formats

Every API command supports the same output flags:

| Flag       | Output                                                        |
| ---------- | ------------------------------------------------------------- |
| `--pretty` | Human-readable summaries (default in an interactive terminal) |
| `--json`   | JSON — best for scripts and agents                            |
| `--yaml`   | YAML                                                          |
| `--full`   | Show every field instead of the compact summary               |

If you don't pass a flag, the CLI picks a sensible default: pretty output in an interactive terminal, and YAML when the output is piped or redirected. Pass `--json` explicitly when you're piping into tools like `jq`:

```bash
gitbook organizations list --json | jq '.items[].title'
```

## Ask your docs a question

The CLI can query your content with natural language and stream the answer back as it's generated:

```bash
gitbook organizations ask stream <organizationId> --query "How do I reset my password?"
```

The answer streams to your terminal, followed by its sources and suggested follow-up questions. Press `Ctrl-C` to stop early and keep whatever streamed so far.

## Drive the CLI from an AI coding agent

Because the CLI is scriptable and speaks JSON, an AI coding agent can use it as a tool while it works. Point your agent at the commands above and let it authenticate, explore your content, and act on the results.

{% prompt description="Explore an organization’s docs from the terminal." %}

```markdown
Using the `gitbook` CLI, help me get oriented in my GitBook content.

1. Run `gitbook whoami` to confirm I'm signed in. If not, tell me to run `gitbook login`.
2. List my organizations with `gitbook organizations list --json` and show me the names and IDs.
3. Ask me which organization to explore, then list its spaces.
4. Summarize what you find — how many spaces, and what each one appears to cover based on its title.

Use `--json` for every command so you can parse the output reliably, and show me the exact commands you run.
```

{% endprompt %}

{% prompt description="Answer a question using my docs and cite sources." %}

```markdown
Using the `gitbook` CLI, answer a question from my documentation.

1. Confirm I'm signed in with `gitbook whoami`.
2. List my organizations and confirm which one to search.
3. Run `gitbook organizations ask stream <organizationId> --query "<my question>"` and relay the answer.
4. Include the sources the CLI returns so I can verify the answer against the original pages.
```

{% endprompt %}

## Build integrations

Beyond querying content, the CLI is the primary tool for developing [GitBook integrations](/docs/developers/integrations/quickstart). Scaffold a new project with:

```bash
gitbook integration new
```

Then use `gitbook integration dev` to run it locally and `gitbook integration publish` to ship it. See the [integrations documentation](/docs/developers/integrations/quickstart) for the full development workflow.


# Agent skills

Use GitBook’s official SKILL.md file to give AI coding assistants like Claude Code, Cursor or Codex knowledge of GitBook’s features and blocks

GitBook provides [skill files](https://github.com/GitbookIO/gitbook-skills/tree/main) that teach AI coding assistants how to edit GitBook documentation correctly. If you use Claude Code, Cursor, Codex, or another external coding assistant, add GitBook skills so your agent can work with GitBook syntax, blocks, and configuration files.

This fits well with [Git Sync](/docs/docs-as-code/git-sync) workflows — make changes in your repo, commit them, and your docs site updates automatically.

{% hint style="info" %}
Prefer writing in the GitBook editor? Use [GitBook Agent](/docs/gitbook-agent/overview) to draft, rewrite, review, and translate content without leaving GitBook.
{% endhint %}

## Add GitBook skills to your AI agent

Use this option when your AI coding assistant supports package-based skills.

{% stepper %}
{% step %}

### Create an access token

To let your agent interact with GitBook, you need to [create an access token](https://app.gitbook.com/account/developer) from your GitBook developer settings. GitBook uses this token to authenticate your agent when working with GitBook skills.
{% endstep %}

{% step %}

### Install GitBook skills

This skill is part of the [`gitbook-skills`](https://github.com/GitbookIO/gitbook-skills) repository. Run the following command to install GitBook skills directly to your project:

{% code expandable="true" %}

```bash
npx skills add GitBookIO/gitbook-skills
```

{% endcode %}
{% endstep %}
{% endstepper %}

## Add GitBook skills locally

Download GitBook’s skills if your assistant doesn’t support package-based skills.

{% stepper %}
{% step %}

### Create an access token

To let your agent interact with GitBook, you need to [create an access token](https://app.gitbook.com/account/developer) from your GitBook developer settings. GitBook uses this token to authenticate your agent when working with GitBook skills.
{% endstep %}

{% step %}

### Download GitBook skills

Install GitBook skills with `npx skills add GitBookIO/gitbook-skills` when your assistant supports it.

To copy the files to your project manually, get GitBook skills from the [`gitbook-skills`](https://github.com/GitbookIO/gitbook-skills) repository.

<table><thead><tr><th width="156.67578125" valign="top">Skill</th><th width="455.33203125" valign="top">Description</th><th valign="top">Download</th></tr></thead><tbody><tr><td valign="top"><code>configure-site</code></td><td valign="top">Create and maintain entire GitBook documentation sites.</td><td valign="top"><a href="https://github.com/GitbookIO/gitbook-skills/tree/main/skills/configure-site">GitHub</a><br></td></tr><tr><td valign="top"><code>write-docs</code></td><td valign="top">Write, author, edit, and format GitBook documentation pages.</td><td valign="top"><a href="https://github.com/GitbookIO/gitbook-skills/tree/main/skills/write-docs">GitHub</a><br></td></tr><tr><td valign="top"><code>write-openapi</code></td><td valign="top">Author, configure, structure, and troubleshoot OpenAPI/Swagger API reference docs.</td><td valign="top"><a href="https://github.com/GitbookIO/gitbook-skills/tree/main/skills/write-openapi">GitHub</a></td></tr><tr><td valign="top"><code>build-integration</code></td><td valign="top">Build custom integrations for GitBook.</td><td valign="top"><a href="https://github.com/GitbookIO/gitbook-skills/tree/main/skills/build-integration">GitHub</a></td></tr><tr><td valign="top"><code>cr-create</code></td><td valign="top">Create GitBook change requests, push content, request reviews, and address comments.</td><td valign="top"><a href="https://github.com/GitbookIO/gitbook-skills/tree/main/skills/cr-create">GitHub</a></td></tr><tr><td valign="top"><code>cr-review</code></td><td valign="top">Review GitBook change requests, summarize changes, comment, approve, or request changes.</td><td valign="top"><a href="https://github.com/GitbookIO/gitbook-skills/tree/main/skills/cr-review">GitHub</a></td></tr></tbody></table>

{% hint style="warning" %}
Remember to update your local repository with the latest `SKILL.md` file as GitBook adds new features.
{% endhint %}
{% endstep %}
{% endstepper %}

## Using GitBook skills

{% prompt description="Scaffold a Git-synced docs site from a folder of markdown" %}

```markdown
Using the GitBook skills, turn this folder of markdown into a GitBook docs site backed by Git Sync.

1. Read my docs folder and propose a site structure — spaces, page tree, and SUMMARY.md navigation. Show me before writing anything.
2. Scaffold the repo in GitBook's monorepo layout (README.md + SUMMARY.md per space) and commit it.
3. Create the site and spaces, then give me exact, copy-paste instructions for the one step I do in the GitBook UI: wiring each space to its directory with Git Sync.
4. Once I confirm sync is set up, verify the site structure matches the plan.
```

{% endprompt %}

{% prompt description="Upgrade a plain markdown page into a polished GitBook page" %}

```markdown
Using the GitBook skills, rewrite this page with GitBook's rich blocks — it's currently plain markdown.

1. Read the page and tell me what you'd upgrade: multi-language code samples → tabs, ordered walkthroughs → steppers, callouts → hints, "choose your path" content → cards.
2. Apply the changes using correct GitBook syntax, including frontmatter (title, description, icon).
3. Keep the words mine — improve the structure, not the voice.
4. List anything I should double-check after it renders in GitBook.
```

{% endprompt %}

{% prompt description="Generate an API reference from an OpenAPI spec" %}

```markdown
Using the GitBook skills, set up an API reference section in my docs from my OpenAPI spec.

1. Find my spec (or help me generate one from the codebase if none exists) and validate it.
2. Set up auto-generated endpoint pages with GitBook's OpenAPI block in SUMMARY.md — don't hand-write endpoint pages; the spec stays the source of truth.
3. Add a short overview page per resource group.
4. Flag gaps in the spec (missing descriptions, examples, response schemas) that would make the rendered reference weak.
```

{% endprompt %}

## FAQ

<details>

<summary>What does SKILL.md contain?</summary>

`SKILL.md` gives your AI coding assistant the context it needs to create, edit, and format GitBook content correctly.

It includes:

* A complete syntax reference for custom blocks.
* Configuration file formats, including `.gitbook.yaml`, `SUMMARY.md`, and `.gitbook/vars.yaml`.
* Frontmatter options, layout controls, variables, expressions, decision tables, and common pitfalls.

</details>

<details>

<summary>How do I test AI-generated content?</summary>

Always review and test content generated by AI assistants. When working with an assistant trained on the skill file:

* Verify that custom blocks render correctly in GitBook.
* Check that all internal links work.
* Confirm that the frontmatter is valid YAML.
* Test that variables reference the correct scope.

</details>

<details>

<summary>How do I know my assistant is using SKILL.md?</summary>

Ask it to explain how it would format a GitBook page.

If it references GitBook blocks, frontmatter, variables, or files like `SUMMARY.md`, the skill is loaded.

If it answers with generic Markdown only, check your project rules and reload the assistant.

</details>

<details>

<summary>Why is the assistant ignoring GitBook-specific syntax?</summary>

This usually means the skill file isn’t loaded, or the rules aren’t specific enough.

Make sure your assistant reads `SKILL.md` from the repo root, or uses the GitHub URL in its project instructions.

If the assistant caches instructions, restart the session after you add or update the rule.

</details>

<details>

<summary>What if the assistant generates invalid GitBook content?</summary>

Check the common failure points first:

* Unclosed custom blocks
* Invalid YAML in frontmatter
* Broken variable references
* Links that don't match your page structure

Always review the output in GitBook before you commit it.

</details>

<details>

<summary>Do I still need an access token?</summary>

You need an access token when your agent interacts with GitBook directly. You can create a personal access token in your [developer settings](https://app.gitbook.com/account/developer).

If you’re only editing files locally with `SKILL.md`, you might not need one until you connect the assistant to GitBook workflows or APIs.

</details>

<details>

<summary>What if the skill seems outdated?</summary>

Update your local `SKILL.md`, or point your assistant back to the GitHub source.

If your team copied parts of the file into custom rules, update those too.

</details>


# Guides

Explore guides for docs-as-code workflows, GitBook Agent, and AI-ready documentation

GitBook works with your existing tools and workflows. These guides help you use code and AI to build, maintain, and optimize documentation.

#### Explore

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-code-branch">:code-branch:</i></h4></td><td><h4>Import or migrate content with Git Sync</h4></td><td>Bring existing documentation into GitBook with Git Sync</td><td><a href="/docs/guides/editing-and-publishing-documentation/import-or-migrate-your-content-to-gitbook-with-git-sync">How to import docs with Git Sync</a></td></tr><tr><td><h4><i class="fa-pen-to-square">:pen-to-square:</i></h4></td><td><h4>Write documentation with AI</h4></td><td>Use GitBook Agent to create and maintain documentation</td><td><a href="/docs/guides/editing-and-publishing-documentation/how-to-write-documentation-with-ai">How to write documentation with AI</a></td></tr><tr><td><h4><i class="fa-magnifying-glass-chart">:magnifying-glass-chart:</i></h4></td><td><h4>Optimize docs for AI search</h4></td><td>Prepare documentation for AI search and LLM ingestion</td><td><a href="/docs/guides/seo-and-llm-optimization/geo-guide">How to optimize docs for AI</a></td></tr><tr><td><h4><i class="fa-wand-magic-sparkles">:wand-magic-sparkles:</i></h4></td><td><h4>Streamline docs workflows with GitBook Agent</h4></td><td>Use GitBook Agent for updates, optimization, and bulk documentation tasks</td><td><a href="/docs/guides/editing-and-publishing-documentation/gitbook-agent-prompt-examples">How to streamline your docs workflow with GitBook Agent</a></td></tr><tr><td><h4><i class="fa-terminal">:terminal:</i></h4></td><td><h4>Create and publish a site from the command line</h4></td><td>Use the GitBook CLI to create and publish a site</td><td><a href="/docs/guides/editing-and-publishing-documentation/create-and-publish-a-site-from-the-command-line">How to publish a docs site with the GitBook CLI</a></td></tr></tbody></table>

#### Quick guides

<details>

<summary>Set up Git Sync for your repository</summary>

Git Sync keeps your GitHub or GitLab repository aligned with GitBook.

This guide covers selecting a provider, authorizing GitBook, and connecting your repository.

<button type="button" class="button secondary" data-action="ask" data-query="Write a step-by-step guide to setting up Git Sync for a GitHub or GitLab repository. Cover selecting a provider, authorizing GitBook, connecting the repository, and checking the first sync. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>Connect a coding assistant with GitBook MCP</summary>

GitBook MCP gives compatible coding assistants access to your GitBook content.

This guide covers connecting the server, confirming access, and starting a documentation task.

<button type="button" class="button secondary" data-action="ask" data-query="Write a step-by-step guide to connecting a coding assistant to GitBook with GitBook MCP. Cover adding the MCP server, authenticating, confirming access, and starting a documentation task. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>Run documentation workflows with the GitBook CLI</summary>

The GitBook CLI lets you work with content from your command line.

This guide covers signing in, querying content, and running documentation workflows.

<button type="button" class="button secondary" data-action="ask" data-query="Write a step-by-step guide to using the GitBook CLI for documentation workflows. Cover installing the CLI, signing in, querying content, and running a useful workflow. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>Give coding assistants GitBook skills</summary>

Agent skills give coding assistants context about GitBook features and content blocks.

This guide covers adding the skills file and using it during documentation tasks.

<button type="button" class="button secondary" data-action="ask" data-query="Write a step-by-step guide to giving a coding assistant GitBook skills. Cover finding the skills file, adding it to the assistant&#x27;s context, and using it for a documentation task. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>


# Change requests

Collaborate on content edits through change requests

A change request is a copy of your main content. It's based on the concept of branching, and feels familiar to anyone who uses pull requests in GitHub or merge requests in GitLab.

In a change request, you can edit, update, and delete content, request reviews on your changes, then merge them back into your main version.

To browse and manage open change requests across your site, see the [Change requests screen](/docs/collaborate/change-requests/change-requests-screen).

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fwn8xlD4x46N7JblHVSnP%2Fcollaboration-change-requests%402x.png?alt=media&amp;token=d8b94599-ee17-461a-90a9-35a784833ea1" alt="A GitBook screenshot showing the change requests panel"><figcaption><p>Edit your content through change requests.</p></figcaption></figure>

### Review changes in diff view <a href="#diff-mode" id="diff-mode"></a>

Open the **Changes** tab to review edits in a change request. You can review all pages in context, or focus on changed pages only.

At the bottom of the editor, the floating diff navigator lets you jump between changed blocks, continue to the next page with diffs, and finish the review from the last change with the available review actions.

{% hint style="info" %}
By default, changes are shown in a "split-view". The left showing the 'before' version of the page, and the right showing the 'after' state. If you prefer to view changes inline in a single column-layout, click the diff-mode button at the top-right of the Table of contents panel.
{% endhint %}

### Create and merge a change request

{% stepper %}
{% step %}

### Open a change request

To edit content, open a change request. You can open one in a few ways:

* Click **Edit** in the top right corner of a section.
* Ask GitBook Agent to create one on your behalf.
* GitBook Agent may create one automatically when it detects a documentation gap.

If you open one manually, GitBook creates the change request and opens it in the editor.
{% endstep %}

{% step %}

### Make your changes

Edit content directly in the editor, or work with GitBook Agent.

Review your changes before you move on. You can keep editing until you're ready to request a review.
{% endstep %}

{% step %}

### Request a review

Open the **Overview** tab, then tag one or more reviewers.

Reviewers can approve your changes, leave comments, or request more edits. If you don't tag anyone, everyone with reviewer permissions in the section is notified. If the section has no reviewers, editors and admins are notified instead.

If someone requests changes, update the change request before you merge it. You can also ask GitBook Agent to review the change request.
{% endstep %}

{% step %}

### Merge

Once the change request is approved, open the **Overview** tab and click **Merge**.

GitBook applies the changes to your live docs immediately. If your section uses merge rules, GitBook checks them before merging.

Merging can't be undone. To revert or adjust content, open a new change request.
{% endstep %}
{% endstepper %}

### Working with change requests

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Change request screen</strong></td><td>View and manage change requests across your entire organization</td><td><a href="/docs/collaborate/change-requests/change-requests-screen">Change requests screen</a></td></tr><tr><td><strong>Change requests in a space</strong></td><td>Create and review change requests in a single space</td><td><a href="/docs/collaborate/change-requests/change-requests-in-a-space">Change requests in a section</a></td></tr></tbody></table>


# Change requests screen

Learn about the dedicated change requests screen, which helps you browse, manage and review change requests before merging them and publishing them in your documentation

The change requests screen lets you view and manage active change requests across your site — open them, merge them, or collaborate with GitBook Agent on updates, all in one place. Open it from **Change requests**, under **General** in the site sidebar.

<div data-with-frame="true"><figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FSSaXjsyjfrHEwOJGePQG%2FCleanShot%202025-12-08%20at%2022.03.05%402x.png?alt=media&amp;token=c4ebb192-91c5-4dca-887b-393fe5be9c07" alt=""><figcaption><p>View active change requests from the change requests screen.</p></figcaption></figure></div>

### Navigating the change request screen

All change requests in your site appear in the change requests screen. You can filter by status or filter to show only change requests created by GitBook Agent.

Click a change request to open it in an expanded view. From there you can review, edit, and merge the change request, or continue working on it with GitBook Agent. The expanded view also shows the participants and reviewers, the description, and a diff view of the changes.

To inspect diffs in the editor, click **Edit** in the top right corner to open the change request's space, then switch to the **Changes** tab. The diff navigation control appears there.

To inspect diffs in the editor, click **Edit** in the top right corner to open the change request's space, then switch to the **Changes** tab. At the bottom of the editor, the floating diff navigator lets you move through changed blocks, continue to the next page with diffs, and finish the review from the last change with the available review actions.

### Reviewing a change request

When someone requests your review, you can edit the content and leave feedback directly from the change requests screen.

You can request more changes, or approve the change request to signal it is ready to merge.

Most reviews take place in the change request's comments, where collaborators can discuss specific content blocks or the change request as a whole. You can also ask the [GitBook Agent](/docs/gitbook-agent/review-change-requests-with-gitbook-agent) to review a change request — it can check, plan, and continue working on changes alongside your team.


# Change requests in a section

Learn about collaborating on a single change request in a section — including how to review, resolve conflicts and merge

When you’re within a [section](/docs/reference/concepts#space), you can make changes by opening a new change request, or browse existing change requests to see what other people are working on.

### Creating a change request

Click the **Edit** button in the [section header](/docs/reference/gitbook-ui#space-header) to start a new change request.

This will open a new change request, where you can edit or delete content as needed. Your changes are saved automatically, and other people can join you in a change request to collaborate in real-time.

When creating a change request, you can add a title and description to provide more context about the changes you’re making.

You can also link the change request to a source, including:

* Linear issues
* GitHub pull requests or issues
* Jira tickets
* General URLs

These links appear on the change request, so reviewers can trace the work back to its origin.

Once you’re happy with your changes, you can use the button in the header bar to [**Request a review**](#request-a-review-on-a-change-request) of your change request, or [**Merge**](#merging-a-change-request) it directly into the main branch.

#### Creating a change request with GitBook Agent

[GitBook Agent](/docs/gitbook-agent/overview) is an AI teammate that can [plan and implement change requests](/docs/gitbook-agent/write-and-edit-with-ai#implement-a-change-request-with-gitbook-agent) based on any instructions you give it.

To open a new change request with GitBook Agent, click the GitBook Agent icon in the upper right corner next to the “Edit” button, and ask GitBook to implement any changes you want.

Some things you can ask it to do include:

* Add usage examples
* Improve page SEO
* Enhance clarity
* Check for consistency
* Fix typos and spelling errors
* Link related content
* \+ more

Head to [Writing with GitBook Agent](/docs/gitbook-agent/write-and-edit-with-ai) to learn more.

### Previewing a change request

You can preview the changes you’ve made in a change request by clicking the **Preview** option in the [section header](/docs/reference/gitbook-ui#space-header). This will switch to a preview of your published docs with the proposed changes included, so you can see your changes in the entire context of your published documentation.

Below the **Preview** button is a URL for your site preview. Click this and your site preview will open in full in a new tab.

When you open a preview URL in a new tab, you will also see [the Preview toolbar](/docs/manage-your-site/customization/toolbar-on-published-sites-and-site-previews) at the bottom of the browser window. This toolbar lets you quickly jump back into GitBook to view, edit, or comment on the change request, or open the live version of your site.

{% hint style="info" %}
You can only preview change requests for sections added to a [published docs site](/docs/publish/publish-a-docs-site).
{% endhint %}

{% hint style="warning" %}
If your content is published using share links or authenticated access, the preview function won't appear.
{% endhint %}

### Request a review on a change request

Request a review on your change request when you want to ask members of your team to check your content before you merge the changes into the main branch.

Click the **Overview** tab in the section header bar to open an overview of your change request — including all the changes you’ve made in diff view.

Use the **Overview** tab to add context and reviewers. To inspect diffs in the editor, switch to the **Changes** tab. In that view, pages with diffs show an indicator, and the floating diff navigation control helps you jump between changed blocks faster.

Here you can add a description to your change request to give your reviewers some context, and tag specific people that you want to check your work.

When you click **Request a review**, the change request’s status will change to **In review**, and anyone you tagged in your review request will get a notification.

If your changes don’t require a review, you have the appropriate [permissions](/docs/collaborate/member-management/roles), and you don’t have any blocking [merge rules](/docs/collaborate/merge-rules), you can merge your changes into the main version directly instead.

{% hint style="info" %}
[Add GitBook Agent as a reviewer](/docs/gitbook-agent/review-change-requests-with-gitbook-agent) to your change request and it can check your content for spelling, grammar and style guide errors, suggest improvements and more.
{% endhint %}

{% hint style="warning" %}
If you don’t tag anyone in your review request, everyone with reviewer permissions in the section gets a notification. If the section has no reviewers, the next role above reviewer gets the notification.
{% endhint %}

#### Diff view <a href="#diff-mode" id="diff-mode"></a>

If a page contains diffs, GitBook also shows a floating centered indicator. Click it to scroll to the first changed block or element.

When you open the **Changes** tab in the section header, GitBook shows every page and block edited in the change request. GitBook shows the previous version on the left and the updated version on the right. This makes it easier to compare edits side by side.

Pages that contain diffs also show an indicator in the table of contents, which makes large change requests easier to scan.

As you review a page in the editor’s **Changes** tab, a floating diff navigation control helps you jump between changed blocks faster, without scrolling through the full page.

There are two options when using diff view:

1. **Show all pages** — This shows changed and unchanged pages in the table of contents, so you can review edits in the context of the full section.
2. **Show only changed pages** — This shows only modified pages, so you can focus on edited content.

You can switch to the **Changes** tab to check the diff view in any change request.

<div align="left"><figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FWwRKvsyHgQsk3A4W6b5q%2FScreenshot%202026-07-02%20at%205.52.15%E2%80%AFPM.png?alt=media&amp;token=03f7a12f-f142-48ed-a5f3-415307300ac6" alt="" width="188"><figcaption><p>This is the navigation controls widget at the bottom of the Changes screen</p></figcaption></figure></div>

### Merging a change request

Merging a change request will add the change request’s changes into the main branch of content, creating an updated version and a new entry in the section’s [version history](/docs/create-content/version-control#see-the-activity-of-a-specific-draft).

You might not be able to merge a change request if you don’t have the right [permissions](/docs/collaborate/member-management/permissions-and-inheritance), or if your change request hasn’t passed your organization or section’s [merge rules](/docs/collaborate/merge-rules).

### Updating a change request

As you're working inside a change request, other contributors may be modifying the main branch of the section. When this happens, your change request is considered "out of date" - there is content on the main branch that you don't see inside your change request.

You may want to pull in this new content into your change request. This can be useful if:

* You want to see how your changes and the content on main look once everything is together.
* You need to make changes to the pulled content as part of your change request.

You can do this by pressing **Update** in the header of the change request screen.

Once you press **Update**, all content from the main branch is pulled into your change request. You may get conflicts when you update - you'll be able to resolve them inside the change request. Once conflicts have been resolved, the change request is considered up-to-date and the Update button disappears.

If the main branch changes again, your change request will again be out-of-date and the Update button will appear.

Asking editors to have their change requests up-to-date before merging is a good quality control - it helps authors check the exact content that will go into the main branch once their change request is merged. You can enforce this with a [merge rule](/docs/collaborate/merge-rules).

### Resolving merge conflicts

Sometimes, when you want to merge a change request, you may discover conflicts between the main content and the content you’re trying to merge. In the simplest form, a conflict is a piece of content that could not be merged automatically.

If this happens, you’ll be presented with a conflict alert, and a list of the conflicts you’ll need to resolve before continuing the merge.

You have two options when it comes to resolving a merge conflict — **selecting a version to merge** or **manually** **editing the content**.

#### Selecting a version to merge

You can resolve a merge conflict by selecting a version you want to merge — either your incoming content, or the content that was previously there. This allows you to choose between one change and another — either your recent work, or the original content.

If you’re dealing with a merge conflict that can be resolved this way, you can select the version you want to keep, and the other version will be deleted.

#### Manually editing

If you don’t want to choose between versions, you can resolve a merge conflict by manually editing the conflict. You’ll be able to delete the blocks you don’t need, or even rewrite them entirely. Once you’re happy with the changes, you can move on to the next conflict until they’re all resolved.

### Archiving a change request

You can't delete a change request in GitBook, but you can archive it instead.

To archive a change request:

1. Open the **Change requests** tab.
2. Click the change request you want to archive.
3. Click the **Actions** menu <picture><source srcset="/files/HXFvPsjDqbaBEhpH0WKJ" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FPnnI41SqLSaKBNwT98fW%2Factions-horizontal.svg?alt=media&amp;token=99754200-a354-4ffe-931e-aa6322ea7395" alt="The Actions menu icon in GitBook"></picture> next to the change request's title and choose **Archive**.

To find and reopen an archived change request, open the **Change requests** menu and click the **Archived** tab.


# Merge rules

Define requirements that must be met before change requests can be merged

Merge rules allow you to define requirements that must be met before change requests can be merged, such as needing a review from a specific user, or requiring a subject or description for the change request.

These rules help maintain content quality and ensure proper review processes across your documentation workflow.

When you have merge rules configured, they’ll automatically evaluate change requests before they can be merged. If a rule isn’t satisfied, the merge will be blocked until the requirements are met.

This provides an automated way to enforce your team’s collaboration and review standards.

## Using merge rules

You can configure merge rules at different levels to match your team’s workflow:

### Organization-level configuration

Organizations can set default merge rules that all sections inherit. This provides consistency across multiple sections while still allowing individual sections to customize their rules as needed.

To configure merge rules for your organization, go back to your organization **Home** and click **Settings** <picture><source srcset="/files/CG9bVSmdbJnQxrYiNbRI" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FwkBqgOPry9HAcW4cxJk0%2Fsettings.svg?alt=media&amp;token=67bdbb00-ebf3-4a2d-9df8-0c822406f71c" alt=""></picture>, under **Admin** in the sidebar. In the settings screen, click **Merge rules** under the **Organization** group. Here you can specify merge rules for your entire organization.

Choose between unrestricted merging, or select from the list of presets to apply to change requests across your entire organization.

### Section-level configuration

Whether or not you have enabled organization-wide merge rules, each section can have its own merge requirements tailored to its content and team structure.

This gives you the flexibility to have stricter rules for important documentation and more relaxed rules for draft content.

When setting up merge rules for a section, you can choose to:

* **Inherit** merge rules from your organization
* **Define custom rules** specific to that section
* **Disable merge rules** entirely

{% hint style="info" %}
If you inherit organization rules, any changes to the organization’s merge rules will automatically apply to the section.
{% endhint %}

To configure merge rules for a section, open the **Actions menu** <i class="fa-ellipsis">:ellipsis:</i> in the top left of the editor, and then click **Merge rules**. Here you can specify whether to inherit the merge rules from your organization or configure new ones specific to that section.

## Rule evaluation

### How rules work

When someone wants to merge a change request, GitBook will evaluate all the configured rules in order:

* All rules in a configuration must pass for a merge to be allowed
* Rules are evaluated in the order they appear in your configuration
* If any rule fails, the merge is blocked with an appropriate error message
* Rules with bypass capabilities can override previous failures

### Bypass rules

Some rules have bypass capabilities (like **Allow specified actors to bypass requirements**). These special rules can override other rule failures. If a bypass rule evaluates to true, the merge will be allowed even if other rules have failed.

## Best practices

When setting up merge rules, consider these recommendations:

* **Start simple**: Begin with basic rules like requiring at least one review.
* **Scale gradually**: Add more specific requirements as your team grows and workflows mature.
* **Use bypass carefully**: Only grant bypass permissions to trusted administrators.
* **Review regularly**: Adjust rules based on your team’s actual workflow patterns.
* **Test first**: When possible, test rule changes in a test section before applying to production sections.

## Available rule types

### Review requirements

<table><thead><tr><th width="279.703125">Rule</th><th>Description</th></tr></thead><tbody><tr><td><strong>Require at least one review</strong></td><td>Ensures that at least one team member has reviewed the change request before it can be merged.</td></tr><tr><td><strong>Require all reviews approved</strong></td><td>All <strong>completed</strong> (not requested) reviews must be approvals. If any reviewer has requested changes or rejected the change request, the merge will be blocked.</td></tr><tr><td><strong>Require review by specified actors</strong></td><td>Requires approval from all specified users. You can select specific team members who must review and approve the change request before it can be merged.</td></tr><tr><td><strong>Require review by one of specified actors</strong></td><td>Requires approval from at least one of the specified users. This is useful when you have multiple qualified reviewers but only need one approval from the group.</td></tr><tr><td><strong>Require Docs Agent review (coming soon)</strong></td><td>Requires a review from the GitBook AI agent. This ensures automated quality checks are performed on content changes before merging.</td></tr></tbody></table>

### Change request requirements

<table><thead><tr><th width="279.703125">Rule</th><th>Description</th></tr></thead><tbody><tr><td><strong>Require up to date change request</strong></td><td>The change request must be current with the primary content branch. If the primary content has been updated since the change request was created, you’ll need to rebase or update it before merging.</td></tr><tr><td><strong>Require subject</strong></td><td>The change request must have a descriptive subject/title. Empty subjects will block the merge.</td></tr><tr><td><strong>Require description</strong></td><td>The change request must include a description explaining what changes were made and why.</td></tr></tbody></table>

### Advanced options

<table><thead><tr><th width="279.703125">Rule</th><th>Description</th></tr></thead><tbody><tr><td><strong>Allow specified actors to bypass requirements</strong></td><td>You can designate specific users who are allowed to bypass all other merge rule requirements. This is useful for administrators or emergency situations where rules need to be overridden.</td></tr><tr><td><strong>Custom expression</strong></td><td>You can create advanced merge rules using custom JavaScript expressions. This allows you to define complex logic based on the evaluation context, with access to properties of the change request, reviews, and the user attempting to merge.</td></tr></tbody></table>

#### Custom Expressions

When you create a custom expression, it will be evaluated each time someone tries to merge a change request. If the expression returns `true`, the merge is allowed. If it returns `false`, the merge is blocked.

{% hint style="info" %}
Custom expressions support standard JavaScript syntax (ES2022) and have a maximum length of 1024 characters.
{% endhint %}

**Available context variables:**

* `changeRequest.subject` - The subject/title of the change request
* `changeRequest.description` - The description of the change request
* `changeRequest.outdated` - Whether the change request is outdated (boolean)
* `changeRequest.createdBy.id` - ID of the user who created the change request
* `reviews` - Array of review objects, each containing:
  * `reviews[].status` - Review status (`"approved"` or `"changes_requested"`)
  * `reviews[].reviewer.id` - ID of the reviewer
* `actor.id` - ID of the user attempting to merge

**Common expression examples:**

{% code title="Require multiple approved reviews" %}

```javascript
reviews.filter(r => r.status === "approved").length >= 2
```

{% endcode %}

{% code title="Require approval from specific user" %}

```javascript
reviews.some(r => r.reviewer.id === "harry" && r.status === "approved")
```

{% endcode %}

{% code title="Require description for urgent changes" %}

```javascript
!changeRequest.subject.includes("[URGENT]") || !!changeRequest.description
```

{% endcode %}

{% code title="Allow self-merge only for minor changes" %}

```javascript
changeRequest.createdBy.id === actor.id ? changeRequest.subject.startsWith("[minor]") : true
```

{% endcode %}


# Comments

Ask questions to your team or receive feedback on the content you create

Comments allow you to provide feedback around specific pieces of content — without switching out of context from GitBook.

### Add a comment <a href="#comment-within-your-content" id="comment-within-your-content"></a>

You can open the comments panel by clicking on the **Comments** button <picture><source srcset="/files/pDeFaKnBm2RYQrk7saJ9" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FwY5tC7wFYA0IYlJqzZjb%2Fcomment.svg?alt=media&amp;token=29d1a323-d832-4791-bb2c-ae13e24ee04c" alt="The Comments button icon in GitBook"></picture> in the [section header](/docs/reference/gitbook-ui#space-header).

Adding a comment here will attach a comment to the entire page. You can also comment on a specific block by hovering over a block and clicking the content icon that appears on the right.

You can tag teammates by typing the `@` symbol followed by their name.

{% hint style="info" %}
Guests will be able to make comments but they will not be able to see or mention other users in the organization.
{% endhint %}

### Comment threads

You can reply to any comment to start a conversation with your teammates, turning it into a discussion thread.

You can also leave an emoji reaction on any comment by clicking the emoji button on the message or thread you’d like to react to.

### Resolving comments

If you’re done working through a comment thread or idea, you can **resolve** a comment at any time. Resolving a comment will hide it in the interface, but still keep it accessible in the ’Resolved’ tab of the section’s comments panel.


# Live edits

Edit pages in real-time with other collaborators

With live edits enabled, members in your org can edit a section without creating [a change request](/docs/collaborate/change-requests). When editing content, you can see the avatars of anyone currently viewing the section in the top-right corner.

GitBook supports live collaboration, meaning you’ll be able to work on the same document with multiple members at the same time.

{% hint style="info" %}
**Live edits are locked** by default in any newly created section. To edit the content, you will either need to [create a change request](/docs/collaborate/change-requests), or toggle live edits on.
{% endhint %}

### Toggling live edit mode

You can toggle live edit mode in a section by clicking **Lock live edits** or **Unlock live edits** in the [section header’s](/docs/reference/gitbook-ui#space-header) **Actions menu** <picture><source srcset="/files/HXFvPsjDqbaBEhpH0WKJ" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FPnnI41SqLSaKBNwT98fW%2Factions-horizontal.svg?alt=media&amp;token=99754200-a354-4ffe-931e-aa6322ea7395" alt="The Actions menu icon in GitBook"></picture>.

When a section is in **Live edits** mode, the section header will show the **Editor** tab. When it is in **Locked live edits** mode, the section header will show a **Read-only** tab. When the Read-only tab appears in the section header, you will need to open a change request to edit the content of the page, or unlock live edits.

### When is live editing *not* available?

You cannot unlock live editing if:

1. a section is published with the **Public** or **Unlisted** visibility option.
2. a section has [GitHub or GitLab Sync](/docs/docs-as-code/git-sync) enabled.

{% hint style="info" %}
Only [administrators and creators](/docs/collaborate/member-management/roles) can lock or unlock live edits.
{% endhint %}


# Notifications

Receive notifications about new content, updates to your sections or changes in visibility

Notifications provide updates about the activity on GitBook that comes from sections owned by you or an organization that you are a member of.

You can receive notifications inside the GitBook app and/or via email. We support [several types of notifications](#notification-types) which you can disable or enable in your notification settings.

### App notifications

You can find app notifications at the top of the [sidebar](/docs/reference/gitbook-ui#the-sidebar).

Within the notifications pop-up, you’ll see two icons in the top-right corner. You can either mark all of your notifications as read, or head to your notification settings to update your preferences.

### Email notifications

Email notifications are enabled by default, and can be disabled in your notifications settings. When enabled, GitBook will send one email per notification type. This will be sent to the email address associated with your personal GitBook account.

These email will appear to be sent from `no-reply@gitbook.io via sendgrid.net`

#### Possible issues

As with all email delivery, there’s a chance that you might not receive the email. Possible reasons include but are not limited to:

* Our email ends up in your spam folder or caught by another protection mechanism.
* Emails sent from GitBook to your email address have bounced many times, and therefore further sending has been automatically blocked by our mail service.
* There could be a temporary delivery problem that will resolve on its own.
* A wrong expectation about the notifications you should be receiving.
* A wrong expectation about the email address to which we would be sending the notification.

If you think you might be running into any of these issues, here are some things you can try:

* Check your spam or other protection mechanism and make sure our email address (`no-reply@gitbook.io`) is not blocked on your end.
* Wait it out if you are aware of any temporary issue with your mail provider.
* Check [your settings](https://app.gitbook.com/account/notification) to ensure that you have enabled email notifications for the type of notification you are expecting.
* Make sure you are checking the correct email address. You can see the email address of your personal account in [your account settings](https://app.gitbook.com/account).
* [Contact support](broken://pages/4XKM0YebpgpW3W1I3TpP) if all other things fail. If you do, please make sure to include as much information as possible. For example, this might include the email address you expect to receive the notification to, the type of the notification (you can see that in the [settings](https://app.gitbook.com/account/notification)), and the exact details of what you feel should have triggered that notification for you. Please include links to anything relevant, as well.

### Notification settings

For both app and email notifications, [you can configure](https://app.gitbook.com/account/notification) which notifications you would like to receive.

#### Notification types

We currently offer notifications for the following areas:

* Sections — comments posted in a section
* Change requests — reviews requested by collaborators
* Comments — replies to your comments
* Mentions — when you’re mentioned in a comment
* Organizations — upgrade requests from collaborators


# Member management

Learn how to manage access to content for members of your organization

You can [invite and remove members](/docs/collaborate/member-management/invite-members-to-your-organization) from your organization, manage members’ content access through [roles](/docs/collaborate/member-management/roles), and manage [teams](/docs/collaborate/member-management/teams) of members from the members’ page in your organization’s settings.

## Members & permissions

Shows each person’s role, last seen date, and SSO status, if applicable. You’ll also see an overview of the [spaces](/docs/create-content/content-structure/space) they can access and, if you’re on the Pro plan, how many [teams](/docs/collaborate/member-management/teams) they’re part of.

Click the **Teams** or **Access** listings for any member to jump to a list of all those teams and spaces.

You can also click on any member to open their **individual member page**. Here, you can see more information about them, including their join date and active status.

Select the **Teams** and **Spaces** tabs to see a list of the [teams](/docs/collaborate/member-management/teams) they’re a member of, and the spaces they have access to — as well as their access level for those specific spaces.


# Manage or remove members

Learn how to manage the members of your organization, including adding new admins and what to do if the only admin leaves your organization

{% hint style="info" %}
If you’re looking for information about inviting members to your org, read [Inviting your team](/docs/collaborate/share)
{% endhint %}

### Manage member roles <a href="#manage-member-roles" id="manage-member-roles"></a>

You can view and manage your organization’s members from the **Members** section of your [organization settings](/docs/account-and-billing/organization-settings) page.

Here you can change a member’s role, see when they were last active, and view their teams and the content they have access to. You can also use the **Actions menu** ![](https://sites.gitbook.com/preview/site_p4Xo4/~gitbook/image?url=https%3A%2F%2F1050631731-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNkEGS7hzeqa35sMXQZ4X%252Fuploads%252F89MTSo5XRpPMVr1T0rxS%252Factions.svg%3Falt%3Dmedia%26token%3D2b5d001e-560a-4f29-8d22-de8163725ca1\&width=300\&dpr=3\&quality=100\&sign=d841db7e\&sv=2) to copy their name, email or user ID, or to remove them from the organization.

Click any user to see more details about them in a dedicated screen.

### Remove members <a href="#removing-members" id="removing-members"></a>

#### Leaving an organization <a href="#leaving-an-organization" id="leaving-an-organization"></a>

To leave a GitBook organization:

1. Open your **Settings** page and choose the **Organizations** section.
2. Hover over the organization you want to leave and click the **Leave** button that appears.

{% hint style="danger" %}
It is not possible to rejoin an organization you have left unless you are invited to it again.
{% endhint %}

If you are an organization administrator and wish to leave an organization, ask another admin in the organization to remove you.

#### Removing a member <a href="#removing-a-member" id="removing-a-member"></a>

To remove a member of your organization:

1. Open your organization’s **Settings** page and open the **Members** section.
2. Find the member you want to remove.
3. Open the **Actions menu** ![](https://sites.gitbook.com/preview/site_p4Xo4/~gitbook/image?url=https%3A%2F%2F1050631731-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNkEGS7hzeqa35sMXQZ4X%252Fuploads%252F89MTSo5XRpPMVr1T0rxS%252Factions.svg%3Falt%3Dmedia%26token%3D2b5d001e-560a-4f29-8d22-de8163725ca1\&width=300\&dpr=3\&quality=100\&sign=d841db7e\&sv=2) and choose **Remove member**.

### Transfer ownership of an organization <a href="#transferring-ownership" id="transferring-ownership"></a>

Nobody “owns” your GitBook organization, but you do need at least one an admin in any organization. If you prefer to have only one user in charge of the billing and member management, we recommend downgrading other admin users to [the Creator role](/docs/collaborate/member-management/roles#creator).

You can add a new admin to your organization at any time. If your admin has left the organization, [see the related section in the FAQs](#how-do-i-add-and-manage-admin-roles-in-my-gitbook-organization) for next steps.

### FAQs <a href="#faqs" id="faqs"></a>

<details>

<summary>How do I add and manage admin roles in my GitBook organization?</summary>

[Administrators](#admin) play a crucial role in managing your organization’s settings, billing, and member permissions.

**Adding a new admin**

To add a new admin, first invite [invite them to your organization](/docs/collaborate/share), making sure to select **Administrator** as their role.

Once they accept the invitation, the new admin will gain access to administrative settings, including billing.

**Steps when the only admin leaves your organization**

If the sole admin of a GitBook organization has removed themself from your organization, our support team can assist in transitioning admin rights to another person. Here’s what to do:

1. [Contact the GitBook support team](https://www.gitbook.com/contact) to request an update of organization admin permissions.
2. Complete the required identity verification process. This typically involves confirming details linked to the account, such as payment card information.

{% hint style="info" %}
**Identity verification and security measures**

To ensure security and protect sensitive information, **we must verify your identity** when administrative roles are modified. This step is critical to confirm the requesting party’s association and authority within the organization.
{% endhint %}

</details>

<details>

<summary>How do I downgrade my organization to a free single-user plan?</summary>

GitBook’s free plan only allows a single user without any docs sites. If you want to downgrade to this plan, you will need to remove all other members.

The admin who will remain as the owner can remove other users completely, blocking their access to collaboration and editing features. ​﻿﻿You can also ensure that the right person receives any future bills and receipts by updating their details in [the Billing section](/docs/account-and-billing/organization-settings#billing) of your [organization settings](/docs/account-and-billing/organization-settings). ​

</details>


# Permissions and inheritance

Understand how permissions work in GitBook and how to control who can access and edit your content

GitBook has a flexible permissions model that lets you have as much, or as little, control over permissions as you need. The permission model in GitBook is a [**role-based**](/docs/collaborate/member-management/roles#roles-in-gitbook)**, cascading** model. This means that you set defaults and then, at any level of content, decide whether to inherit those defaults or not.

You can set permissions at four levels: **organization**, **site**, **collection**, and **space**.

### Organization default roles

When you add a member to your organization, you set [their default role](/docs/collaborate/member-management/roles). This role applies to any piece of content that inherits its permissions from the organization defaults.

### How permissions cascade

Permissions in GitBook resolve by **precedence**, not by the highest role across every level.

For spaces in inherited mode, GitBook resolves access in this order:

* **Space** — direct member and team overrides on the space
* **Site** — permissions from the parent site
* **Collection** — permissions from the parent collection, if there is one
* **Organization** — the default role set for each member

This means site permissions override organization defaults and parent collection defaults for linked spaces in inherited mode. Direct space-level overrides still take precedence over everything else.

Here are two examples of how this works in practice:

<details>

<summary><strong>Example 1</strong></summary>

A member has a Creator role at the organization level. A linked space is in inherited mode, and the parent site sets that member to Commenter. The member gets Commenter access in that space, because the site takes precedence over the organization default.

</details>

<details>

<summary><strong>Example 2</strong></summary>

A collection sets a space to Reader, and the parent site sets it to Commenter. The space uses Commenter, because site permissions take precedence over the parent collection in inherited mode. If you then give one member direct Creator access on the space, that direct override wins for that member.

</details>

{% hint style="info" %}
**Note:** Site permissions only apply to spaces in inherited mode. If a space has its own permissions configured — meaning it is not in inherited mode — those take precedence and site-level permissions will not affect it.
{% endhint %}

### Managing inheritance

Any time you create a collection or a space, you’ll be able to set the type of inheritance you want. You have three broad options when setting the inheritance for a piece of content:

### Inherit

Setting the inheritance to **inherit** will make the space or collection inherit the roles assigned in the **parent level content**. For top-level spaces or collections, this parent is the organization, so they would inherit the organization default roles. For spaces or sub-collections inside a collection, the parent will be the collection the content sits within.

When a space is linked to a site and stays in inherited mode, GitBook resolves access in this order: direct space overrides, then the parent site, then the parent collection, and finally the organization. Site permissions take precedence over organization and collection defaults, but they do not change direct space-level overrides.

### Specific role access

Selecting a specific role when setting a collection or space’s permission inheritance will **reset** the organization default roles and assign every **non-admin** to that role within the collection or space. For example, if you set the inheritance to **reader**, everyone in the organization would have read-only access to the space or collection, regardless of their default role.

Direct member or team access on that collection or space can still override this inherited setting. If you set a specific role on the space itself, the space is no longer using inherited mode, so site permissions do not affect it.

### No access

You can also completely revoke access for any non-admin organization members at a space or collection level. This will hide the content from everyone except for admins and whomever created the space or collection.

{% hint style="info" %}
The default inheritance option for any newly-created space or collection is **inherit**. This means that whenever a piece of content is created, it’ll inherit permissions from its parent by default.
{% endhint %}

### Setting content specific permissions

Once you’ve decided on the permission inheritance for your space or collection, you can further customise access by giving teams or members **direct access**.

### Giving a team direct access

You can add a team directly to a collection or space with a specific role. This will give anyone in that team the specified access to the content.

{% hint style="info" %}
Team access is a great way to ensure that the right people have access to the right content; any time someone is added to or removed from a team, they’ll gain or lose, respectively, the permissions set on the content.
{% endhint %}

### Giving a member direct access

Similarly to teams, you can also give members direct access. This is the most granular way of managing permissions. When giving single members direct access to a collection or space, you override any inherited permissions they might have. Direct member access is great if you need very specific control over collaborators.

Members with direct access at the space level are removed from the inheritance pattern entirely. Their role is set explicitly, and is not affected by org, site, or collection-level permissions.

### Keeping on top of permissions

While this might seem pretty complex at first, GitBook’s permission model gives you control if you need it, and gets out of the way if you don’t. For many teams, a **set-and-forget** approach to permission management is all they need. For other teams, especially larger organizations, this level of control over access and workflow is essential.

#### Set and forget

If you just want to get your teammates onboarded and editing content with you, then you might never even need to look at permissions. Invite folks, set their default role, and any content you create will default to inheriting these roles. No need to get into the weeds!

#### Control over access and workflow

For larger organizations, teams that split their organization up into discrete collections, or teams that need very granular control over workflow; then getting into the weeds is exactly what’s needed. Using a combination of inheritance, overriding, direct team access and direct user access, you can create workflows and access models that keep you in control.


# Roles

A breakdown of every role in GitBook — what each one can do, and how to use them to control access across your organization

When adding members to your organization, you can give them a **default role**. This role will apply to any content that inherits its permissions from the organization. Understanding default roles is key to getting the most out of how GitBook handles permission management.

See our documentation on [**permissions and inheritance**](/docs/collaborate/member-management/permissions-and-inheritance) for a full overview of how permissions cascade throughout content in GitBook.

### Roles in GitBook

Roles are how you define the level of access and control that members have over content (and the organization, in the case of admins).

{% hint style="warning" %}
Regardless of role, every single member of an organization counts toward the total number of members for billing purposes. To learn more about member management, see [inviting and removing members](/docs/collaborate/member-management/invite-members-to-your-organization).
{% endhint %}

Each role gets progressively higher levels of access as you move up the list. Let’s start at the lowest access and work our way up:

<details>

<summary>Guest role</summary>

The guest role is a very specific role in GitBook. Guests are members that have **no default organization role**. A guest acts as a standard user in every other regard, they just need to have their permissions set explicitly at a content level.

Inviting a guest to the organization means that they’ll only ever see content they’ve been directly added to. This is great if you want to add external stakeholders or contractors to your organization, but don’t want to worry about giving them access to any content by default.

{% hint style="warning" %}
Guest members count toward the total number of members in an organization for billing purposes.
{% endhint %}

</details>

<details>

<summary>Reader</summary>

A reader is the most basic role in GitBook: it gives read-only access.

{% hint style="info" %}
Reader seats are paid for organizations on all plans.
{% endhint %}

</details>

<details>

<summary>Commenter</summary>

Commenters have the same read-only access as readers, but they’re also able to leave comments against content and spaces (find out more about how that works in our [comments](/docs/collaborate/comments) documentation).

</details>

<details>

<summary>Editor</summary>

Editors are able to read and comment, just like a commenter, but they’re also able to edit content in a couple of ways. Firstly, for spaces that are **open** for [live edits](/docs/collaborate/live-edits), editors can edit the content directly. Secondly, for spaces that have live edits **locked**, editors can create and submit [change requests](/docs/collaborate/change-requests). Editors cannot merge change requests.

</details>

<details>

<summary>Reviewer</summary>

Reviewers have all the same permissions as an editor however, they can also merge their own and others’ change requests.

</details>

<details>

<summary>Creator</summary>

Creators are essentially content-level admins. They have all the same permissions as a reviewer, however they can also create and delete spaces, collections and sites, merge change requests and manage permissions at a content level.

{% hint style="info" %}
If a creator is also a creator or admin in another GitBook organization, they can [move content between organizations](/docs/create-content/content-structure/space#move-a-space).
{% endhint %}

</details>

<details>

<summary>Admin</summary>

An admin is like a super-user for your organization — they have full access! Set someone as an admin if you’re comfortable with them making changes that can impact billing, managing members, and generally just being in control of all areas of the organization.

{% hint style="info" %}
If an admin is also a creator or admin in another GitBook organization, they can [move content between organizations](/docs/create-content/content-structure/space#move-a-space).
{% endhint %}

</details>

### Roles on a docs site

When roles are applied at the [site level](/docs/collaborate/member-management/permissions-and-inheritance), only **Administrators** can change site settings. All other roles can still contribute to and edit content in the spaces they have access to — they just can't manage the site itself. The table below shows how each role maps to its site permissions.

| Permission level | Permissions on the site |
| ---------------- | ----------------------- |
| Administrator    | Edit and view           |
| Creator          | View                    |
| Reviewer         | View                    |
| Editor           | View                    |
| Commenter        | View                    |
| Reader           | View                    |
| No access        | Cannot view             |

### **Reader role and public docs reader**

The Reader role is an invited organization member with a paid seat. A public docs reader is a site visitor who doesn't need an invitation or a paid seat.

<table><thead><tr><th width="198.80078125"></th><th>Reader role (your organization)</th><th>Public docs reader (site visitor)</th></tr></thead><tbody><tr><td><strong>Invitation required</strong></td><td>Yes</td><td>No</td></tr><tr><td><strong>Paid seat</strong></td><td>Yes</td><td>No</td></tr><tr><td><strong>Content access</strong></td><td>Published and unpublished (with permission)</td><td>Published only</td></tr></tbody></table>


# Teams

Teams are a great way of grouping members within your organization

Teams allow you to manage user access at scale. By creating a specific team, consisting of multiple members, you can grant or remove their access to spaces or collections. Read more about [permissions and inheritance](/docs/collaborate/member-management/permissions-and-inheritance).

### Creating and managing teams

You can create, edit, and remove teams in the **Teams** section of your organization settings.

To find this, click on settings icon in the bottom of your window. Choose organization settings for your desired organization, then click the Teams option in the sidebar.

On this page, you can view and search your current teams, or click one to open the team details page and see more information about it and its members.

### Managing team members

You can manage team members in two ways:

1. Click on a specific member in **Members & permissions** to open their member page, and select the **Teams** tab. Click the vertical ellipsis and you can remove them from the team immediately, or choose **Manage team.**
2. In the **Teams** section, click on the number of members in the list to open the team details page. You can then use multi-select on the member list to select and remove team members or add more with the button at the top.

### Team owners

Team owners (available only in Enterprise plans) allow you to hand over management of a specific team to a selected member. Team owners can add and remove members from the team they are an owner of by clicking on the organization settings, then teams. They will not have access to any other organization settings, including managing other teams.


# Inviting your team

Learn how to invite teammates and other stakeholders to your GitBook organization as members or guests so they can collaborate on your content

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FcuV3FRj8FZLZMvou0FsR%2Fcollaboration-invite-team%402x.png?alt=media&amp;token=7de1cfe8-2d72-4640-995a-7af757ce606f" alt="A GitBook screenshot showing the invite team dialog"><figcaption><p>Invite your team to GitBook to collaborate on pages, spaces, and published sites.</p></figcaption></figure>

{% hint style="warning" %}

### All additional members will be added to your subscription

Inviting additional members to your organization — regardless of their role or how you add them — will immediately impact the price of your subscription. Take a look at our [billing policy](/docs/account-and-billing/plans/billing-policy) for the details.
{% endhint %}

### Invite someone to join your organization via email <a href="#inviting-someone-to-your-organization-via-email" id="inviting-someone-to-your-organization-via-email"></a>

You can directly invite members through your [organization settings](/docs/account-and-billing/organization-settings). In the **Members** section of the **Settings** screen, click **Invite new members**, then add email(s), select their default role, and click **Invite**.

Each member will receive an email that will allow them to sign up to GitBook and instantly join your organization.

{% hint style="info" %}

### Email domain

You can allow all users with a specific email domain to join your organization if you wish. To do this, open your organization’s **Settings** page, choose the **Members** option, click **Invite new members** and enable the toggle at the bottom of the modal.
{% endhint %}

### Invite someone to join your organization via invite link <a href="#creating-and-managing-invite-links" id="creating-and-managing-invite-links"></a>

Invite links in GitBook allow you to maintain a list of links that members can use to sign up and quickly join your organization.

Invite links are tied to specific [roles](/docs/collaborate/member-management/roles), and you can create — and revoke — as many invite links as you like.

Here’s how to create an invite link to your organization:

1. Open your [organization settings](/docs/account-and-billing/organization-settings), then choose the **Members** section.
2. Click **Invite new members**, then click the **Invite by links** button at the bottom of the modal.
3. Use one of the existing links, or click **Create multiple links** to add a new link.
4. Select the [role](/docs/collaborate/member-management/roles) you want for the new user, copy the link, and share it with your new member.

To revoke an invite link, follow the same steps as above, then find the link, open the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt=""></picture> and choose **Revoke**.

## Invite someone to a single space or collection <a href="#sharing-a-space-or-collection" id="sharing-a-space-or-collection"></a>

To share a single [space](/docs/create-content/content-structure/space), click the **Share** button in the top-right corner of the space. To share a [collection](/docs/create-content/content-structure/collection), open its **Actions menu** <picture><source srcset="/files/HXFvPsjDqbaBEhpH0WKJ" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FPnnI41SqLSaKBNwT98fW%2Factions-horizontal.svg?alt=media&amp;token=99754200-a354-4ffe-931e-aa6322ea7395" alt=""></picture> and choose **Permissions**. This will open the **Share** modal.

### Invite a member or team from your organization <a href="#invite-members" id="invite-members"></a>

Some people in your team may not have access to a specific space in your GitBook organization due to their [role](/docs/collaborate/member-management/roles) or specific [permissions settings](/docs/collaborate/member-management/permissions-and-inheritance).

To invite someone who’s already a member of your organization:

1. Open the space or collection’s **Share** modal
2. Type their name, choose their role for this space, and hit **Invite**.

You can also add an entire [team](/docs/collaborate/member-management/teams) by typing the team name and hitting **Invite**.

### Invite someone from outside your organization <a href="#invite-someone-from-outside-your-organization" id="invite-someone-from-outside-your-organization"></a>

To invite someone from outside your organization to a space or collection:

1. Open the space or collection’s **Share** modal
2. Add the person’s email address, choose their role for this collection, and hit **Invite**.

By default, people you add will be a [guest](/docs/collaborate/member-management/roles#guest-role) in the space or collection. Guests only have access to the individual spaces that you invite them to, and can be given a specific [role](/docs/collaborate/member-management/roles) within that space — whether it’s to edit the content, or only view and comment on it.

Alternatively, you can also choose to enable the **Invite as an organization member** toggle, which will give the new member access to all your team’s content with the permissions of the role you’ve selected.

{% hint style="warning" %}

### All additional members will be added to your subscription

Inviting additional members to your organization — either as a full member or a guest — will immediately impact the price of your subscription. Take a look at our [billing policy](/docs/account-and-billing/plans/billing-policy) for the details.
{% endhint %}

### Invite guests via link

If you don’t want to use email to invite someone to your content, or want to invite a number of people as guests quickly, you can create a secret link. You can also set the role of guests that join using the link, so you have control over who can do what to your content.

When you share this link, anyone who clicks on it will be able to sign up, join your organization as a guest, and get access to just this single space and its content.

You can revoke the link at any time by opening the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> next to the link and choosing **Revoke**.


# Guides

Explore guides for collaborating on documentation with your team

Collaborate on content with your team. These guides cover change requests, reviews, comments, and access.

#### Explore

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-code-branch">:code-branch:</i></h4></td><td><h4>How to collaborate on change requests</h4></td><td>Learn how your team can work together using change requests</td><td><a href="/docs/guides/editing-and-publishing-documentation/how-to-collaborate-on-change-requests">How to collaborate on change requests</a></td></tr></tbody></table>

#### Quick guides

<details>

<summary>How do I set up access for my team?</summary>

Choose roles and permissions that let your team collaborate safely.

This guide covers inviting teammates, managing access, and organizing teams.

<button type="button" class="button secondary" data-action="ask" data-query="How do I set up access for my team in GitBook? Show me how to invite teammates, assign roles and permissions, and organize teams. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I create and merge a change request?</summary>

Change requests let you propose and safely publish content updates.

This guide covers creating changes, requesting a review, and merging approved work.

<button type="button" class="button secondary" data-action="ask" data-query="How do I create and merge a change request in GitBook? Show me how to make changes, request a review, and merge approved work. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I review a change request?</summary>

Reviewers can compare edits, give feedback, and approve changes.

This guide covers reviewing diffs, requesting changes, and approving a change request.

<button type="button" class="button secondary" data-action="ask" data-query="How do I review a change request in GitBook? Show me how to compare diffs, leave feedback, request changes, and approve a change request. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>How do I discuss and resolve feedback?</summary>

Comments keep questions and feedback connected to the relevant content.

This guide covers adding comments, mentioning teammates, and resolving threads.

<button type="button" class="button secondary" data-action="ask" data-query="How do I discuss and resolve feedback in GitBook? Show me how to add comments, mention teammates, reply to threads, and resolve comments. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>


# Site settings

Customize and edit settings across your published site

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FtLuT2q1SZk1DTXdXd5Qw%2F26_03_30_site_settings%402x.png?alt=media&amp;token=5993c955-c741-4acf-8ca9-1ce317efca28" alt="A GitBook screenshot showing site settings"><figcaption><p>Update the settings for your published documentation.</p></figcaption></figure>

### General

<details>

<summary>Site title</summary>

Change the name of your site, if you don't have a custom logo this is the name that your site visitors will see.

</details>

<details>

<summary>Analytics cookie</summary>

If you want to use GitBook’s [site analytics](/docs/analytics/insights), your site will use cookies to identify returning visitors and gather the data needed to view your analytics.You can choose to disable these cookies, but it will prevent you from using site analytics.\
\
The cookies notice appears when your site has analytics enabled through an integration, especially **Google Analytics**.

To remove the notice, open **Site settings → Integrations** <i class="fa-puzzle-piece">:puzzle-piece:</i> in the top-right. Then disable or remove **Google Analytics**

Disabling these cookies also turns off [site analytics](/docs/analytics/insights) for that site.

</details>

<details>

<summary>Unpublish site</summary>

Unpublish your site, but keep its settings and customizations. You can publish your site again at any time.

</details>

<details>

<summary>Delete site</summary>

Unpublish and remove your site from the **Docs site** section in the GitBook app.

**Note:** Deleting a site is a permanent action and cannot be undone. Any settings and customizations will be lost, but your content will remain in its [space](/docs/create-content/content-structure/space).

</details>

<details>

<summary>Access</summary>

Manage who can access and administer your docs site.

Open **Access** and click **Manage permissions**. You can also use **Share** from the site’s **Overview** page.

Site permissions are available on all plans.

By default, new sites derive permissions from their linked [spaces](/docs/create-content/content-structure/space), until you update permissions from the site permissions modal.

Site permissions can also affect the permissions of linked spaces that use **Inherited** mode. In this case, each inherited space receives the highest permission level granted by the organization, any parent collection, and any site that includes it.

</details>

### Agents

{% content-ref url="/pages/QEdtUjQ47A0aK7o8HIzN" %}
[Overview](/docs/gitbook-agent/overview)
{% endcontent-ref %}

### Styleguide

Create, reuse, or detach the styleguide that defines your team's writing rules and keeps GitBook Agent consistent.

{% content-ref url="/pages/ZVg6bZguPovk1woIsVdk" %}
[Style guide](/docs/create-content/styleguide)
{% endcontent-ref %}

### Audience

<details>

<summary>Audience</summary>

Choose who sees your published content. See [Publish a docs site](/docs/publish/publish-a-docs-site) for more info.

</details>

<details>

<summary>Adaptive content <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture></summary>

Turn on adaptive content for your site pages, variants, and sections. [Adaptive content](/docs/publish/adaptive-content) lets you hide or show content for different visitors, depending on their permissions.

Your visitor token signing key will also be displayed here.

</details>

### Domain and URL

<details>

<summary>Custom domain</summary>

Configure a custom domain to unify your site with your own branding. See [Set a custom domain](/docs/publish/custom-domain) for more info.

</details>

<details>

<summary>GitBook Subdirectory</summary>

Publish your content on a subdirectory (e.g. `yourcompany.com/docs`). Learn more in [Setting a custom subdirectory](/docs/publish/custom-domain/setting-a-custom-subdirectory).

</details>

### Redirects

{% content-ref url="/pages/rcmnyzKOgcYE9OgyZD2Y" %}
[Site redirects](/docs/publish/site-redirects)
{% endcontent-ref %}

### Features

<details>

<summary>PDF export <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture></summary>

Let your visitors to export your GitBook as PDF. See [PDF export](/docs/publish/pdf-export) for more info.

</details>

<details>

<summary>Page ratings <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture></summary>

Choose whether or not visitors to your published content can leave a rating on each page to let you know how they feel about it. They’ll be able to choose a sad, neutral, or happy face.

You can review the results of these ratings by opening [site analytics](/docs/analytics/insights) from your docs site dashboard and selecting **Pages & feedback**.

</details>

### AI & MCP

AI settings are available on different plans. The search box placement is available on Premium and Ultimate site plans. The sidebar placement and MCP connectors are available on Ultimate.

<details>

<summary>AI Assistant <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture></summary>

Turn AI Assistant on or off for your site. See [AI Assistant](/docs/ai-for-your-readers/gitbook-ai-assistant) for more info.

</details>

<details>

<summary>Appearance <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture></summary>

Choose where the Assistant appears using **Placement** — **Sidebar** for the full chat experience, available on Ultimate site plans, or **Search box** to answer questions in your site’s search bar, available on Premium and Ultimate site plans. You can also set the Assistant greeting here, which applies to the sidebar placement only. See [AI Assistant](/docs/ai-for-your-readers/gitbook-ai-assistant) for more info.

</details>

<details>

<summary>Extend GitBook Assistant with MCP connectors <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture></summary>

Configure MCP servers that GitBook Assistant can use when answering questions inside your docs. This setting is available on Ultimate site plans. See [MCP servers for published docs](/docs/ai-for-your-readers/mcp-servers-for-published-docs) for more info.

</details>

### Connections

{% content-ref url="/pages/p6K5x8aCszGQ0xYf96Z2" %}
[Connections](/docs/ai-for-your-readers/connections)
{% endcontent-ref %}

### Structure

{% content-ref url="/pages/1XRw1GP3RDSWHxEE1tQb" %}
[Site structure](/docs/manage-your-site/site-structure)
{% endcontent-ref %}

### Plan

{% content-ref url="/pages/yshuePqcxELaw0iNFK7a" %}
[Plans](/docs/account-and-billing/plans)
{% endcontent-ref %}


# Site structure

Organize your published documentation with sections, variants, and external links

The content on your site lives in its [sections](/docs/create-content/content-structure/space). You can add one or multiple sections. GitBook will publish each one and handle the navigation between them.

## Content types

Content in your site can serve as one of two different content types, which determine how GitBook treats it and shows it to visitors.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-type="image">Cover image (dark)</th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden><select></select></th><th data-hidden data-card-cover-dark data-type="image">Cover image (dark)</th></tr></thead><tbody><tr><td><strong>Sections</strong></td><td>Split your site into distinct parts — ideal for multiple products or parts of your organization.</td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FVdIazRjl18hxN5SzpiqR%2FSite%20sections.svg?alt=media&amp;token=2e1d4bae-4a54-4daa-96f8-b248203c6d6b">25_08_29_site_sections.svg</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FGzx9x7fzQtLb7ewwm3T2%2FSite%20sections.png?alt=media&amp;token=fdc90c1d-6dee-48d9-93d6-a72bb8438cc2">25_12_10_site_sections_1.png</a></td><td><a href="/docs/manage-your-site/site-structure/site-sections">Sections</a></td><td></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FB96TQMaauF0yst75RsML%2FSite%20sections.png?alt=media&amp;token=64f5801b-c97b-4df0-8a6e-97da7d04880d">25_12_10_site_sections.png</a></td></tr><tr><td><strong>Content variants</strong></td><td>Publish multiple versions of the same content — ideal for localization, versioning, and more.</td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FuWpHiQp4LvA5wpM5Ovo8%2FContent%20variants.svg?alt=media&amp;token=4b02400b-8994-4319-952d-db5e97661f02">25_08_29_content_variants.svg</a></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FDmZINE2qLnmlv30oMxUg%2FContent%20variants.png?alt=media&amp;token=69243fd5-6aa3-44c9-a5f1-e444ad2bac86">25_12_10_content_variants_1.png</a></td><td><a href="/docs/manage-your-site/site-structure/variants">Content variants</a></td><td></td><td><a href="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FUbgdVlll8ekhPqtj3V3z%2FContent%20variants.png?alt=media&amp;token=f696c0df-94de-45ba-8ee7-f72c0c8f8fdf">25_12_10_content_variants.png</a></td></tr></tbody></table>

## Managing your site structure

By managing the structure of your site, you can also manage your site’s top navigation bar. This navigation bar lets visitors open sections, groups, and external links.

Open the structure editor from **Site structure**, under **General** in the site sidebar. Here you can see your site's sections, variants, and external links.

Your site starts out with a single section with your site's name and a single variant with the content you created during your site's set-up.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FD4oCABc0YRJAFzaaVBpn%2Fstructure%402x.png?alt=media&amp;token=4c4dd0df-8e8e-40e7-8a57-e9791d337c8f" alt="A GitBook screenshot showing a docs site&#x27;s structure"><figcaption><p>The structure of a published docs site.</p></figcaption></figure>

### Adding a section to your docs site

To add a [section](/docs/manage-your-site/site-structure/site-sections), click the **Add section** button underneath the table and choose the content to add. The new section is then added to the table and will be available to visitors as a tab at the top of your site.

To add a [variant](/docs/manage-your-site/site-structure/variants), click the **Add variant** button in the section you’d like to add to, then choose the content to add. The new variant is then added to the list of variants within the chosen section and will be available to visitors in the variant dropdown on your site.

When you add content — as a variant or a section — a name and slug will be generated based on its title.

### Adding an external link

External links add destinations outside your site to its navigation. Add a link as its own navigation item, or place it in a section group with related sections.

To add an external link:

1. In the site sidebar, open **Site structure**.
2. In the add menu, select **External link**.
3. Enter the link label and destination URL.
4. Choose whether to add the link separately or to a section group.
5. Click **Save**.

The link appears in your published site's navigation at the position you choose.

### Changing sections or variants

<div data-full-width="false"><figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FoXvDCD0U1CNnP8pJHL1L%2Fedit_variant%402x.png?alt=media&amp;token=fcea8367-71dd-441c-9f10-37171ab7f450" alt="A GitBook screenshot showing how to edit a variant"><figcaption><p>Update a site section or variant.</p></figcaption></figure></div>

You can change the name and slug of each of your sections and variants by clicking the **Edit** <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt="The Edit icon in GitBook"></picture> button in the table row of the item you’d like to edit. This will open a modal. Edit the field(s) you’d like to change, then click the **Save** button to save.

{% hint style="info" %}
Changing a section's slug will change its canonical URL. GitBook will create an automatic redirect from the old URL to the new one. You can also [manually create redirects](/docs/publish/site-redirects).
{% endhint %}

{% hint style="info" %}
Slugs are unique across your entire organization — each path can only be used on one site, even across different sites. If you see a "path is already taken" error, another site is already using that slug. Choose a slightly varied slug that's still meaningful for your content.
{% endhint %}

To replace a section or variant, first delete it by clicking its **Edit** <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt="The Edit icon in GitBook"></picture> button, then click the **Delete** button in the lower left of the modal. Once the item is deleted, click the **Add section** or **Add variant** button to add it again.

### Reordering sections or variants

Your site displays sections and variants in the order that they appear in your **Site structure** table. They can be reordered by grabbing the **Drag handle** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> and moving it up or down. The changed order will be reflected on your site immediately.

You can also use the keyboard to select and move content. Select a section or variant with the space bar, then use the arrow keys to move it up or down. Hit the space bar again to confirm the new position.

### Setting default content

If you have multiple sections in your site, one section will be marked as **Default**. This section is shown when visitors arrive on your site, and is served from your site’s root URL. Other sections each have a slug that is appended to the root URL.

If you have multiple variants within a section, one variant will be marked as the default. Like sections, the default variant is shown when visitors arrive on your site, or when they visit a section. Other variants each have a slug that’s appended to the section’s URL.

To set a section or variant as default, click on the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> in its table row and then click **Set as default**.

{% hint style="info" %}
Setting content as default removes its slug field, as it will be served from the section root instead. GitBook redirects the old slug to the appropriate path, to ensure visitors keep seeing your content.
{% endhint %}

### Remove content from a site

To remove a section or variant from a site, open the structure editor from **Site structure**, under **General** in the site sidebar, and find the content you want to remove.

Open the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> for the content you want to remove and choose **Remove**.

{% hint style="success" %}
Removing content from your site will remove it from the published site, but **will not delete the content itself** — you can still find it in [All content](/docs/create-content/content-structure/all-content).
{% endhint %}

If you delete a section's content entirely, the site — along with its settings and customizations — remains available. Deleted content stays in the **Trash** for seven days before it's permanently removed. If the deleted section was your site's default, check that the default is still set correctly.


# Sections

Organize separate products, audiences, or topics in one published site.

{% hint style="info" %}
This feature is available on the Ultimate site plan.
{% endhint %}

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FAfqBhbHbvEllbHg6s9I0%2Fsite_sections%402x.png?alt=media&amp;token=40811255-7158-49fb-9938-7ebb878b5296" alt="A GitBook screenshot showing sections on a docs site"><figcaption><p>Example of a GitBook site with sections</p></figcaption></figure>

Sections let you centralize your documentation in one site. Use them to organize separate products. You can also serve different audiences with tailored content.

Group sections to create a dropdown in your navigation bar. Groups add hierarchy to your site.

### Sections or variants?

Each section holds its own content. Use sections for distinct documentation areas. These can represent products, audiences, or topics.

For variations of the same content, use [content variants](/docs/manage-your-site/site-structure/variants). Variations include localizations and historical product versions.

### Add a section

To add a section:

1. In the site sidebar, open **Site structure**.
2. Below the table, click **New section**.
3. Select the content to add.

The section appears in the table. It also appears as a tab on your published site.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FF2eMGMOFBOtjgd2ELMXE%2Fstructure%20tree%402x.png?alt=media&amp;token=83fe9dd0-bbfd-42a7-954c-52d895eae78a" alt="A GitBook screenshot showing site section structure"><figcaption><p>Add structure to your docs with sections.</p></figcaption></figure>

### Create a section group

Section groups create a navigation dropdown under one heading. Grouped sections can have an optional description. The description appears below the section title.

To create a group:

1. Next to **New section**, click the arrow.
2. Select **New section group**.
3. Enter a group name.
4. Click **Add section**.
5. Add existing sections or select new content.

If your site supports multiple languages, translate group titles, section titles, and descriptions. See [Multilingual sections](/docs/manage-your-site/site-structure/multilingual-sections).

### Edit a section

To edit a section:

1. In the section’s table row, click **Edit**.
2. Change the name, icon, or slug.
3. Click **Save**.

To delete a section, click **Delete** in the lower-left corner.

{% hint style="info" %}
Changing a section’s slug changes its canonical URL. GitBook creates a redirect from the old URL. You can also [create redirects manually](/docs/publish/site-redirects).
{% endhint %}

### Hide a section

**Show in site navigation** controls whether a section appears in your site’s top navigation. Hiding a section removes it from published navigation. It doesn’t delete the section or its content.

To hide a section:

1. In the site sidebar, open **Site structure**.
2. In the section’s table row, click **Edit**.
3. Turn off **Show in site navigation**.
4. Click **Save**.

This setting controls section visibility. It differs from **Hide page**, which hides a page from a section’s table of contents. Visitors won’t see hidden sections in published site navigation.

### Reorder sections

Sections appear in the same order as the **Site structure** table. To reorder a section, drag its drag handle up or down. The section’s content moves with it. The new order appears on your site immediately.

To use a keyboard:

1. Press **Space** to select a section.
2. Press an arrow key to move the section.
3. Press **Space** to confirm.

### Set the home section

The home section appears when visitors open your site. It loads at your site’s root URL. Other sections add a slug to the root URL.

To set the home section:

1. In the section’s table row, open the **Actions** menu.
2. Click **Set as home**.

### Set the home variant

If a section has multiple variants, choose which variant visitors open first.

To set the home variant:

1. Open **Site settings**.
2. Click **Structure**.
3. Click the section to update.
4. Find the variant visitors open first.
5. Click **Set as home**.

### Remove a section

To remove a section:

1. In the site sidebar, open **Site structure**.
2. Open the section’s **Actions** menu.
3. Click **Remove**.

{% hint style="success" %}
Removing a section unpublishes it and its variants. It doesn’t delete the content. You can still find it in [All content](/docs/create-content/content-structure/all-content).
{% endhint %}


# Content variants

Publish documentation for multiple product versions or languages in a single site

You can publish multiple versions of the same documentation as part of a single docs site. These variants will be available to the end users via the variant picker at the top of the table of contents on the published site.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F2cQxJ5sTMVUkXOcuDEU8%2FAdding%20a%20section%402x.png?alt=media&amp;token=2bd96c5f-0945-4d86-a835-a94102e627d9" alt="A GitBook screenshot showing a docs site&#x27;s structure"><figcaption></figcaption></figure>

### Add multiple languages or versions

A site with multiple variants is useful if you need to keep variations of your content together — such as if you’re documenting multiple versions of an API (v1, v2, v3, etc.), or documenting your content in different languages.

{% hint style="info" %}
Variants can contain any content, but it’s recommended to use them as *variations of the same content*. If your content is semantically different, consider adding it as [sections](/docs/manage-your-site/site-structure/site-sections) instead.
{% endhint %}

When adding a translation or multiple languages as a variant, it’s best practice to set the language of your variant to give your users the best experience when navigating your docs.

Adding multiple variants with languages set will move the language picker to the upper right, giving a cleaner, more direct experience from the default variant picker.

### Adding a variant to your docs site

Open the structure editor from **Site structure**, under **General** in the site sidebar. Here you can see all the content of your site.

To add a variant, click the **Add variant** button in the section you'd like to add to, then choose the content to add. The new variant is then added to the list of variants within the chosen section and will be available to visitors in the variant dropdown on your site.

### Changing a variant

You can change the name and slug of each of your variants by clicking the <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt="The Edit icon in GitBook"></picture> **Edit** button in the table row of the variant you’d like to edit. This will open a modal. Edit the field(s) you'd like to change, then click the **Save** button to save. You can also delete the variant by clicking the **Delete variant** button in the lower left.

If your site supports multiple languages, you can also translate variant titles so the picker shows localized labels. See [Multilingual sections](/docs/manage-your-site/site-structure/multilingual-sections).

{% hint style="info" %}
Changing a variant's slug will change its canonical URL. GitBook will create an automatic redirect from the old URL to the new one. You can also [manually create redirects](/docs/publish/site-redirects).
{% endhint %}

To replace a variant’s content, first delete it by clicking its **Edit** <picture><source srcset="/files/kN09oTFtAuyaxNIwWuCt" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FA3OfGjPkE5GnOQvN36jN%2Fedit.svg?alt=media&amp;token=6f70239f-d889-4e64-9ec6-4801df47a48d" alt="The Edit icon in GitBook"></picture> button, then click the **Delete** button in the lower left of the modal. Once the variant is deleted, click the **Add variant** button to add the new content.

### Reordering variants

Your site displays variants in the order that they appear in your **Site structure** table. Variants can be reordered by grabbing the **Drag handle** <picture><source srcset="/files/QLUQj6waZRiK6FpSqrt6" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FaS1QvPIBVYwhpFTGcPBN%2Foptions-menu.svg?alt=media&amp;token=3ee40bbf-f4fb-41fa-aa30-306b559cbe88" alt="The Options menu icon in GitBook"></picture> and moving it up or down. The changed order will be reflected on your site immediately.

You can also use the keyboard to select and move content: select a section or variant with the space bar, then use the arrow keys to move it up or down. Hit the space bar again to confirm the new position.

### Setting a default variant

If you have multiple variants within a section, one variant will be marked as the default. This variant is shown when visitors arrive on your site (or when they visit a section). Other variants each have a slug that is appended to the site's URL.

To set a variant as default, click on the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> in the variant’s table row and then click **Set as default**.

{% hint style="info" %}
Setting a variant as default removes its slug field, as it will be served from the section root instead. GitBook will redirect the variant's slug to the appropriate path, to ensure visitors keep seeing your content.
{% endhint %}

### Remove a variant from a site

To remove a variant from a site, open the structure editor from **Site structure**, under **General** in the site sidebar, and find the content you want to remove.

Open the **Actions menu** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F89MTSo5XRpPMVr1T0rxS%2Factions.svg?alt=media&amp;token=2b5d001e-560a-4f29-8d22-de8163725ca1" alt="The Actions menu icon in GitBook"></picture> for the variant you want to remove and choose **Remove**.

{% hint style="success" %}
Removing a variant from your site will remove it from the published site, but **will not delete the content itself** — you can still find it in [All content](/docs/create-content/content-structure/all-content).
{% endhint %}


# Multilingual sections

Set localized titles for your site, sections, section groups, and navigation

Localized titles let you show different titles for different languages on your published site.

Visitors see the title that matches the language they’re browsing in. If a translation isn’t set, GitBook shows the fallback title instead.

Use `localizedTitle` for header links and buttons, footer links, and footer groups. See [Layout and structure](/docs/manage-your-site/customization/layout-and-structure).

{% hint style="info" %}
Localized titles only appear when your site includes content in more than one language.
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FlEY5s6qXpEy6k1ivmeL6%2Flocalized.mp4?alt=media&token=d8221dc1-54e1-401b-8699-3acd65343fc3>" %}

### Set up localized titles

{% stepper %}
{% step %}

#### Open the structure editor

From your docs site, open **Site structure**, under **General** in the site sidebar.
{% endstep %}

{% step %}

#### Find the title you want to translate

Open the title field for your site, a section, or a section group.
{% endstep %}

{% step %}

#### Set the fallback title

By default, the fallback title is set to the current section name.
{% endstep %}

{% step %}

#### Add each translated title

Open the language selector again and choose a language.

Enter the title for that language, then repeat for each language you support.
{% endstep %}
{% endstepper %}


# Site customization

Create branded documentation with a custom logo, fonts, colors, links and more

You can customize the appearance of your published documentation, match the user interface to the language of your content, and more.

You can apply customizations to your entire docs site as a site-wide theme, or to individual variants and site sections.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FPHDUX2Kbmd9wwUBpJqst%2Fcustomization-demo.png?alt=media&amp;token=7586ba34-9cd2-47ee-9169-81b73dd40923" alt="A GitBook screenshot showing a customized docs site"><figcaption><p>You can create all kinds of site designs using GitBook’s built-in customization options.</p></figcaption></figure>

### Customizing sites with multiple sections or variants

If you have a docs site with with multiple sections or variants, you can control the customization of each one individually.

Select the whole site or a specific site section using the drop-down menu at the top of the **Customization** panel.

* **Site-wide settings** – These automatically apply to all sections.
* **Section or variant specific settings** – If you’re using site sections or variants, you’re can set specific customization that will override the default site-wise setting.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FlHCK9XPr7eIuB3XJup6N%2Fcustomization%402x.png?alt=media&amp;token=b43a01ce-829d-4d0d-9cfa-40f0d45c162b" alt="A GitBook screenshot showing the customization panel"><figcaption><p>The customization panel in GitBook.</p></figcaption></figure>

{% hint style="warning" %}
Changes you make to specific site sections will override the site-wide customization settings, even if you change the site-wide setting again later.

You can reset customization overrides back to the site-wide default by clicking the **Reset** button <picture><source srcset="/files/pqrwkdhGuOQlk1cWXLgI" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FvKatj53oH4WPjv9G2pe5%2Freset_icon_light.svg?alt=media&amp;token=e5632add-8f96-498f-87bc-a459aecf7d95" alt="The Reset icon in GitBook"></picture> next to the section selector.
{% endhint %}

### What counts as ‘Advanced customization’?

Every GitBook user can take advantage of basic customization options on their docs site. Premium or Ultimate site plan users can also use advanced customization features to further tweak their docs to match their brand.

Advanced customization options include:

* **Custom logo** – Add a logo that replaces the emoji and title at the top of your docs site.
* **Icon style** - Change the weight and style of page icons in your docs site.
* **Custom fonts** – Change the primary font and monospace of your docs site.
* **Footer** – Add a custom logo, copyright text and navigation to a footer at the bottom of your documentation.
* **Bold and Gradient themes** – Change the background color for your header, or add a gradient background to your entire site with these new themes.
* **Semantic colors** – Change the background color of hint blocks and the styling of code blocks within your published content.
* **Code themes** – Change the appearance of code and API blocks in your published documentation using either preset themes or adaptive themes that use your site's colors.

### What cannot be customized?

The options above provide lots of ways for you to customize your site, but there are a few things that you won’t be able to customize, regardless of [your chosen plan](/docs/account-and-billing/plans).

1. It’s not possible to customize the layout of the elements on the page (However, it *is* possible to [hide certain elements on specific pages](/docs/create-content/content-structure/page)).
2. It’s not possible to insert custom code (such as CSS, HTML or JS) directly into your GitBook site. We already integrate with a number of popular tools, and offer [rich embeds](/docs/create-content/blocks/embed-a-url) for many more.
3. It’s not possible to remove the small “Powered by GitBook” link that appears in published documentation.


# Icons, colors, and themes

Customize icons, colors, themes and more granular settings across your published documentation

## Title, icon and logo

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FBYTJub4AuG2iJDCS31vp%2Ftitle_icon_logo%402x.png?alt=media&#x26;token=2e3fd867-a480-40da-919b-d5c1e6225317" alt="A GitBook screenshot showing title, icon and logo customization"><figcaption></figcaption></figure>

### Title

You can set any title you choose for your site. Note: this setting will only affect the title that displays *in the published documentation*. If you want to edit the title in the GitBook app, close the customize menu and edit it at the top of the section.

### Icon

You can set an emoji, or upload an icon of your own. The icon you set in the **Customize** menu will be used as the favicon for your docs site. Changes can take a few minutes to appear on your published docs — if you don't see the new favicon, your browser may have cached the old one, so try a different browser.

{% hint style="info" %}
This setting will only affect the icon that displays *in the published documentation*. If you want to edit the icon used within the GitBook app, you can do so when editing content in the section itself.
{% endhint %}

### Custom logo <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture>

You can replace *both* the published site’s title and icon with a custom logo so that your documentation better reflects your own branding — and you can upload two versions: one for light mode, and one for dark mode.

{% hint style="info" %}
**What’s the difference between the icon and logo options?**

The icon setting lets you upload a small, 132×132 px image, which will appear *alongside* your site title and function as your site’s favicon. The custom logo option lets you upload a larger image (we recommend at least 600 px wide), which will completely replace any icon and title you’ve set.
{% endhint %}

## Themes

Themes let you customize the color scheme of your published content for both light and dark mode. There are four themes to choose from. The colors of your site will be directly impacted by the **primary color** and **tint** that you choose. These two selections affect various parts of the interface and can completely change the look and feel of your site.

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FtFNAAIZeXh1JKtnWepYZ%2Ftheme%402x.png?alt=media&#x26;token=d8d191df-5ed8-44b1-886a-bd9344add841" alt="A GitBook screenshot showing theme options"><figcaption></figcaption></figure>

### Clean

A modern theme featuring translucency and minimally styled elements. Your primary color (or tint) affects links and other highlighted interface elements.

*Clean is available for all sites and is the default theme.*

### Muted

A sophisticated theme with decreased contrast between elements. The site background is more pronounced and blends in with the foreground, and some elements feature an inverted look — all based on your primary color (or tint).

*Muted is available for all sites.*

### Bold <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture>

A high‑impact theme with prominent colors and strong contrasts. Your primary color (or tint) will be used for the header of the site, and other highlighted elements like icons are colored along with it.

*Bold is only available for Premium or Ultimate sites.*

### Gradient <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture>

A trendsetting theme featuring a gradient background and splashes of color. The gradient and highlighted elements will be colored by your primary color (or tint).

*Gradient is only available for Premium or Ultimate sites.*

## Colors

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FkfBttkCRhIqoNFZGXkX4%2Fcolors%402x.png?alt=media&#x26;token=2ddbf1b0-7893-4fc2-a849-f92656b3151f" alt="A GitBook screenshot showing color customization"><figcaption></figcaption></figure>

### Primary color

Your site’s primary color will affect the styling of highlighted interface items and navigational elements like links, the current page and section, breadcrumbs, and primary header buttons.

GitBook automatically adjusts colors on individual elements for readability if the contrast with the background is too low or when a visitor’s system requests higher contrast.

### Tint color

Your site’s tint color will subtly change the color of all text and icons across your entire site — including header links, icon color, and UI elements like the **Ask or search** bar.

The tint color will *not* affect navigational elements like links and buttons, which always use the primary color.

In the **Tint color** section you’ll see suggested colors based on your primary color selection. You can select one to preview it, choose your primary color as your tint, or pick a completely custom color with the color picker.

<details>

<summary>Using tint to set your background color</summary>

If you pick a tint that’s very light (close to white) or very dark (close to black), and that color is close to a neutral shade, GitBook uses it as the exact background color of your site instead of the default white or dark background. This lets you give your docs a subtle off-white or warm-paper feel in light mode, or a specific deep-dark backdrop in dark mode, just by choosing the right tint.

{% hint style="info" %}
A couple of things to keep in mind:

* The tint needs to be close to neutral (only lightly colored). A strongly colored tint keeps GitBook’s standard background and only tints the accents.
* It needs to be clearly light or clearly dark. A mid-tone gray won’t change the background.
* With the **Bold** theme, the tint styles the header rather than the page background, so the background stays as it is.
  {% endhint %}

</details>

### Semantic colors <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture>

Semantic colors are applied to hint blocks within your published content, and can also be applied to code blocks.

You can change the background color of each hint style; these changes will be reflected on the published site you’re customizing.

{% hint style="info" %}
**Note:** Hint blocks in the GitBook editor will always remain in their standard colors and will not match your site’s semantic colors.
{% endhint %}

### Code theme <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture>

Code themes change the appearance of code and API blocks in your published documentation.

The themes list includes:

* **Adaptive themes** – These standard light and dark mode themes use your site’s color palette to match your brand.
* [**Shiki**](https://shiki.style/themes) **themes** – Choose from more than 60 theme presets in both light and dark modes.

You can choose individual code themes for your docs’ light and dark mode. And you can use any light or dark color scheme in any mode — e.g. a dark code theme when your docs are in light mode.

By default, your chosen theme will apply to both code blocks and OpenAPI blocks. If you want to set a different theme for OpenAPI blocks, click the **Customize per block type** <picture><source srcset="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2F6uYUpJto7WTkJf9BUPHv%2Fsettings%20-%20dark.svg?alt=media&#x26;token=bf52415f-e999-43a2-9a1a-c85176a014cd" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FwkBqgOPry9HAcW4cxJk0%2Fsettings.svg?alt=media&#x26;token=67bdbb00-ebf3-4a2d-9df8-0c822406f71c" alt=""></picture> button.

## Modes

### Show mode toggle

Enable this if you want visitors to manually toggle between light and dark mode. Readers can find the toggle at the bottom of any published page, on both desktop and mobile.

### Default mode

Choose whether visitors see your content in light or dark mode by default. If **Show mode toggle** is enabled, they can switch modes; if disabled, they’ll only see the mode you choose here.

*Note: to change the theme within the GitBook app, go to your Settings menu at the bottom of the sidebar.*

## Site styles

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FB8hReiw1xjsXedx7kM2J%2FSite%20styles%402x.png?alt=media&#x26;token=99b1f18b-d1f3-42e4-b11f-4b7bee1c4ceb" alt="A GitBook screenshot showing site style settings"><figcaption></figcaption></figure>

### Font family <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture>

Choose a standard and monospace font family for your published content from a curated list of popular options.

#### Main font

This is the font that will, by default, be used across your entire site. It will always be used for body copy and UI copy on your site.

#### Headings

The headings font is optional and will only apply to Page, H1, H2, and H3 headings on your site. By default the heading font is set to match the main font on your site.

#### Monospace

Monospace fonts are used in code blocks and OpenAPI blocks on your docs site.

### Custom fonts <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture>

Upload your own standard and monospace fonts to align your published content with your brand’s style guide. To upload a font, click **Add custom font** and follow the instructions. You must upload a font file for both regular and bold weights.

GitBook currently supports `.woff` and `.woff2`. For other formats, please contact <support@gitbook.com>.

### Icons <picture><source srcset="/files/8pdGCn8TI6WIcFGsPNFh" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FqIwkYVR0zglkt0uchq3b%2FPremium%20Badge%20Light.png?alt=media&amp;token=fac71df7-6fdc-4bfc-a97c-174b60480c56" alt=""></picture> <picture><source srcset="/files/iRBqMn8OAyswwIZUIKbS" media="(prefers-color-scheme: dark)"><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FQwF4B36BprLKQ98G1vS8%2FUltimate%20Badge%20Light.png?alt=media&amp;token=7e677b59-1a60-47b1-9440-4c21367dedc5" alt=""></picture>

When using page icons, set the weight and style of the displayed icons here.

This setting controls the weight and style of page icons on your published site. It doesn't define page-group icons or inline icons. Set page-group icons in the section table of contents. Add inline icons in [Inline content](/docs/create-content/formatting/inline).

### Corner style

Choose either rounded or straight corners to match your brand’s style preferences.

### Depth style

Choose between two depth styles, which apply to cards, buttons and any other element with a shadow:

* **Subtle:** Some shadows and elevation.
* **Flat:** No shadows or elevation.

### Link style

Choose between two link designs:

* **Default:** highlights the entire link in your primary or tint color.
* **Accent:** adds a colored underline to the link, leaving the text color unchanged.

## Sidebar styles

<figure><img src="https://1050631731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FjAXB2lbCWFVFhHTDmY3s%2Fsidebar_styles%402x.png?alt=media&#x26;token=c922b2e7-04de-4140-97e0-802375f9c92f" alt="A GitBook screenshot showing sidebar style options"><figcaption><p>This menu gives you a visual idea of how the different styles will change the look of your sidebar.</p></figcaption></figure>

### Background style

Choose the background style for the sidebar container. The color is derived from your selected theme.

There are two options — **Default** and **Filled** — each with a visual representation of how they’ll change your table of contents.

### List style

Choose the style for the sidebar list and its selected items. There are three options — **Default**, **Pill** and **Line** — each with a visual representation showing how they’ll change your table of contents.




---

[Next Page](/docs/llms-full.txt/1)

