@aigne/doc-smith 0.8.10-beta → 0.8.10-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.aigne/doc-smith/config.yaml +3 -1
- package/.aigne/doc-smith/preferences.yml +4 -4
- package/.aigne/doc-smith/upload-cache.yaml +180 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +13 -0
- package/README.md +2 -2
- package/RELEASE.md +3 -3
- package/agents/generate/check-need-generate-structure.mjs +40 -18
- package/agents/generate/index.yaml +1 -0
- package/agents/generate/user-review-document-structure.mjs +168 -0
- package/agents/update/generate-and-translate-document.yaml +3 -3
- package/agents/utils/check-feedback-refiner.mjs +2 -0
- package/agents/utils/save-docs.mjs +16 -22
- package/aigne.yaml +1 -0
- package/docs/advanced-how-it-works.md +26 -24
- package/docs/advanced-how-it-works.zh.md +32 -30
- package/docs/advanced-quality-assurance.md +6 -9
- package/docs/advanced-quality-assurance.zh.md +19 -22
- package/docs/cli-reference.md +35 -76
- package/docs/cli-reference.zh.md +48 -89
- package/docs/configuration-interactive-setup.md +18 -18
- package/docs/configuration-interactive-setup.zh.md +33 -33
- package/docs/configuration-language-support.md +12 -12
- package/docs/configuration-language-support.zh.md +20 -20
- package/docs/configuration-llm-setup.md +14 -13
- package/docs/configuration-llm-setup.zh.md +16 -15
- package/docs/configuration-preferences.md +22 -27
- package/docs/configuration-preferences.zh.md +35 -40
- package/docs/configuration.md +31 -45
- package/docs/configuration.zh.md +48 -62
- package/docs/features-generate-documentation.md +6 -7
- package/docs/features-generate-documentation.zh.md +21 -22
- package/docs/features-publish-your-docs.md +38 -30
- package/docs/features-publish-your-docs.zh.md +45 -37
- package/docs/features-translate-documentation.md +14 -74
- package/docs/features-translate-documentation.zh.md +19 -79
- package/docs/features-update-and-refine.md +19 -18
- package/docs/features-update-and-refine.zh.md +33 -32
- package/docs-mcp/get-docs-structure.mjs +1 -1
- package/package.json +2 -2
- package/prompts/detail/document-rules.md +1 -1
- package/prompts/structure/check-document-structure.md +11 -15
- package/tests/agents/generate/check-need-generate-structure.test.mjs +21 -24
- package/tests/agents/generate/user-review-document-structure.test.mjs +294 -0
- package/utils/auth-utils.mjs +2 -2
package/docs/configuration.zh.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# 配置指南
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmith 的行为由一个位于 `.aigne/doc-smith/config.yaml` 的核心文件 `config.yaml` 控制。该文件决定了文档的风格、目标受众、语言和结构。
|
|
4
4
|
|
|
5
|
-
你可以通过运行 `aigne doc init
|
|
5
|
+
你可以通过运行 `aigne doc init` 使用交互式设置向导来创建和管理此文件。有关分步演练,请参阅 [交互式设置](./configuration-interactive-setup.md) 指南。
|
|
6
6
|
|
|
7
7
|
## 核心配置区域
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ AIGNE DocSmith 的行为由一个中心文件 `config.yaml` 控制,该文件
|
|
|
10
10
|
|
|
11
11
|
<x-cards data-columns="2">
|
|
12
12
|
<x-card data-title="交互式设置" data-icon="lucide:wand-2" data-href="/configuration/interactive-setup">
|
|
13
|
-
|
|
13
|
+
了解引导式向导如何帮助你配置文档项目,包括设置建议和冲突检测。
|
|
14
14
|
</x-card>
|
|
15
15
|
<x-card data-title="LLM 设置" data-icon="lucide:brain-circuit" data-href="/configuration/llm-setup">
|
|
16
16
|
了解如何连接不同的 AI 模型,包括使用无需 API 密钥的内置 AIGNE Hub。
|
|
@@ -29,12 +29,12 @@ AIGNE DocSmith 的行为由一个中心文件 `config.yaml` 控制,该文件
|
|
|
29
29
|
|
|
30
30
|
### 项目信息
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
这些设置提供了关于项目的基本背景信息,用于发布文档。
|
|
33
33
|
|
|
34
34
|
| Parameter | Description |
|
|
35
35
|
|---|---|
|
|
36
|
-
| `projectName` |
|
|
37
|
-
| `projectDesc` |
|
|
36
|
+
| `projectName` | 你的项目名称。如果可用,将从 `package.json` 中检测。 |
|
|
37
|
+
| `projectDesc` | 你的项目的简短描述。从 `package.json` 中检测。 |
|
|
38
38
|
| `projectLogo` | 你的项目徽标图片的路径或 URL。 |
|
|
39
39
|
|
|
40
40
|
### 文档策略
|
|
@@ -42,23 +42,23 @@ AIGNE DocSmith 的行为由一个中心文件 `config.yaml` 控制,该文件
|
|
|
42
42
|
这些参数定义了生成内容的基调、风格和深度。
|
|
43
43
|
|
|
44
44
|
#### `documentPurpose`
|
|
45
|
-
|
|
45
|
+
定义你希望读者达到的主要成果。此设置会影响文档的整体结构和重点。
|
|
46
46
|
|
|
47
47
|
| Option | Name | Description |
|
|
48
48
|
|---|---|---|
|
|
49
49
|
| `getStarted` | 快速入门 | 帮助新用户在 30 分钟内从零开始上手。 |
|
|
50
|
-
| `completeTasks` | 完成特定任务 |
|
|
50
|
+
| `completeTasks` | 完成特定任务 | 引导用户完成常见工作流程和用例。 |
|
|
51
51
|
| `findAnswers` | 快速查找答案 | 为所有功能和 API 提供可搜索的参考。 |
|
|
52
52
|
| `understandSystem`| 理解系统 | 解释其工作原理以及做出设计决策的原因。 |
|
|
53
|
-
| `solveProblems` |
|
|
53
|
+
| `solveProblems` | 解决常见问题 | 帮助用户排查和修复问题。 |
|
|
54
54
|
| `mixedPurpose` | 服务于多种目的 | 涵盖多种需求的文档。 |
|
|
55
55
|
|
|
56
56
|
#### `targetAudienceTypes`
|
|
57
|
-
|
|
57
|
+
定义最常阅读此文档的受众。此选择会影响写作风格和示例。
|
|
58
58
|
|
|
59
59
|
| Option | Name | Description |
|
|
60
60
|
|---|---|---|
|
|
61
|
-
| `endUsers` | 最终用户(非技术人员) |
|
|
61
|
+
| `endUsers` | 最终用户(非技术人员) | 使用产品但不编码的人员。 |
|
|
62
62
|
| `developers` | 集成你的产品/API 的开发者 | 将此添加到其项目中的工程师。 |
|
|
63
63
|
| `devops` | DevOps / SRE / 基础设施团队 | 部署、监控和维护系统的团队。 |
|
|
64
64
|
| `decisionMakers`| 技术决策者 | 评估或规划实施的架构师或负责人。 |
|
|
@@ -66,25 +66,25 @@ AIGNE DocSmith 的行为由一个中心文件 `config.yaml` 控制,该文件
|
|
|
66
66
|
| `mixedTechnical`| 混合技术受众 | 开发者、DevOps 和其他技术用户。 |
|
|
67
67
|
|
|
68
68
|
#### `readerKnowledgeLevel`
|
|
69
|
-
|
|
69
|
+
定义读者通常具备的知识水平。这会调整对基础知识的假设程度。
|
|
70
70
|
|
|
71
71
|
| Option | Name | Description |
|
|
72
72
|
|---|---|---|
|
|
73
|
-
| `completeBeginners` | 完全的初学者,从零开始 |
|
|
74
|
-
| `domainFamiliar` |
|
|
75
|
-
| `experiencedUsers` |
|
|
73
|
+
| `completeBeginners` | 完全的初学者,从零开始 | 完全不熟悉此领域/技术。 |
|
|
74
|
+
| `domainFamiliar` | 之前使用过类似工具 | 了解问题领域,但对这个特定解决方案不熟悉。 |
|
|
75
|
+
| `experiencedUsers` | 试图做特定事情的专家 | 需要参考或高级主题的常规用户。 |
|
|
76
76
|
| `emergencyTroubleshooting`| 紧急情况/故障排查 | 出现问题,需要快速修复。 |
|
|
77
77
|
| `exploringEvaluating` | 正在评估此工具并与其他工具进行比较 | 试图了解这是否符合他们的需求。 |
|
|
78
78
|
|
|
79
79
|
#### `documentationDepth`
|
|
80
|
-
|
|
80
|
+
定义文档应达到的全面程度。
|
|
81
81
|
|
|
82
82
|
| Option | Name | Description |
|
|
83
83
|
|---|---|---|
|
|
84
|
-
| `essentialOnly` |
|
|
84
|
+
| `essentialOnly` | 仅限基本内容 | 涵盖 80% 的用例,保持简洁。 |
|
|
85
85
|
| `balancedCoverage`| 均衡覆盖 | 具有良好深度和实际示例 [推荐]。 |
|
|
86
|
-
| `comprehensive` | 全面 |
|
|
87
|
-
| `aiDecide` |
|
|
86
|
+
| `comprehensive` | 全面 | 涵盖所有功能、边缘情况和高级场景。 |
|
|
87
|
+
| `aiDecide` | 让 AI 决定 | 分析代码复杂性并建议适当的深度。 |
|
|
88
88
|
|
|
89
89
|
### 自定义指令
|
|
90
90
|
|
|
@@ -92,8 +92,8 @@ AIGNE DocSmith 的行为由一个中心文件 `config.yaml` 控制,该文件
|
|
|
92
92
|
|
|
93
93
|
| Parameter | Description |
|
|
94
94
|
|---|---|
|
|
95
|
-
| `rules` |
|
|
96
|
-
| `targetAudience`|
|
|
95
|
+
| `rules` | 一个多行字符串,你可以在其中定义特定的文档生成规则(例如,“始终包含性能基准测试”)。 |
|
|
96
|
+
| `targetAudience`| 一个多行字符串,用于比预设更详细地描述你的特定目标受众。 |
|
|
97
97
|
|
|
98
98
|
### 语言和路径配置
|
|
99
99
|
|
|
@@ -101,7 +101,7 @@ AIGNE DocSmith 的行为由一个中心文件 `config.yaml` 控制,该文件
|
|
|
101
101
|
|
|
102
102
|
| Parameter | Description |
|
|
103
103
|
|---|---|
|
|
104
|
-
| `locale` |
|
|
104
|
+
| `locale` | 文档的主语言(例如,`en`、`zh`)。 |
|
|
105
105
|
| `translateLanguages` | 要将文档翻译成的语言代码列表(例如,`[ja, fr, es]`)。 |
|
|
106
106
|
| `docsDir` | 保存生成的文档文件的目录。 |
|
|
107
107
|
| `sourcesPath` | 供 DocSmith 分析的源代码路径或 glob 模式列表(例如,`['./src', './lib/**/*.js']`)。 |
|
|
@@ -109,59 +109,38 @@ AIGNE DocSmith 的行为由一个中心文件 `config.yaml` 控制,该文件
|
|
|
109
109
|
|
|
110
110
|
## config.yaml 示例
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
这是一个完整的配置文件示例。你可以随时直接编辑此文件以更改设置。
|
|
113
113
|
|
|
114
114
|
```yaml Example config.yaml icon=logos:yaml
|
|
115
115
|
# 用于文档发布的项目信息
|
|
116
116
|
projectName: AIGNE DocSmith
|
|
117
|
-
projectDesc:
|
|
117
|
+
projectDesc: An AI-driven documentation generation tool.
|
|
118
118
|
projectLogo: https://docsmith.aigne.io/image-bin/uploads/def424c20bbdb3c77483894fe0e22819.png
|
|
119
119
|
|
|
120
120
|
# =============================================================================
|
|
121
121
|
# 文档配置
|
|
122
122
|
# =============================================================================
|
|
123
123
|
|
|
124
|
-
#
|
|
125
|
-
#
|
|
126
|
-
# getStarted - 快速入门:帮助新用户在 30 分钟内从零开始上手
|
|
127
|
-
# completeTasks - 完成特定任务:引导用户完成常见工作流和用例
|
|
128
|
-
# findAnswers - 快速查找答案:为所有功能和 API 提供可搜索的参考
|
|
129
|
-
# understandSystem - 理解系统:解释其工作原理以及做出设计决策的原因
|
|
130
|
-
# solveProblems - 排查常见问题:帮助用户排查和修复问题
|
|
131
|
-
# mixedPurpose - 服务于多种目的:涵盖多种需求的综合性文档
|
|
124
|
+
# 目的:你希望读者达到的主要成果是什么?
|
|
125
|
+
# 选项:getStarted, completeTasks, findAnswers, understandSystem, solveProblems, mixedPurpose
|
|
132
126
|
documentPurpose:
|
|
133
127
|
- completeTasks
|
|
134
128
|
- findAnswers
|
|
135
129
|
|
|
136
|
-
#
|
|
137
|
-
#
|
|
138
|
-
# endUsers - 最终用户(非技术人员):使用产品但不编写代码的人员
|
|
139
|
-
# developers - 集成你的产品/API 的开发者:将此添加到其项目中的工程师
|
|
140
|
-
# devops - DevOps / SRE / 基础设施团队:部署、监控、维护系统的团队
|
|
141
|
-
# decisionMakers - 技术决策者:评估或规划实施的架构师、负责人
|
|
142
|
-
# supportTeams - 支持团队:帮助他人使用产品的人员
|
|
143
|
-
# mixedTechnical - 混合技术受众:开发者、DevOps 和技术用户
|
|
130
|
+
# 目标受众:谁会最常阅读此文档?
|
|
131
|
+
# 选项:endUsers, developers, devops, decisionMakers, supportTeams, mixedTechnical
|
|
144
132
|
targetAudienceTypes:
|
|
145
133
|
- developers
|
|
146
134
|
|
|
147
|
-
#
|
|
148
|
-
#
|
|
149
|
-
# completeBeginners - 完全的初学者,从零开始:完全不了解此领域/技术
|
|
150
|
-
# domainFamiliar - 之前使用过类似的工具:了解问题领域,但对这个具体解决方案不熟悉
|
|
151
|
-
# experiencedUsers - 希望完成特定任务的专家:需要参考/高级主题的普通用户
|
|
152
|
-
# emergencyTroubleshooting - 紧急情况/故障排查:出现问题,需要快速修复
|
|
153
|
-
# exploringEvaluating - 正在评估此工具并与其他工具进行比较:试图了解这是否符合他们的需求
|
|
135
|
+
# 读者知识水平:读者通常具备什么知识?
|
|
136
|
+
# 选项:completeBeginners, domainFamiliar, experiencedUsers, emergencyTroubleshooting, exploringEvaluating
|
|
154
137
|
readerKnowledgeLevel: domainFamiliar
|
|
155
138
|
|
|
156
|
-
#
|
|
157
|
-
#
|
|
158
|
-
# essentialOnly - 仅包含核心内容:覆盖 80% 的用例,保持简洁
|
|
159
|
-
# balancedCoverage - 均衡覆盖:具有良好深度和实际示例 [推荐]
|
|
160
|
-
# comprehensive - 全面:覆盖所有功能、边缘情况和高级场景
|
|
161
|
-
# aiDecide - 由 AI 决定:分析代码复杂性并建议合适的深度
|
|
139
|
+
# 文档深度:文档应该有多全面?
|
|
140
|
+
# 选项:essentialOnly, balancedCoverage, comprehensive, aiDecide
|
|
162
141
|
documentationDepth: balancedCoverage
|
|
163
142
|
|
|
164
|
-
#
|
|
143
|
+
# 自定义规则:定义特定的文档生成规则和要求
|
|
165
144
|
rules: |+
|
|
166
145
|
|
|
167
146
|
|
|
@@ -169,18 +148,25 @@ rules: |+
|
|
|
169
148
|
targetAudience: |+
|
|
170
149
|
|
|
171
150
|
|
|
172
|
-
#
|
|
173
|
-
# glossary: "@glossary.md"
|
|
151
|
+
# 术语表:包含项目特定术语和定义的 markdown 文件的路径
|
|
152
|
+
# glossary: "@glossary.md"
|
|
174
153
|
|
|
154
|
+
# 文档的主语言
|
|
175
155
|
locale: en
|
|
176
|
-
|
|
177
|
-
#
|
|
178
|
-
#
|
|
179
|
-
|
|
180
|
-
|
|
156
|
+
|
|
157
|
+
# 要将文档翻译成的语言列表
|
|
158
|
+
# translateLanguages:
|
|
159
|
+
# - zh
|
|
160
|
+
# - fr
|
|
161
|
+
|
|
162
|
+
# 保存生成的文档的目录
|
|
163
|
+
docsDir: .aigne/doc-smith/docs
|
|
164
|
+
|
|
165
|
+
# 要分析的源代码路径
|
|
166
|
+
sourcesPath:
|
|
181
167
|
- ./
|
|
182
168
|
```
|
|
183
169
|
|
|
184
|
-
|
|
170
|
+
完成配置后,你就可以创建符合项目需求的文档了。下一步是运行生成命令。
|
|
185
171
|
|
|
186
172
|
➡️ **下一步:** [生成文档](./features-generate-documentation.md)
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# Generate Documentation
|
|
2
2
|
|
|
3
|
-
The `aigne doc generate` command is the core function
|
|
4
|
-
|
|
5
|
-
This process analyzes your codebase, plans a logical document structure, and then generates content for each section. It's the primary way to create your documentation from scratch.
|
|
3
|
+
The `aigne doc generate` command is the core function for creating a complete documentation set from your source code. This process analyzes your codebase, plans a logical document structure, and then generates content for each section. It's the primary way to create your documentation from scratch.
|
|
6
4
|
|
|
7
5
|
## Your First Generation
|
|
8
6
|
|
|
@@ -14,17 +12,18 @@ aigne doc generate
|
|
|
14
12
|
|
|
15
13
|
### Automatic Configuration
|
|
16
14
|
|
|
17
|
-
If you
|
|
15
|
+
If you run this command for the first time in a project, DocSmith detects that no configuration exists. It will then launch an interactive setup wizard to guide you through the initial setup. This ensures you have a properly configured environment before generation begins.
|
|
18
16
|
|
|
19
17
|

|
|
20
18
|
|
|
21
19
|
You will be asked a series of questions to define:
|
|
20
|
+
|
|
22
21
|
- Document generation rules and style
|
|
23
22
|
- The target audience
|
|
24
23
|
- Primary and translation languages
|
|
25
24
|
- Source code and output paths
|
|
26
25
|
|
|
27
|
-

|
|
28
27
|
|
|
29
28
|
Once the configuration is complete, DocSmith proceeds with the documentation generation.
|
|
30
29
|
|
|
@@ -36,7 +35,7 @@ Upon successful completion, your newly created documentation will be available i
|
|
|
36
35
|
|
|
37
36
|
## The Generation Process
|
|
38
37
|
|
|
39
|
-
The `generate` command follows an automated workflow
|
|
38
|
+
The `generate` command follows an automated workflow. The process can be visualized as follows:
|
|
40
39
|
|
|
41
40
|
```d2
|
|
42
41
|
direction: down
|
|
@@ -98,5 +97,5 @@ While the default `generate` command is sufficient for most use cases, you can u
|
|
|
98
97
|
Now that you have generated your initial documentation, your project will continue to evolve. To keep your documents synchronized with your code, you will need to update them. Proceed to the next section to learn how to make targeted changes and regenerate specific files.
|
|
99
98
|
|
|
100
99
|
<x-card data-title="Update and Refine" data-icon="lucide:file-edit" data-href="/features/update-and-refine">
|
|
101
|
-
|
|
100
|
+
Learn how to update documents when your code changes or make specific improvements using feedback.
|
|
102
101
|
</x-card>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
# 生成文档
|
|
2
2
|
|
|
3
|
-
`aigne doc generate`
|
|
4
|
-
|
|
5
|
-
该过程会分析您的代码库,规划逻辑文档结构,然后为每个部分生成内容。这是从零开始创建文档的主要方式。
|
|
3
|
+
`aigne doc generate` 命令是从源代码创建完整文档集的核心功能。该过程会分析你的代码库,规划逻辑化的文档结构,然后为每个部分生成内容。这是从零开始创建文档的主要方式。
|
|
6
4
|
|
|
7
5
|
## 首次生成
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
首先,请导航到项目的根目录并运行以下命令:
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
10
|
aigne doc generate
|
|
@@ -14,29 +12,30 @@ aigne doc generate
|
|
|
14
12
|
|
|
15
13
|
### 自动配置
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
如果这是你首次在项目中运行此命令,DocSmith 会检测到尚无配置。接着,它将启动一个交互式设置向导,引导你完成初始设置。这能确保在生成开始前,你拥有一个正确配置的环境。
|
|
18
16
|
|
|
19
17
|

