> 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>自定义</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) 了解版块、分组和变体。

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

你的网站开箱即用就很美观——并且在 **自定义**中，你可以设置自己的 [徽标、颜色和字体](/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/00fdafc53386d7f60a8995ce867bfdfd337cb7e1">/files/00fdafc53386d7f60a8995ce867bfdfd337cb7e1</a></td><td><a href="/pages/72773b530dd0ed92acbaeb8153cb877b26ca1d5b">/pages/72773b530dd0ed92acbaeb8153cb877b26ca1d5b</a></td><td><a href="/files/cf1d835e5519f93fa02ea99bae4fef1e45859f9d">/files/cf1d835e5519f93fa02ea99bae4fef1e45859f9d</a></td><td><a href="/files/cf1d835e5519f93fa02ea99bae4fef1e45859f9d">/files/cf1d835e5519f93fa02ea99bae4fef1e45859f9d</a></td><td></td><td></td><td></td></tr><tr><td><strong>更改网站可见性</strong></td><td>通过分享链接和身份验证访问控制谁可以查看你的内容</td><td><a href="/files/8cf861ad337878c41c2ca6b50f241f79a3b6fee7">/files/8cf861ad337878c41c2ca6b50f241f79a3b6fee7</a></td><td><a href="/pages/1d5137752f6c36df1bbc6bed6541212250dcfdf3#publish-a-docs-site">/pages/1d5137752f6c36df1bbc6bed6541212250dcfdf3#publish-a-docs-site</a></td><td><a href="/files/2105ac1fc052ba308064118d0e8e1bb2cc72018f">/files/2105ac1fc052ba308064118d0e8e1bb2cc72018f</a></td><td></td><td><a href="/files/2105ac1fc052ba308064118d0e8e1bb2cc72018f">/files/2105ac1fc052ba308064118d0e8e1bb2cc72018f</a></td><td><a href="/files/2105ac1fc052ba308064118d0e8e1bb2cc72018f">/files/2105ac1fc052ba308064118d0e8e1bb2cc72018f</a></td><td></td></tr><tr><td><strong>添加自动翻译</strong></td><td>创建一键翻译，并自动更新</td><td><a href="/files/760d3916c6c0a903d57111f91cff697abb06b6c8">/files/760d3916c6c0a903d57111f91cff697abb06b6c8</a></td><td><a href="/pages/6e17e6961a0d0cc0bae2cf94b991cab7b8d87c97">/pages/6e17e6961a0d0cc0bae2cf94b991cab7b8d87c97</a></td><td><a href="/files/0a9825c1d4ce9fda2956a15e2e54927fd82996d4">/files/0a9825c1d4ce9fda2956a15e2e54927fd82996d4</a></td><td></td><td></td><td><a href="/files/0a9825c1d4ce9fda2956a15e2e54927fd82996d4">/files/0a9825c1d4ce9fda2956a15e2e54927fd82996d4</a></td><td></td></tr><tr><td><strong>安装集成</strong></td><td>与你的技术栈集成，并通过强大的集成扩展功能</td><td><a href="/files/758be05ee540cf25aec77fc4118c79de6d43f888">/files/758be05ee540cf25aec77fc4118c79de6d43f888</a></td><td><a href="/pages/3363fb91d4d0690deb34e4ac1cccfde33732061d">/pages/3363fb91d4d0690deb34e4ac1cccfde33732061d</a></td><td><a href="/files/55240602181a5a9acc2f97dfbb637519a575dc3d">/files/55240602181a5a9acc2f97dfbb637519a575dc3d</a></td><td></td><td></td><td></td><td><a href="/files/55240602181a5a9acc2f97dfbb637519a575dc3d">/files/55240602181a5a9acc2f97dfbb637519a575dc3d</a></td></tr><tr><td><strong>添加 API 参考</strong></td><td>根据 API 规范创建可自动更新的交互式 API 参考文档</td><td><a href="/files/97c2a18a2097e62ad64fe05caca91eaee40260b1">/files/97c2a18a2097e62ad64fe05caca91eaee40260b1</a></td><td><a href="/pages/cabca6f326af35f8ba9ae349833b9fe974be2898">/pages/cabca6f326af35f8ba9ae349833b9fe974be2898</a></td><td><a href="/files/4fed03d6d784c59eedd1c79cae7fbdce31198c33">/files/4fed03d6d784c59eedd1c79cae7fbdce31198c33</a></td><td></td><td></td><td></td><td></td></tr><tr><td><strong>跟踪文档分析</strong></td><td>使用内置洞察来衡量成效并了解用户行为</td><td><a href="/files/3f488558e7ee690540571cc5d9da96e435b6cc00">/files/3f488558e7ee690540571cc5d9da96e435b6cc00</a></td><td><a href="/pages/ca9521754948c849d1bd694a3d3674f1e3456343">/pages/ca9521754948c849d1bd694a3d3674f1e3456343</a></td><td><a href="/files/d26b88fa102964abd4b8a50191d837e491d4f915">/files/d26b88fa102964abd4b8a50191d837e491d4f915</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.
