> 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 中完成设置，并在几分钟内发布你的第一个文档站点。

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

{% stepper %}
{% 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>Customize</strong>, <strong>分析</strong>，以及 <strong>扩展</strong>.</td></tr><tr><td><strong>内容</strong></td><td>这些是你站点的各个章节——对于文档模板而言，包括：主页、文档、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 中，你有两种方式编辑和更新内容——在可视化编辑器中，或者遵循 docs-as-code 工作流。 **你可以选择其中一种，也可以将两者结合使用。** 无论你偏好哪种工作流，你都将使用 **基于分支的编辑流程**来编辑内容。更多信息请查看 [概念页面](/docs/documentation/zh/can-kao/concepts.md).

{% tabs %}
{% tab title="可视化编辑器" icon="hand-pointer" %}
GitBook 的所见即所得（WYSIWYG）编辑器让你可以直观地编辑内容、拖动内容块进行重新排序，并在编辑过程中查看内容的样子。如果你不想使用代码编辑器，或者你习惯了 Notion 或 Google Docs 这类工具，那么它非常适合你。

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

1. 在 **内容** 在侧边栏的章节中，点击某个章节——例如“文档”——将其打开。
2. 点击 **编辑** 右上角的
3. 点击 **添加新内容…** > **页面** 位于左侧的目录中。
4. 为你的新页面起一个标题。

**预览你的更改**

在网页应用顶部，你会看到以下标签页： **编辑器**, **“更改”**，以及 **预览**。它们用于在内容的不同视图之间切换。点击 **预览** 即可查看你的文档站点在变更请求中的所有更改应用后的效果，包括桌面端和移动端。

**合并你的更改**

当你对更改满意后，点击右上角的 **合并** 按钮。这会将变更请求中的所有编辑更新到你内容的主版本。如果内容属于一个正在运行的文档站点，站点会立即更新。
{% endtab %}

{% tab title="AI 代理" icon="robot" %}
将你的文档与 GitHub 或 GitLab 仓库同步，以便在你现有的开发环境中启用基于代码的编辑。这非常适合喜欢将文档与其他代码一起管理的技术用户。

**设置 Git 同步**

1. 从侧边栏的 **内容** 部分打开你想要同步的章节。
2. 点击 Git 同步指示器的 **设置** 顶部栏中的按钮。
3. 按照说明将该章节同步到你选择的 Git 仓库。前往 [Git 同步页面](/docs/documentation/zh/wen-dang-ji-dai-ma/git-sync.md) 了解更多。

**在你的开发环境中编辑你的文档**

一旦你将章节同步到 Git 仓库：

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

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

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

**预览你的更改**

你可以 [预览你的更改](/docs/documentation/zh/wen-dang-ji-dai-ma/git-sync/github-pull-request-preview.md) 在 GitHub 或 GitLab 中从拉取请求查看你已发布文档站点上的效果。你的拉取请求会显示一个带有唯一预览 URL 的状态。点击 **详情** 中的该状态即可打开它，并查看合并后你站点的外观。

**合并你的更改**

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

{% step %}

#### 自定义你的文档

**整理你的站点导航**

随时为你的站点添加更多内容——API 参考、帮助中心、更新日志——并整理站点的导航栏，让访客更容易找到他们要找的内容。前往 [站点结构](/docs/documentation/zh/guan-li-ni-de-zhan-dian/site-structure.md) 了解章节、分组和变体。

**自定义外观与体验**

你的站点开箱即用就已经很美观——并且在 **Customize**下，你可以设置自己的 [徽标、颜色和字体](/docs/documentation/zh/guan-li-ni-de-zhan-dian/customization/icons-colors-and-themes.md)，调整布局，并更新你的 [站点可见性](/docs/documentation/zh/guan-li-ni-de-zhan-dian/site-settings.md#audience).
{% endstep %}

{% step %}

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

你可以随时只需点击一下即可发布你的站点。

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

一旦你的站点上线， **概览** 界面会更新并显示一个指向上线站点的链接。

{% hint style="success" %}
想更深入地了解发布？请查看 [我们关于在 GitBook 中创建和发布内容的完整指南](/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 更改为 [自定义域名](/docs/documentation/zh/fa-bu/custom-domain.md) 或者 [自定义子目录](/docs/documentation/zh/fa-bu/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="/files/1e7975547a6499169ae725e2cb36c15b62ec9e30">/files/1e7975547a6499169ae725e2cb36c15b62ec9e30</a></td><td><a href="/pages/72773b530dd0ed92acbaeb8153cb877b26ca1d5b">/pages/72773b530dd0ed92acbaeb8153cb877b26ca1d5b</a></td><td><a href="/files/5466ed2e4a1a0ea93287df3c7d6172a9f1e099b1">/files/5466ed2e4a1a0ea93287df3c7d6172a9f1e099b1</a></td><td><a href="/files/5466ed2e4a1a0ea93287df3c7d6172a9f1e099b1">/files/5466ed2e4a1a0ea93287df3c7d6172a9f1e099b1</a></td><td></td><td></td><td></td></tr><tr><td><strong>更改站点可见性</strong></td><td>通过分享链接和身份验证访问来控制谁可以查看你的内容</td><td><a href="/files/14c14fdea769015f49659d50571789528526e75c">/files/14c14fdea769015f49659d50571789528526e75c</a></td><td><a href="/pages/1d5137752f6c36df1bbc6bed6541212250dcfdf3#publish-a-docs-site">/pages/1d5137752f6c36df1bbc6bed6541212250dcfdf3#publish-a-docs-site</a></td><td><a href="/files/be141b32d869377c74714d36ff0e034e339694e9">/files/be141b32d869377c74714d36ff0e034e339694e9</a></td><td></td><td><a href="/files/be141b32d869377c74714d36ff0e034e339694e9">/files/be141b32d869377c74714d36ff0e034e339694e9</a></td><td><a href="/files/be141b32d869377c74714d36ff0e034e339694e9">/files/be141b32d869377c74714d36ff0e034e339694e9</a></td><td></td></tr><tr><td><strong>添加自动翻译</strong></td><td>创建可自动更新的一键翻译</td><td><a href="/files/2402d3172ae6328acec64382f490f0a0e3854b3c">/files/2402d3172ae6328acec64382f490f0a0e3854b3c</a></td><td><a href="/pages/6e17e6961a0d0cc0bae2cf94b991cab7b8d87c97">/pages/6e17e6961a0d0cc0bae2cf94b991cab7b8d87c97</a></td><td><a href="/files/214762394e96b31de9d03ba5b6713af14115d516">/files/214762394e96b31de9d03ba5b6713af14115d516</a></td><td></td><td></td><td><a href="/files/214762394e96b31de9d03ba5b6713af14115d516">/files/214762394e96b31de9d03ba5b6713af14115d516</a></td><td></td></tr><tr><td><strong>安装集成</strong></td><td>与你的技术栈集成，并通过强大的集成功能扩展能力</td><td><a href="/files/96040376554713f3246648a0e70bfbf1018b1feb">/files/96040376554713f3246648a0e70bfbf1018b1feb</a></td><td><a href="/pages/3363fb91d4d0690deb34e4ac1cccfde33732061d">/pages/3363fb91d4d0690deb34e4ac1cccfde33732061d</a></td><td><a href="/files/d9802dafbbec823d017902ae4e7094e8d79477d6">/files/d9802dafbbec823d017902ae4e7094e8d79477d6</a></td><td></td><td></td><td></td><td><a href="/files/d9802dafbbec823d017902ae4e7094e8d79477d6">/files/d9802dafbbec823d017902ae4e7094e8d79477d6</a></td></tr><tr><td><strong>添加 API 参考</strong></td><td>根据 API 规范创建可自动更新的交互式 API 参考文档</td><td><a href="/files/260b576e314c66c9339e0087c662087a94963479">/files/260b576e314c66c9339e0087c662087a94963479</a></td><td><a href="/pages/cabca6f326af35f8ba9ae349833b9fe974be2898">/pages/cabca6f326af35f8ba9ae349833b9fe974be2898</a></td><td><a href="/files/c0f1c0bf542662c4b0731dcba4fa3e0f77c8a187">/files/c0f1c0bf542662c4b0731dcba4fa3e0f77c8a187</a></td><td></td><td></td><td></td><td></td></tr><tr><td><strong>跟踪文档分析</strong></td><td>使用内置洞察来衡量成效并了解用户行为</td><td><a href="/files/53a7e214a835d505a0fc24913697fd5543c1bafc">/files/53a7e214a835d505a0fc24913697fd5543c1bafc</a></td><td><a href="/pages/ca9521754948c849d1bd694a3d3674f1e3456343">/pages/ca9521754948c849d1bd694a3d3674f1e3456343</a></td><td><a href="/files/fa1313435f294b4092b3291e0b54b6d306490b90">/files/fa1313435f294b4092b3291e0b54b6d306490b90</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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