|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
系统将询问你一系列问题,以定义:
|
|
20
|
+
|
|
22
21
|
- 文档生成规则和风格
|
|
23
22
|
- 目标受众
|
|
24
23
|
- 主要语言和翻译语言
|
|
25
24
|
- 源代码和输出路径
|
|
26
25
|
|
|
27
|
-

|
|
28
27
|
|
|
29
|
-
配置完成后,DocSmith
|
|
28
|
+
配置完成后,DocSmith 将继续进行文档生成。
|
|
30
29
|
|
|
31
|
-

|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
成功完成后,新创建的文档将位于你指定的输出目录中。
|
|
34
33
|
|
|
35
|
-

|
|
36
35
|
|
|
37
36
|
## 生成过程
|
|
38
37
|
|
|
39
|
-
`generate`
|
|
38
|
+
`generate` 命令遵循一个自动化的工作流程。该过程可直观地表示如下:
|
|
40
39
|
|
|
41
40
|
```d2
|
|
42
41
|
direction: down
|
|
@@ -57,7 +56,7 @@ interactive_setup: "启动交互式设置向导" {
|
|
|
57
56
|
shape: rectangle
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
plan_structure: "1.
|
|
59
|
+
plan_structure: "1. 分析代码并规划结构" {
|
|
61
60
|
shape: rectangle
|
|
62
61
|
}
|
|
63
62
|
|
|
@@ -85,18 +84,18 @@ save_docs -> end
|
|
|
85
84
|
|
|
86
85
|
## 命令选项
|
|
87
86
|
|
|
88
|
-
虽然默认的 `generate`
|
|
87
|
+
虽然默认的 `generate` 命令足以满足大多数使用场景,但你可以使用几个选项来控制生成过程。这些选项在重新生成内容或优化文档结构时非常有用。
|
|
89
88
|
|
|
90
|
-
| 选项 | 描述
|
|
91
|
-
|
|
92
|
-
| `--forceRegenerate` | 删除所有现有文档并从头开始重新生成。在对源代码或配置进行重大更改后使用此选项。
|
|
93
|
-
| `--feedback` |
|
|
94
|
-
| `--model` | 指定 AIGNE Hub
|
|
89
|
+
| 选项 | 描述 | 示例 |
|
|
90
|
+
|---------------------|----------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
|
|
91
|
+
| `--forceRegenerate` | 删除所有现有文档并从头开始重新生成。在对源代码或配置进行重大更改后使用此选项。 | `aigne doc generate --forceRegenerate` |
|
|
92
|
+
| `--feedback` | 提供高层反馈以优化整体文档结构,例如添加、删除或重组章节。 | `aigne doc generate --feedback "Add an API Reference section"` |
|
|
93
|
+
| `--model` | 指定 AIGNE Hub 中的特定大型语言模型用于内容生成,允许你切换模型。 | `aigne doc generate --model claude:claude-3-5-sonnet` |
|
|
95
94
|
|
|
96
|
-
##
|
|
95
|
+
## 接下来做什么?
|
|
97
96
|
|
|
98
|
-
|
|
97
|
+
既然你已经生成了初始文档,你的项目将继续演进。为使文档与代码保持同步,你需要更新它们。请继续阅读下一部分,了解如何进行有针对性的更改和重新生成特定文件。
|
|
99
98
|
|
|
100
99
|
<x-card data-title="更新和优化" data-icon="lucide:file-edit" data-href="/features/update-and-refine">
|
|
101
|
-
|
|
100
|
+
了解当代码变更时如何更新文档,或使用反馈进行特定改进。
|
|
102
101
|
</x-card>
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
# Publish Your Docs
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This guide covers how to publish your documentation, whether you are using the official platform or your own website.
|
|
3
|
+
After generating your documentation, the `aigne doc publish` command uploads your content to a Discuss Kit platform, making it accessible online. This guide explains how to publish your documentation to either the official platform or your own self-hosted website.
|
|
6
4
|
|
|
7
5
|
## The Publishing Process
|
|
8
6
|
|
|
9
|
-
The `aigne doc publish` command initiates an interactive process
|
|
7
|
+
The `aigne doc publish` command initiates an interactive process. The first time you publish to a new destination, it will guide you through authentication. Subsequent publishes will use saved credentials.
|
|
10
8
|
|
|
11
|
-
```d2
|
|
9
|
+
```d2 The Publishing Flow icon=lucide:upload-cloud
|
|
12
10
|
direction: down
|
|
13
11
|
shape: sequence_diagram
|
|
14
12
|
|
|
@@ -32,47 +30,49 @@ alt: "First-time publish or missing config" {
|
|
|
32
30
|
CLI -> Platform: "Uploads docs & media files"
|
|
33
31
|
Platform -> CLI: "Success response"
|
|
34
32
|
CLI -> User: "✅ Published Successfully!"
|
|
33
|
+
|
|
35
34
|
```
|
|
36
35
|
|
|
37
36
|
## Publishing Options
|
|
38
37
|
|
|
39
|
-
You have two
|
|
40
|
-
|
|
41
|
-
### Official Platform
|
|
42
|
-
|
|
43
|
-
Publish to [docsmith.aigne.io](https://docsmith.aigne.io), the official hosting platform. This option is free, makes your documentation publicly accessible, and is recommended for open-source projects.
|
|
44
|
-
|
|
45
|
-
### Your Own Website
|
|
38
|
+
You have two main options for hosting your documentation:
|
|
46
39
|
|
|
47
|
-
|
|
40
|
+
<x-cards data-columns="2">
|
|
41
|
+
<x-card data-title="Official Platform" data-icon="lucide:globe">
|
|
42
|
+
Publish to [docsmith.aigne.io](https://docsmith.aigne.io/app/), a free, public hosting platform provided by AIGNE. This is a good option for open-source projects or to quickly share your docs.
|
|
43
|
+
</x-card>
|
|
44
|
+
<x-card data-title="Your Own Website" data-icon="lucide:server">
|
|
45
|
+
Publish to your own Discuss Kit instance for full control over access and branding. This is suitable for internal or private documentation. You can get a Discuss Kit instance from the [Blocklet Store](https://store.blocklet.dev/blocklets/z8ia1WEiBZ7hxURf6LwH21Wpg99vophFwSJdu).
|
|
46
|
+
</x-card>
|
|
47
|
+
</x-cards>
|
|
48
48
|
|
|
49
49
|
## Step-by-Step Guide
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Follow these steps to publish your documentation for the first time.
|
|
52
52
|
|
|
53
53
|
### 1. Run the Publish Command
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
In your project's root directory, run the following command:
|
|
56
56
|
|
|
57
|
-
```bash
|
|
57
|
+
```bash Terminal icon=lucide:terminal
|
|
58
58
|
aigne doc publish
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
### 2. Choose Your Platform
|
|
62
62
|
|
|
63
|
-
If
|
|
63
|
+
If this is your first time publishing, you will be prompted to select a destination. Choose the option that fits your needs.
|
|
64
64
|
|
|
65
65
|

|
|
66
66
|
|
|
67
|
-
If you select your own website, you will be asked to enter
|
|
67
|
+
If you select your own website, you will be asked to enter its URL.
|
|
68
68
|
|
|
69
69
|
### 3. Authenticate Your Account
|
|
70
70
|
|
|
71
|
-
For the first connection to a new platform,
|
|
71
|
+
For the first connection to a new platform, a browser window will open for you to log in and authorize the CLI. This is a one-time step per platform; your access token is saved locally in `~/.aigne/doc-smith-connected.yaml` for future use.
|
|
72
72
|
|
|
73
73
|
### 4. Confirmation
|
|
74
74
|
|
|
75
|
-
Once the upload is complete,
|
|
75
|
+
Once the upload is complete, a success message will appear in your terminal.
|
|
76
76
|
|
|
77
77
|
```
|
|
78
78
|
✅ Documentation Published Successfully!
|
|
@@ -80,20 +80,28 @@ Once the upload is complete, you will see a success message in your terminal, an
|
|
|
80
80
|
|
|
81
81
|
## Publishing in CI/CD Environments
|
|
82
82
|
|
|
83
|
-
For automated workflows, you can
|
|
83
|
+
For automated workflows, you can provide arguments and environment variables to bypass the interactive prompts.
|
|
84
84
|
|
|
85
|
-
| Method
|
|
86
|
-
|
|
87
|
-
| **Argument** | `--appUrl`
|
|
88
|
-
| **Env Var**
|
|
89
|
-
|
|
85
|
+
| Method | Name | Description |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| **Argument** | `--appUrl` | Specifies the URL of your Discuss Kit instance directly. |
|
|
88
|
+
| **Env Var** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` | Provides the access token, skipping the interactive login. |
|
|
89
|
+
|
|
90
|
+
Here is an example of a non-interactive publish command suitable for a CI/CD pipeline:
|
|
91
|
+
|
|
92
|
+
```bash CI/CD Example icon=lucide:workflow
|
|
93
|
+
export DOC_DISCUSS_KIT_ACCESS_TOKEN="your_access_token_here"
|
|
94
|
+
aigne doc publish --appUrl https://docs.mycompany.com
|
|
95
|
+
```
|
|
90
96
|
|
|
91
97
|
## Troubleshooting
|
|
92
98
|
|
|
93
|
-
If you encounter
|
|
99
|
+
If you encounter an issue during publishing, check for these common problems:
|
|
100
|
+
|
|
101
|
+
- **Connection Error**: The provided URL for your self-hosted instance might be incorrect, or the server may be unreachable. Verify the URL and your network connection.
|
|
102
|
+
|
|
103
|
+
- **Invalid Website URL**: The URL must point to a valid website built on the ArcBlock platform. The CLI will show an error like `The provided URL is not a valid website on ArcBlock platform`. To host your documentation, you can start by getting a [Discuss Kit instance from the store](https://store.blocklet.dev/blocklets/z8ia1WEiBZ7hxURf6LwH21Wpg99vophFwSJdu).
|
|
94
104
|
|
|
95
|
-
-
|
|
96
|
-
- **Invalid Website URL**: The provided URL is not a valid website on the ArcBlock platform. To host your documentation, you need a website running on this platform. You can start by visiting the [Discuss Kit Store](https://www.arcblock.io/store/z8iZhf67n368m2k5a9fXvCL778jAnf3e5n2b).
|
|
97
|
-
- **Missing Required Components**: The destination website must have the Discuss Kit component installed to host the documentation. If it is missing, the CLI will return an error with guidance on how to add the component. You can find instructions in the [Discuss Kit documentation](https://www.arcblock.io/docs/web3-kit/en/discuss-kit).
|
|
105
|
+
- **Missing Required Components**: The destination website must have the Discuss Kit component installed. If it is missing, the CLI will return an error like `This website does not have required components for publishing`. Please refer to the [Discuss Kit documentation](https://www.arcblock.io/docs/web3-kit/en/discuss-kit) to add the necessary component.
|
|
98
106
|
|
|
99
107
|
For a complete list of commands and options, refer to the [CLI Command Reference](./cli-reference.md).
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
# 发布你的文档
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
生成文档后,`aigne doc publish` 命令会将你的内容上传到 Discuss Kit 平台,使其可以在线访问。本指南将说明如何将文档发布到官方平台或你自己的自托管网站。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 发布过程
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
`aigne doc publish` 命令会启动一个交互式过程。当你首次发布到新目标时,它将引导你完成身份验证。后续的发布将使用已保存的凭据。
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```d2
|
|
9
|
+
```d2 发布流程 icon=lucide:upload-cloud
|
|
12
10
|
direction: down
|
|
13
11
|
shape: sequence_diagram
|
|
14
12
|
|
|
15
13
|
User: { shape: c4-person }
|
|
16
14
|
CLI: { label: "AIGNE CLI" }
|
|
17
|
-
Browser: { label: "
|
|
18
|
-
Platform: { label: "Discuss Kit
|
|
15
|
+
Browser: { label: "浏览器" }
|
|
16
|
+
Platform: { label: "Discuss Kit 平台" }
|
|
19
17
|
|
|
20
18
|
User -> CLI: "aigne doc publish"
|
|
21
19
|
|
|
22
20
|
alt: "首次发布或缺少配置" {
|
|
23
|
-
CLI -> User: "选择平台\n
|
|
21
|
+
CLI -> User: "选择平台\n(官方 / 自托管)"
|
|
24
22
|
User -> CLI: "提供选择"
|
|
25
23
|
CLI -> Browser: "打开认证 URL"
|
|
26
24
|
User -> Browser: "登录并授权"
|
|
27
|
-
Browser -> Platform: "
|
|
25
|
+
Browser -> Platform: "发送凭据"
|
|
28
26
|
Platform -> CLI: "返回访问令牌"
|
|
29
27
|
CLI -> CLI: "保存令牌以备将来使用"
|
|
30
28
|
}
|
|
@@ -32,47 +30,49 @@ alt: "首次发布或缺少配置" {
|
|
|
32
30
|
CLI -> Platform: "上传文档和媒体文件"
|
|
33
31
|
Platform -> CLI: "成功响应"
|
|
34
32
|
CLI -> User: "✅ 发布成功!"
|
|
33
|
+
|
|
35
34
|
```
|
|
36
35
|
|
|
37
36
|
## 发布选项
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
### 官方平台
|
|
42
|
-
|
|
43
|
-
发布到官方托管平台 [docsmith.aigne.io](https://docsmith.aigne.io)。此选项免费,可使你的文档公开访问,推荐用于开源项目。
|
|
44
|
-
|
|
45
|
-
### 你自己的网站
|
|
38
|
+
你有两种主要选项来托管你的文档:
|
|
46
39
|
|
|
47
|
-
|
|
40
|
+
<x-cards data-columns="2">
|
|
41
|
+
<x-card data-title="官方平台" data-icon="lucide:globe">
|
|
42
|
+
发布到 [docsmith.aigne.io](https://docsmith.aigne.io/app/),这是 AIGNE 提供的一个免费的公共托管平台。对于开源项目或希望快速分享文档的用户来说,这是一个不错的选择。
|
|
43
|
+
</x-card>
|
|
44
|
+
<x-card data-title="你自己的网站" data-icon="lucide:server">
|
|
45
|
+
发布到你自己的 Discuss Kit 实例,以完全控制访问和品牌。这适用于内部或私有文档。你可以从 [Blocklet 商店](https://store.blocklet.dev/blocklets/z8ia1WEiBZ7hxURf6LwH21Wpg99vophFwSJdu) 获取 Discuss Kit 实例。
|
|
46
|
+
</x-card>
|
|
47
|
+
</x-cards>
|
|
48
48
|
|
|
49
49
|
## 分步指南
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
按照以下步骤首次发布你的文档。
|
|
52
52
|
|
|
53
53
|
### 1. 运行发布命令
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
在你的项目根目录中,运行以下命令:
|
|
56
56
|
|
|
57
|
-
```bash
|
|
57
|
+
```bash Terminal icon=lucide:terminal
|
|
58
58
|
aigne doc publish
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
### 2. 选择你的平台
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
如果这是你第一次发布,系统将提示你选择一个目标。选择适合你需求的选项。
|
|
64
64
|
|
|
65
65
|

|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
如果你选择自己的网站,系统将要求你输入其 URL。
|
|
68
68
|
|
|
69
|
-
### 3.
|
|
69
|
+
### 3. 验证你的账户
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
首次连接到新平台时,浏览器窗口将打开,以便你登录并授权 CLI。每个平台只需执行此步骤一次;你的访问令牌会保存在本地的 `~/.aigne/doc-smith-connected.yaml` 文件中,以供将来使用。
|
|
72
72
|
|
|
73
73
|
### 4. 确认
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
上传完成后,你的终端将显示一条成功消息。
|
|
76
76
|
|
|
77
77
|
```
|
|
78
78
|
✅ 文档发布成功!
|
|
@@ -80,20 +80,28 @@ aigne doc publish
|
|
|
80
80
|
|
|
81
81
|
## 在 CI/CD 环境中发布
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
对于自动化工作流,你可以提供参数和环境变量来绕过交互式提示。
|
|
84
84
|
|
|
85
|
-
|
|
|
86
|
-
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
85
|
+
| 方法 | 名称 | 描述 |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| **参数** | `--appUrl` | 直接指定你的 Discuss Kit 实例的 URL。 |
|
|
88
|
+
| **环境变量** | `DOC_DISCUSS_KIT_ACCESS_TOKEN` | 提供访问令牌,跳过交互式登录。 |
|
|
89
|
+
|
|
90
|
+
以下是一个适用于 CI/CD 流程的非交互式发布命令示例:
|
|
91
|
+
|
|
92
|
+
```bash CI/CD Example icon=lucide:workflow
|
|
93
|
+
export DOC_DISCUSS_KIT_ACCESS_TOKEN="your_access_token_here"
|
|
94
|
+
aigne doc publish --appUrl https://docs.mycompany.com
|
|
95
|
+
```
|
|
90
96
|
|
|
91
97
|
## 故障排除
|
|
92
98
|
|
|
93
|
-
|
|
99
|
+
如果你在发布过程中遇到问题,请检查以下常见问题:
|
|
100
|
+
|
|
101
|
+
- **连接错误**:提供的自托管实例 URL 可能不正确,或者服务器可能无法访问。请验证 URL 和你的网络连接。
|
|
102
|
+
|
|
103
|
+
- **无效的网站 URL**:该 URL 必须指向一个基于 ArcBlock 平台构建的有效网站。CLI 将显示类似 `The provided URL is not a valid website on ArcBlock platform` 的错误。要托管你的文档,你可以先从[商店获取一个 Discuss Kit 实例](https://store.blocklet.dev/blocklets/z8ia1WEiBZ7hxURf6LwH21Wpg99vophFwSJdu)。
|
|
94
104
|
|
|
95
|
-
-
|
|
96
|
-
- **无效的网站 URL**:提供的 URL 不是 ArcBlock 平台上的有效网站。要托管你的文档,你需要一个在该平台上运行的网站。你可以从访问 [Discuss Kit 商店](https://www.arcblock.io/store/z8iZhf67n368m2k5a9fXvCL778jAnf3e5n2b) 开始。
|
|
97
|
-
- **缺少必需组件**:目标网站必须安装 Discuss Kit 组件才能托管文档。如果缺少该组件,CLI 将返回错误并提供有关如何添加该组件的指导。你可以在 [Discuss Kit 文档](https://www.arcblock.io/docs/web3-kit/en/discuss-kit) 中找到相关说明。
|
|
105
|
+
- **缺少必需组件**:目标网站必须安装 Discuss Kit 组件。如果缺少该组件,CLI 将返回类似 `This website does not have required components for publishing` 的错误。请参阅 [Discuss Kit 文档](https://www.arcblock.io/docs/web3-kit/en/discuss-kit) 以添加必要的组件。
|
|
98
106
|
|
|
99
|
-
|
|
107
|
+
有关命令和选项的完整列表,请参阅 [CLI 命令参考](./cli-reference.md)。
|