> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/getting-started/quickstart.md).

# 快速开始

在 GitBook 中快速上手，并在几分钟内发布你的第一个文档站点

本快速入门指南将说明如何在 GitBook 中完成设置，并在几分钟内发布你的第一个文档站点。

在本指南结束时，你将拥有一个可访问的文档站点，并可随时扩展和自定义。

{% stepper %}
{% step %}

#### 使用编码代理进行设置

如果你是编码代理，请遵循 [设置 GitBook](https://gitbook.com/docs/documentation/zh/setup.md)。其中介绍了如何连接 GitBook、需要你协助的人员完成的步骤，以及如何发布网站。

要将设置工作交给你的智能体，请将此提示粘贴到其中：&#x20;

{% prompt description="Set up GitBook" %}

```markdown
请按照 https://gitbook.com/docs/setup.md 为我设置 GitBook。
```

{% endprompt %}

如果你正在使用 GitBook 应用按照本指南操作，请继续下一步。
{% endstep %}

{% step %}

#### 创建你的账户

[创建账户](https://app.gitbook.com/join) 即可开始创建你的第一个文档站点。
{% endstep %}

{% step %}

#### 创建你的第一个站点

1. 在你的组织中 **主页**，点击侧边栏中 **+** 旁边的 **站点** 。
2. 为你的站点起一个访客一眼就能认出的名称。
3. 点击 **创建**.
   {% endstep %}

{% step %}

#### 选择你想要的开始方式

GitBook 欢迎你来到新站点，并询问你希望如何开始。

<table><thead><tr><th width="200">起点</th><th>最适合</th></tr></thead><tbody><tr><td><strong>文档模板</strong></td><td>从带有占位章节的现成文档布局开始——这是快速看到完整站点运行效果的最快方式。</td></tr><tr><td><strong>导入</strong></td><td>将现有内容从在线文档、Markdown 或 HTML 中导入。</td></tr><tr><td><strong>OpenAPI</strong></td><td>从 OpenAPI 规范生成交互式 API 参考文档。</td></tr><tr><td><strong>空白</strong></td><td>从一个空白章节开始，从零构建。</td></tr><tr><td><strong>与 Git 同步</strong></td><td>将你的文档与 GitHub 或 GitLab 仓库保持同步。</td></tr></tbody></table>

或者，如果你已经在 GitBook 中有一些工作内容，也可以从你组织的现有内容中进行选择。

本指南采用模板路径：

1. 点击 **文档模板** 并查看预览。
2. 点击 **使用文档模板** 以应用该模板。
   {% endstep %}

{% step %}

#### 探索你的新站点

你的站点默认处于未发布状态，因此你可以在上线前编辑、自定义并预览所有内容。侧边栏显示：

<table><thead><tr><th width="160">侧边栏区域</th><th>你会找到什么</th></tr></thead><tbody><tr><td><strong>站点页眉</strong></td><td>你的站点名称、发布状态，以及 <strong>预览</strong> 和 <strong>发布</strong> 按钮。</td></tr><tr><td><strong>常规</strong></td><td><strong>概览</strong>, <strong>变更请求</strong>, <strong>站点结构</strong>和 <strong>设置</strong>.</td></tr><tr><td><strong>工具</strong></td><td><strong>样式指南</strong>, <strong>自定义</strong>, <strong>分析</strong>和 <strong>扩展</strong>.</td></tr><tr><td><strong>内容</strong></td><td>这些是您网站的版块——对于 Docs 模板，包括：首页、文档、API 参考、更新日志和帮助中心。使用 <strong>内容</strong> 标题中的图标来查找、重命名和添加版块。</td></tr></tbody></table>

{% hint style="success" %}
你的内容尚未发布，因此你可以在正式上线前编辑、自定义并预览文档站点。点击 **发布** 即可立即上线。

<i class="fa-arrow-down">:arrow-down:</i> [跳转到本页中的“发布你的文档”步骤](#publish-your-documentation)
{% endhint %}
{% endstep %}

{% step %}

#### 编辑你的内容

文档模板会在侧边栏的 **内容** 部分中提供一些占位内容。点击任意部分即可打开并查看其中的占位内容。

在 GitBook 中编辑和更新内容有两种方式：使用可视化编辑器，或采用文档即代码工作流。 **你可以任选其一，也可以结合使用。** 无论你选择哪种工作流，都可以通过 **基于分支的编辑流程**来编辑内容。了解更多信息，请访问 [“概念”页面](https://gitbook.com/docs/documentation/zh/can-kao/concepts.md).

{% tabs %}
{% tab title="可视化编辑器" icon="hand-pointer" %}
GitBook 的所见即所得（WYSIWYG）编辑器让你可以直观地编辑内容、拖动内容块重新排序，并在工作时实时查看内容效果。如果你不想使用代码编辑器，或者你已经习惯 Notion 或 Google 文档之类的工具，它会非常适合你。

**在变更请求中编辑你的文档**

1. 在侧边栏的 **内容** 部分中，点击某个分区（例如“文档”）将其展开。
2. 点击 **编辑** （位于右上角）。这会打开一个变更请求，你可以在其中修改该分区的内容。
3. 点击 **添加新内容…** > **页面** （位于左侧目录中）。
4. 为你的新页面设置标题。

**预览你的更改**

在 Web 应用顶部，你会看到以下标签页： **编辑器**, **变更**和 **预览**。这些标签页可切换内容的不同视图。点击 **预览** 即可在桌面端和移动端查看文档站点的效果，其中会显示变更请求中的所有更改。

**合并你的更改**

确认更改无误后，点击右上角的 **合并** 按钮。这会将变更请求中的所有编辑内容更新到内容的主版本中。如果这些内容属于在线文档站点，站点会立即更新。
{% endtab %}

{% tab title="Git Sync" icon="robot" %}
将你的文档与 GitHub 或 GitLab 仓库同步，以便在你现有的开发环境中启用基于代码的编辑。对于希望将文档与其他代码一起管理的技术用户来说，这是理想选择。

**设置 Git 同步**

1. 从侧边栏的 **内容** 部分打开要同步的分区。
2. 点击顶部栏中 Git Sync 指示器里的 **设置** 按钮。
3. 按照说明将该分区同步到你选择的 Git 仓库。前往 [Git Sync 页面](https://gitbook.com/docs/documentation/zh/docs-as-code/git-sync.md) 了解更多信息。

**从你的开发环境编辑文档**

将你的章节同步到 Git 仓库后：

1. 打开仓库。
2. 创建一个拉取请求。
3. 进行你想要的修改。

{% hint style="info" %}
GitBook 支持 [Markdown 编辑](https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/formatting/markdown.md)，因此你可以使用常见语法创建和设置内容格式。

GitBook 中的每个标准块都可以使用 Markdown 编写和格式化。
{% endhint %}

**预览你的更改**

你可以在 GitHub 或 GitLab 的拉取请求中 [预览更改](https://gitbook.com/docs/documentation/zh/docs-as-code/git-sync/github-pull-request-preview.md) 在已发布的文档站点上的效果。拉取请求中会显示一个带有专属预览 URL 的状态。点击该状态中的 **详细信息** 即可打开预览，查看合并后的站点效果。

**合并你的更改**

合并你的拉取请求后，你的内容更新会同时在 GitBook 应用和你的文档站点上生效（如果站点已上线）。在 GitBook 应用中，每次提交和你已合并的拉取请求都会作为版本历史中的更新同步到你的章节。
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

#### 自定义你的文档

**整理站点导航**

你可以随时向站点添加更多内容，例如 API 参考、帮助中心或更新日志，并整理站点的导航栏，方便访客找到所需内容。前往 [站点结构](https://gitbook.com/docs/documentation/zh/manage-your-site/site-structure.md) 了解分区、分组和变体。

**自定义外观和风格**

你的站点开箱即用就很美观；在 **自定义**中，你可以设置自己的 [徽标、颜色和字体](https://gitbook.com/docs/documentation/zh/manage-your-site/customization/icons-colors-and-themes.md)，调整布局，并更新 [站点的可见性](https://gitbook.com/docs/documentation/zh/manage-your-site/site-settings.md#audience).
{% endstep %}

{% step %}

#### 发布你的文档 <a href="#publish-your-documentation" id="publish-your-documentation"></a>

你随时都可以一键发布你的站点。

1. 从组织主页打开你的站点 **主页**.
2. 点击站点页眉中的 **发布** 。

网站上线后， **概览** 页面会更新，并显示指向线上站点的链接。

{% hint style="success" %}
想要更详细地了解发布流程？请查看 [我们关于在 GitBook 中创建和发布内容的完整指南](https://gitbook.com/docs/guides/editing-and-publishing-documentation/complete-guide-to-publishing-docs-gitbook.md).
{% endhint %}
{% endstep %}
{% endstepper %}

#### 添加自定义域名

默认情况下，你的站点会以以下格式的唯一 URL 发布：

{% code title="你的站点默认 URL" %}

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

{% endcode %}

这对某些团队来说可能很合适，但许多团队会选择将 URL 更改为 [自定义域名](https://gitbook.com/docs/documentation/zh/publish/custom-domain.md) 或 [自定义子目录](https://gitbook.com/docs/documentation/zh/publish/custom-domain/setting-a-custom-subdirectory.md).

1. 展开 **设置** 在站点侧边栏中。
2. 点击 **域名和 URL**.
3. 选择你想要的选项。
4. 按照说明在你的域名提供商处配置 DNS 设置。

{% hint style="info" %}
DNS 更改最多可能需要 48 小时才能生效——不过通常传播速度会快得多。
{% endhint %}

#### 下一步

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">封面图片</th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-type="image">封面图片（深色）</th><th data-hidden data-type="image">封面图片（深色）</th><th data-hidden data-type="image">封面图片（深色）</th><th data-hidden data-type="image">封面图片（深色）</th><th data-hidden data-card-cover-dark data-type="image">封面图片（深色）</th></tr></thead><tbody><tr><td><strong>邀请您的团队协作</strong></td><td>向你的组织添加团队成员并设置权限</td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-123daffcaaa78d9872cc99ad659478c6d97c6de3%2F25_12_10_invite_your_team_to_collaborate_1.png?alt=media">25_12_10_invite_your_team_to_collaborate_1.png</a></td><td><a href="https://gitbook.com/docs/documentation/zh/collaborate/member-management/invite-members-to-your-organization.md">管理或移除成员</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-fd07e38f01279522faf61b71c083505ccb41c051%2F25_12_10_invite_your_team_to_collaborate.png?alt=media">25_12_10_invite_your_team_to_collaborate.png</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-fd07e38f01279522faf61b71c083505ccb41c051%2F25_12_10_invite_your_team_to_collaborate.png?alt=media">25_12_10_invite_your_team_to_collaborate.png</a></td><td></td><td></td><td></td></tr><tr><td><strong>更改站点可见性</strong></td><td>通过分享链接和身份验证访问控制谁可以查看你的内容</td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-f7064cff1c9aa2b8b21a496533e4257e2692a88f%2F25_12_10_change_site_visibility_1.png?alt=media">25_12_10_change_site_visibility_1.png</a></td><td><a href="https://gitbook.com/docs/documentation/zh/publish/publish-a-docs-site.md#publish-a-docs-site">发布文档站点</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-a6cb2d0c9e0bfb53580801c20768eacac87459d9%2F25_12_10_change_site_visibility.png?alt=media">25_12_10_change_site_visibility.png</a></td><td></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-a6cb2d0c9e0bfb53580801c20768eacac87459d9%2F25_12_10_change_site_visibility.png?alt=media">25_12_10_change_site_visibility.png</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-a6cb2d0c9e0bfb53580801c20768eacac87459d9%2F25_12_10_change_site_visibility.png?alt=media">25_12_10_change_site_visibility.png</a></td><td></td></tr><tr><td><strong>添加自动翻译</strong></td><td>创建一键翻译，并自动更新</td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-a1584c50b44ab46eec5ed3f0898eeffd2e6bc94d%2F25_12_10_add_auto_translations_1.png?alt=media">25_12_10_add_auto_translations_1.png</a></td><td><a href="https://gitbook.com/docs/documentation/zh/manage-your-site/site-settings.md">站点设置</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-5f37c8f0398c9168c41f5c06b3957ae3df682c76%2F25_12_10_add_auto_translations.png?alt=media">25_12_10_add_auto_translations.png</a></td><td></td><td></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-5f37c8f0398c9168c41f5c06b3957ae3df682c76%2F25_12_10_add_auto_translations.png?alt=media">25_12_10_add_auto_translations.png</a></td><td></td></tr><tr><td><strong>安装集成</strong></td><td>与你的技术栈集成，并通过强大的集成扩展功能</td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-86da4bb2cc94f3a9a1849fdcfbead0c75891e9c9%2F25_12_10_install_integrations_1.png?alt=media">25_12_10_install_integrations_1.png</a></td><td><a href="https://gitbook.com/docs/documentation/zh/manage-your-site/install-an-integration.md">安装并管理集成</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-b20ed0ab68355cdbd6eb8f5d0eb08a67207b42a3%2F25_12_10_install_integrations.png?alt=media">25_12_10_install_integrations.png</a></td><td></td><td></td><td></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-b20ed0ab68355cdbd6eb8f5d0eb08a67207b42a3%2F25_12_10_install_integrations.png?alt=media">25_12_10_install_integrations.png</a></td></tr><tr><td><strong>添加 API 参考</strong></td><td>根据 API 规范创建可自动更新的交互式 API 参考文档</td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-ac12806b3cbcd4be3a3758a21acf8d8109a02343%2F25_12_10_add_an_api_reference_1.png?alt=media">25_12_10_add_an_api_reference_1.png</a></td><td><a href="https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/openapi.md">为 API 编写文档</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-165161ef7a07d68f272b9ba34596e895f704ee19%2F25_12_10_add_an_api_reference.png?alt=media">25_12_10_add_an_api_reference.png</a></td><td></td><td></td><td></td><td></td></tr><tr><td><strong>跟踪文档分析</strong></td><td>使用内置洞察来衡量效果并了解用户行为</td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-b583de47e273a882ffa5ea4797456c3787018ee3%2F25_12_10_track_docs_analytics_1.png?alt=media">25_12_10_track_docs_analytics_1.png</a></td><td><a href="https://gitbook.com/docs/documentation/zh/analytics/insights.md">站点分析</a></td><td><a href="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-a2e88c6a0eb12a917de55c439724c76a5ac9bbf0%2F25_12_10_track_docs_analytics.png?alt=media">25_12_10_track_docs_analytics.png</a></td><td></td><td></td><td></td><td></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/documentation/zh/getting-started/quickstart.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
