@aigne/doc-smith 0.8.11-beta.5 → 0.8.11-beta.7
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/output/structure-plan.json +2 -2
- package/.aigne/doc-smith/preferences.yml +28 -20
- package/.aigne/doc-smith/upload-cache.yaml +702 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +22 -2
- package/README.md +2 -2
- package/agents/clear/choose-contents.mjs +2 -2
- package/agents/clear/clear-document-structure.mjs +8 -8
- package/agents/clear/index.yaml +1 -1
- package/agents/evaluate/document-structure.yaml +1 -1
- package/agents/generate/check-document-structure.yaml +3 -3
- package/agents/generate/check-need-generate-structure.mjs +8 -8
- package/agents/generate/document-structure-tools/add-document.mjs +38 -13
- package/agents/generate/document-structure-tools/delete-document.mjs +37 -14
- package/agents/generate/document-structure-tools/move-document.mjs +46 -19
- package/agents/generate/document-structure-tools/update-document.mjs +39 -12
- package/agents/generate/generate-structure.yaml +1 -1
- package/agents/generate/update-document-structure.yaml +3 -9
- package/agents/generate/user-review-document-structure.mjs +15 -14
- package/agents/translate/translate-document.yaml +1 -9
- package/agents/update/batch-generate-document.yaml +1 -1
- package/agents/update/check-document.mjs +2 -2
- package/agents/update/check-update-is-single.mjs +2 -1
- package/agents/update/document-tools/update-document-content.mjs +24 -14
- package/agents/update/fs-tools/glob.mjs +184 -0
- package/agents/update/fs-tools/grep.mjs +317 -0
- package/agents/update/fs-tools/read-file.mjs +307 -0
- package/agents/update/generate-document.yaml +4 -7
- package/agents/update/update-document-detail.yaml +6 -10
- package/agents/update/user-review-document.mjs +13 -13
- package/agents/utils/check-feedback-refiner.mjs +1 -1
- package/agents/utils/choose-docs.mjs +1 -1
- package/agents/utils/load-document-all-content.mjs +3 -3
- package/agents/utils/load-sources.mjs +1 -1
- package/agents/utils/save-docs.mjs +7 -28
- package/aigne.yaml +2 -2
- package/assets/screenshots/doc-complete-setup.png +0 -0
- package/assets/screenshots/doc-generate-docs.png +0 -0
- package/assets/screenshots/doc-generate.png +0 -0
- package/assets/screenshots/doc-generated-successfully.png +0 -0
- package/assets/screenshots/doc-publish.png +0 -0
- package/assets/screenshots/doc-regenerate.png +0 -0
- package/assets/screenshots/doc-translate-langs.png +0 -0
- package/assets/screenshots/doc-translate.png +0 -0
- package/assets/screenshots/doc-update.png +0 -0
- package/docs/_sidebar.md +1 -1
- package/docs/advanced-how-it-works.ja.md +31 -31
- package/docs/advanced-how-it-works.md +10 -10
- package/docs/advanced-how-it-works.zh-TW.md +24 -24
- package/docs/advanced-how-it-works.zh.md +20 -20
- package/docs/advanced-quality-assurance.ja.md +57 -61
- package/docs/advanced-quality-assurance.md +57 -61
- package/docs/advanced-quality-assurance.zh-TW.md +57 -61
- package/docs/advanced-quality-assurance.zh.md +57 -61
- package/docs/advanced.ja.md +8 -4
- package/docs/advanced.md +7 -3
- package/docs/advanced.zh-TW.md +9 -5
- package/docs/advanced.zh.md +9 -5
- package/docs/changelog.ja.md +206 -29
- package/docs/changelog.md +177 -0
- package/docs/changelog.zh-TW.md +229 -52
- package/docs/changelog.zh.md +204 -27
- package/docs/cli-reference.ja.md +181 -80
- package/docs/cli-reference.md +168 -67
- package/docs/cli-reference.zh-TW.md +177 -76
- package/docs/cli-reference.zh.md +172 -71
- package/docs/configuration-interactive-setup.ja.md +45 -42
- package/docs/configuration-interactive-setup.md +9 -6
- package/docs/configuration-interactive-setup.zh-TW.md +26 -23
- package/docs/configuration-interactive-setup.zh.md +25 -22
- package/docs/configuration-language-support.ja.md +33 -63
- package/docs/configuration-language-support.md +32 -62
- package/docs/configuration-language-support.zh-TW.md +35 -65
- package/docs/configuration-language-support.zh.md +32 -62
- package/docs/configuration-llm-setup.ja.md +25 -23
- package/docs/configuration-llm-setup.md +20 -18
- package/docs/configuration-llm-setup.zh-TW.md +21 -19
- package/docs/configuration-llm-setup.zh.md +20 -18
- package/docs/configuration-preferences.ja.md +67 -52
- package/docs/configuration-preferences.md +55 -40
- package/docs/configuration-preferences.zh-TW.md +69 -54
- package/docs/configuration-preferences.zh.md +68 -53
- package/docs/configuration.ja.md +98 -58
- package/docs/configuration.md +42 -2
- package/docs/configuration.zh-TW.md +86 -46
- package/docs/configuration.zh.md +76 -36
- package/docs/features-generate-documentation.ja.md +49 -55
- package/docs/features-generate-documentation.md +49 -55
- package/docs/features-generate-documentation.zh-TW.md +54 -60
- package/docs/features-generate-documentation.zh.md +48 -54
- package/docs/features-publish-your-docs.ja.md +68 -45
- package/docs/features-publish-your-docs.md +65 -42
- package/docs/features-publish-your-docs.zh-TW.md +74 -51
- package/docs/features-publish-your-docs.zh.md +67 -44
- package/docs/features-translate-documentation.ja.md +46 -35
- package/docs/features-translate-documentation.md +39 -28
- package/docs/features-translate-documentation.zh-TW.md +45 -34
- package/docs/features-translate-documentation.zh.md +39 -28
- package/docs/features-update-and-refine.ja.md +75 -71
- package/docs/features-update-and-refine.md +67 -63
- package/docs/features-update-and-refine.zh-TW.md +72 -67
- package/docs/features-update-and-refine.zh.md +71 -67
- package/docs/features.ja.md +29 -19
- package/docs/features.md +25 -15
- package/docs/features.zh-TW.md +28 -18
- package/docs/features.zh.md +31 -21
- package/docs/getting-started.ja.md +43 -46
- package/docs/getting-started.md +36 -39
- package/docs/getting-started.zh-TW.md +41 -44
- package/docs/getting-started.zh.md +39 -42
- package/docs/overview.ja.md +63 -11
- package/docs/overview.md +62 -10
- package/docs/overview.zh-TW.md +67 -15
- package/docs/overview.zh.md +62 -10
- package/docs-mcp/analyze-docs-relevance.yaml +6 -6
- package/docs-mcp/docs-search.yaml +1 -1
- package/media.md +9 -9
- package/package.json +2 -2
- package/prompts/common/document-structure/conflict-resolution-guidance.md +3 -3
- package/prompts/common/document-structure/document-structure-rules.md +2 -2
- package/prompts/detail/custom/custom-components.md +304 -188
- package/prompts/detail/document-rules.md +5 -5
- package/prompts/detail/generate-document.md +21 -8
- package/prompts/detail/update-document.md +8 -12
- package/prompts/evaluate/document-structure.md +6 -6
- package/prompts/structure/check-document-structure.md +10 -10
- package/prompts/structure/document-rules.md +2 -2
- package/prompts/structure/generate-structure-system.md +3 -3
- package/prompts/structure/structure-example.md +1 -1
- package/prompts/structure/structure-getting-started.md +1 -1
- package/prompts/structure/update-document-structure.md +18 -14
- package/prompts/utils/feedback-refiner.md +3 -3
- package/tests/agents/clear/choose-contents.test.mjs +1 -1
- package/tests/agents/clear/clear-document-structure.test.mjs +36 -30
- package/tests/agents/evaluate/generate-report.test.mjs +1 -1
- package/tests/agents/generate/check-need-generate-structure.test.mjs +1 -1
- package/tests/agents/generate/document-structure-tools/add-document.test.mjs +2 -2
- package/tests/agents/generate/document-structure-tools/delete-document.test.mjs +4 -4
- package/tests/agents/generate/document-structure-tools/move-document.test.mjs +12 -12
- package/tests/agents/generate/document-structure-tools/update-document.test.mjs +3 -3
- package/tests/agents/generate/user-review-document-structure.test.mjs +36 -13
- package/tests/agents/update/check-document.test.mjs +1 -1
- package/tests/agents/update/document-tools/update-document-content.test.mjs +115 -112
- package/tests/agents/update/fs-tools/glob.test.mjs +438 -0
- package/tests/agents/update/fs-tools/grep.test.mjs +279 -0
- package/tests/agents/update/fs-tools/read-file.test.mjs +553 -0
- package/tests/agents/update/user-review-document.test.mjs +48 -27
- package/tests/agents/utils/format-document-structure.test.mjs +5 -5
- package/tests/agents/utils/load-sources.test.mjs +4 -4
- package/tests/agents/utils/save-docs.test.mjs +1 -1
- package/tests/utils/conflict-detector.test.mjs +1 -1
- package/tests/utils/docs-finder-utils.test.mjs +8 -8
- package/types/document-schema.mjs +5 -6
- package/types/document-structure-schema.mjs +25 -13
- package/utils/conflict-detector.mjs +1 -1
- package/utils/constants/index.mjs +4 -4
- package/utils/docs-finder-utils.mjs +11 -11
- package/utils/markdown-checker.mjs +1 -1
package/docs/configuration.zh.md
CHANGED
|
@@ -1,31 +1,71 @@
|
|
|
1
1
|
# 配置指南
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmith 的行为由一个中央配置文件 `.aigne/doc-smith/config.yaml` 控制。该文件允许您自定义文档的风格、目标受众、语言和结构,以满足您的特定需求。
|
|
4
4
|
|
|
5
|
-
您可以通过运行 `aigne doc init` 使用交互式设置向导来创建和管理此文件。有关分步演练,请参阅[交互式设置](./configuration-interactive-setup.md)
|
|
5
|
+
您可以通过运行 `aigne doc init` 使用交互式设置向导来创建和管理此文件。有关分步演练,请参阅 [交互式设置](./configuration-interactive-setup.md) 指南。此外,您也可以直接编辑该文件以进行更精细的控制。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
下图说明了配置工作流程:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```d2 配置工作流程
|
|
10
|
+
direction: down
|
|
11
|
+
|
|
12
|
+
User: {
|
|
13
|
+
shape: person
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
CLI: {
|
|
17
|
+
label: "运行命令\n'aigne doc init'"
|
|
18
|
+
shape: rectangle
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
Setup-Wizard: {
|
|
22
|
+
label: "交互式设置向导"
|
|
23
|
+
shape: rectangle
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Config-File: {
|
|
27
|
+
label: ".aigne/doc-smith/config.yaml"
|
|
28
|
+
shape: rectangle
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
AIGNE-DocSmith-Engine: {
|
|
32
|
+
label: "AIGNE DocSmith 引擎"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
# 路径 1:交互式设置(推荐)
|
|
36
|
+
User -> CLI: "推荐路径"
|
|
37
|
+
CLI -> Setup-Wizard: "启动"
|
|
38
|
+
Setup-Wizard -> Config-File: "创建/修改"
|
|
39
|
+
|
|
40
|
+
# 路径 2:手动编辑
|
|
41
|
+
User -> Config-File: "备用路径:\n直接编辑"
|
|
42
|
+
|
|
43
|
+
# 最后一步
|
|
44
|
+
Config-File -> AIGNE-DocSmith-Engine: "配置"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 核心配置区域
|
|
48
|
+
|
|
49
|
+
您的文档由几个关键的配置区域决定。请浏览这些指南,了解如何微调生成过程的各个方面。
|
|
10
50
|
|
|
11
51
|
<x-cards data-columns="2">
|
|
12
52
|
<x-card data-title="交互式设置" data-icon="lucide:wand-2" data-href="/configuration/interactive-setup">
|
|
13
53
|
了解引导式向导如何帮助您配置文档项目,包括设置建议和冲突检测。
|
|
14
54
|
</x-card>
|
|
15
55
|
<x-card data-title="LLM 设置" data-icon="lucide:brain-circuit" data-href="/configuration/llm-setup">
|
|
16
|
-
了解如何连接不同的 AI
|
|
56
|
+
了解如何连接不同的 AI 模型,包括使用内置的、无需 API 密钥的 AIGNE Hub。
|
|
17
57
|
</x-card>
|
|
18
58
|
<x-card data-title="语言支持" data-icon="lucide:languages" data-href="/configuration/language-support">
|
|
19
59
|
查看支持的语言完整列表,并了解如何设置主语言和启用自动翻译。
|
|
20
60
|
</x-card>
|
|
21
|
-
<x-card data-title="
|
|
61
|
+
<x-card data-title="管理偏好设置" data-icon="lucide:sliders-horizontal" data-href="/configuration/preferences">
|
|
22
62
|
了解 DocSmith 如何利用您的反馈创建持久性规则,以及如何通过 CLI 管理这些规则。
|
|
23
63
|
</x-card>
|
|
24
64
|
</x-cards>
|
|
25
65
|
|
|
26
66
|
## 参数参考
|
|
27
67
|
|
|
28
|
-
`config.yaml`
|
|
68
|
+
`config.yaml` 文件包含多个控制文档输出的键值对。以下是每个参数的详细参考。
|
|
29
69
|
|
|
30
70
|
### 项目信息
|
|
31
71
|
|
|
@@ -33,20 +73,20 @@ AIGNE DocSmith 的行为由一个中央文件 `config.yaml` 控制,该文件
|
|
|
33
73
|
|
|
34
74
|
| 参数 | 描述 |
|
|
35
75
|
|---|---|
|
|
36
|
-
| `projectName` |
|
|
37
|
-
| `projectDesc` |
|
|
38
|
-
| `projectLogo` |
|
|
76
|
+
| `projectName` | 您的项目名称。如果 `package.json` 文件存在,则从中检测。 |
|
|
77
|
+
| `projectDesc` | 您的项目简短描述。从 `package.json` 文件中检测。 |
|
|
78
|
+
| `projectLogo` | 您的项目徽标图片的路径或 URL。 |
|
|
39
79
|
|
|
40
80
|
### 文档策略
|
|
41
81
|
|
|
42
82
|
这些参数定义了生成内容的基调、风格和深度。
|
|
43
83
|
|
|
44
84
|
#### `documentPurpose`
|
|
45
|
-
|
|
85
|
+
定义您希望读者实现的主要成果。此设置影响文档的整体结构和重点。
|
|
46
86
|
|
|
47
87
|
| 选项 | 名称 | 描述 |
|
|
48
88
|
|---|---|---|
|
|
49
|
-
| `getStarted` | 快速入门 | 帮助新用户在30分钟内从零开始上手。 |
|
|
89
|
+
| `getStarted` | 快速入门 | 帮助新用户在 30 分钟内从零开始上手。 |
|
|
50
90
|
| `completeTasks` | 完成特定任务 | 引导用户完成常见的工作流程和用例。 |
|
|
51
91
|
| `findAnswers` | 快速查找答案 | 为所有功能和 API 提供可搜索的参考。 |
|
|
52
92
|
| `understandSystem`| 理解系统 | 解释其工作原理以及做出设计决策的原因。 |
|
|
@@ -54,30 +94,30 @@ AIGNE DocSmith 的行为由一个中央文件 `config.yaml` 控制,该文件
|
|
|
54
94
|
| `mixedPurpose` | 服务于多种目的 | 涵盖多种需求的文档。 |
|
|
55
95
|
|
|
56
96
|
#### `targetAudienceTypes`
|
|
57
|
-
|
|
97
|
+
定义最常阅读此文档的受众。此选择会影响写作风格和示例。
|
|
58
98
|
|
|
59
99
|
| 选项 | 名称 | 描述 |
|
|
60
100
|
|---|---|---|
|
|
61
101
|
| `endUsers` | 最终用户(非技术人员) | 使用产品但不编码的人员。 |
|
|
62
|
-
| `developers` | 集成您的产品/API
|
|
102
|
+
| `developers` | 集成您的产品/API 的开发者 | 将此添加到其项目中的工程师。 |
|
|
63
103
|
| `devops` | DevOps / SRE / 基础设施团队 | 部署、监控和维护系统的团队。 |
|
|
64
|
-
| `decisionMakers`| 技术决策者 |
|
|
104
|
+
| `decisionMakers`| 技术决策者 | 评估或规划实施的架构师或负责人。 |
|
|
65
105
|
| `supportTeams` | 支持团队 | 帮助他人使用产品的人员。 |
|
|
66
|
-
| `mixedTechnical`| 混合技术受众 |
|
|
106
|
+
| `mixedTechnical`| 混合技术受众 | 开发者、DevOps 和其他技术用户。 |
|
|
67
107
|
|
|
68
108
|
#### `readerKnowledgeLevel`
|
|
69
|
-
|
|
109
|
+
定义读者通常具备的知识水平。这会调整对基础知识的假设程度。
|
|
70
110
|
|
|
71
111
|
| 选项 | 名称 | 描述 |
|
|
72
112
|
|---|---|---|
|
|
73
|
-
| `completeBeginners` | 完全是初学者,从零开始 |
|
|
113
|
+
| `completeBeginners` | 完全是初学者,从零开始 | 完全不熟悉此领域/技术。 |
|
|
74
114
|
| `domainFamiliar` | 之前使用过类似的工具 | 了解问题领域,但对这个具体解决方案不熟悉。 |
|
|
75
115
|
| `experiencedUsers` | 是试图做某件特定事情的专家 | 需要参考或高级主题的常规用户。 |
|
|
76
|
-
| `emergencyTroubleshooting`|
|
|
77
|
-
| `exploringEvaluating` |
|
|
116
|
+
| `emergencyTroubleshooting`| 紧急情况/故障排查 | 某些东西坏了,需要快速修复。 |
|
|
117
|
+
| `exploringEvaluating` | 正在评估此工具并与其他工具进行比较 | 试图了解这是否符合他们的需求。 |
|
|
78
118
|
|
|
79
119
|
#### `documentationDepth`
|
|
80
|
-
|
|
120
|
+
定义文档的全面程度。
|
|
81
121
|
|
|
82
122
|
| 选项 | 名称 | 描述 |
|
|
83
123
|
|---|---|---|
|
|
@@ -88,12 +128,12 @@ AIGNE DocSmith 的行为由一个中央文件 `config.yaml` 控制,该文件
|
|
|
88
128
|
|
|
89
129
|
### 自定义指令
|
|
90
130
|
|
|
91
|
-
|
|
131
|
+
为了进行更精细的控制,您可以提供自由文本指令。
|
|
92
132
|
|
|
93
133
|
| 参数 | 描述 |
|
|
94
134
|
|---|---|
|
|
95
135
|
| `rules` | 一个多行字符串,您可以在其中定义特定的文档生成规则(例如,“始终包含性能基准测试”)。 |
|
|
96
|
-
| `targetAudience`|
|
|
136
|
+
| `targetAudience`| 一个多行字符串,用于比预设选项更详细地描述您的特定目标受众。 |
|
|
97
137
|
|
|
98
138
|
### 语言和路径配置
|
|
99
139
|
|
|
@@ -101,20 +141,20 @@ AIGNE DocSmith 的行为由一个中央文件 `config.yaml` 控制,该文件
|
|
|
101
141
|
|
|
102
142
|
| 参数 | 描述 |
|
|
103
143
|
|---|---|
|
|
104
|
-
| `locale` |
|
|
105
|
-
| `translateLanguages` |
|
|
106
|
-
| `docsDir` |
|
|
107
|
-
| `sourcesPath` | 供 DocSmith 分析的源代码路径或 glob
|
|
108
|
-
| `glossary` | 包含项目特定术语的
|
|
144
|
+
| `locale` | 文档的主要语言(例如,`en`、`zh`)。 |
|
|
145
|
+
| `translateLanguages` | 要将文档翻译成的语言代码列表(例如,`[ja, fr, es]`)。 |
|
|
146
|
+
| `docsDir` | 生成的文档文件将保存到的目录。 |
|
|
147
|
+
| `sourcesPath` | 供 DocSmith 分析的源代码路径或 glob 模式列表(例如,`['./src', './lib/**/*.js']`)。 |
|
|
148
|
+
| `glossary` | 包含项目特定术语的 Markdown 文件(`@glossary.md`)路径,以确保翻译的一致性。 |
|
|
109
149
|
|
|
110
150
|
## `config.yaml` 示例
|
|
111
151
|
|
|
112
|
-
|
|
152
|
+
这是一个完整的配置文件示例。您可以随时直接编辑此文件来更改设置。
|
|
113
153
|
|
|
114
|
-
```yaml
|
|
154
|
+
```yaml config.yaml 示例 icon=logos:yaml
|
|
115
155
|
# 用于文档发布的项目信息
|
|
116
156
|
projectName: AIGNE DocSmith
|
|
117
|
-
projectDesc:
|
|
157
|
+
projectDesc: An AI-driven documentation generation tool.
|
|
118
158
|
projectLogo: https://docsmith.aigne.io/image-bin/uploads/def424c20bbdb3c77483894fe0e22819.png
|
|
119
159
|
|
|
120
160
|
# =============================================================================
|
|
@@ -132,11 +172,11 @@ documentPurpose:
|
|
|
132
172
|
targetAudienceTypes:
|
|
133
173
|
- developers
|
|
134
174
|
|
|
135
|
-
#
|
|
175
|
+
# 读者知识水平:读者通常具备哪些知识?
|
|
136
176
|
# 选项:completeBeginners, domainFamiliar, experiencedUsers, emergencyTroubleshooting, exploringEvaluating
|
|
137
177
|
readerKnowledgeLevel: domainFamiliar
|
|
138
178
|
|
|
139
|
-
#
|
|
179
|
+
# 文档深度:文档应有多全面?
|
|
140
180
|
# 选项:essentialOnly, balancedCoverage, comprehensive, aiDecide
|
|
141
181
|
documentationDepth: balancedCoverage
|
|
142
182
|
|
|
@@ -148,7 +188,7 @@ rules: |+
|
|
|
148
188
|
targetAudience: |+
|
|
149
189
|
|
|
150
190
|
|
|
151
|
-
#
|
|
191
|
+
# 词汇表:包含项目特定术语和定义的 Markdown 文件路径
|
|
152
192
|
# glossary: "@glossary.md"
|
|
153
193
|
|
|
154
194
|
# 文档的主要语言
|
|
@@ -159,7 +199,7 @@ locale: en
|
|
|
159
199
|
# - zh
|
|
160
200
|
# - fr
|
|
161
201
|
|
|
162
|
-
#
|
|
202
|
+
# 保存生成文档的目录
|
|
163
203
|
docsDir: .aigne/doc-smith/docs
|
|
164
204
|
|
|
165
205
|
# 要分析的源代码路径
|
|
@@ -167,6 +207,6 @@ sourcesPath:
|
|
|
167
207
|
- ./
|
|
168
208
|
```
|
|
169
209
|
|
|
170
|
-
|
|
210
|
+
配置完成后,您就可以创建符合项目需求的文档了。下一步是运行生成命令。
|
|
171
211
|
|
|
172
212
|
➡️ **下一步:** [生成文档](./features-generate-documentation.md)
|
|
@@ -1,101 +1,95 @@
|
|
|
1
1
|
# ドキュメントの生成
|
|
2
2
|
|
|
3
|
-
`aigne doc generate
|
|
3
|
+
`aigne doc generate` コマンドは、ソースコードから完全なドキュメントセットを作成するための主要な機能です。このコマンドは、コードベースを分析し、論理的なドキュメント構造を計画し、各セクションのコンテンツを生成するプロセスを開始します。これは、初期状態からドキュメントを作成するための標準的な方法です。
|
|
4
4
|
|
|
5
5
|
## 最初の生成
|
|
6
6
|
|
|
7
7
|
まず、プロジェクトのルートディレクトリに移動し、次のコマンドを実行します。
|
|
8
8
|
|
|
9
|
-
```bash
|
|
9
|
+
```bash aigne doc generate icon=lucide:play-circle
|
|
10
10
|
aigne doc generate
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
### 自動設定
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
プロジェクトでこのコマンドを初めて実行する場合、DocSmith は設定が存在しないことを検出します。その後、対話式のセットアップウィザードが自動的に起動し、必要な設定手順を案内します。このプロセスにより、生成が開始される前に有効な設定が確実に配置されます。
|
|
16
16
|
|
|
17
|
-

|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
ドキュメントの主要な側面を定義するための一連の質問に答えるよう求められます。これには以下が含まれます。
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
* ドキュメント生成ルールとスタイル
|
|
22
|
+
* 対象読者
|
|
23
|
+
* 主要言語と追加の翻訳言語
|
|
24
|
+
* ソースコードの入力パスとドキュメントの出力パス
|
|
25
25
|
|
|
26
|
-

|
|
27
27
|
|
|
28
|
-
設定が完了すると、DocSmithはドキュメントの生成に進みます。
|
|
28
|
+
設定が完了すると、DocSmith はドキュメントの生成に進みます。
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
正常に完了すると、新しく作成されたドキュメントは、セットアップ中に指定された出力ディレクトリで利用可能になります。
|
|
33
33
|
|
|
34
|
-

|
|
35
35
|
|
|
36
36
|
## 生成プロセス
|
|
37
37
|
|
|
38
|
-
`generate
|
|
38
|
+
`generate` コマンドは、自動化されたマルチステップのワークフローを実行します。プロセスは以下の通りです。
|
|
39
39
|
|
|
40
40
|
```d2
|
|
41
41
|
direction: down
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
shape:
|
|
43
|
+
User: {
|
|
44
|
+
shape: c4-person
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
47
|
+
AIGNE-CLI: {
|
|
48
|
+
label: "AIGNE CLI"
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
config-check: {
|
|
51
|
+
label: "設定ファイルは存在しますか?"
|
|
52
|
+
shape: diamond
|
|
53
|
+
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
55
|
+
interactive-setup: {
|
|
56
|
+
label: "対話式セットアップウィザード"
|
|
57
|
+
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
59
|
+
generation-process: {
|
|
60
|
+
label: "3. 生成プロセス"
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
analyze-code: "コードの分析"
|
|
63
|
+
plan-structure: "構造の計画"
|
|
64
|
+
generate-content: "コンテンツの生成"
|
|
66
65
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
66
|
+
analyze-code -> plan-structure -> generate-content
|
|
67
|
+
}
|
|
70
68
|
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
output: {
|
|
70
|
+
label: "出力ディレクトリ"
|
|
71
|
+
}
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
plan_structure -> gen_content
|
|
81
|
-
gen_content -> save_docs
|
|
82
|
-
save_docs -> end
|
|
74
|
+
User -> AIGNE-CLI.config-check: "'aigne doc generate'"
|
|
75
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.interactive-setup: "[いいえ] 2. セットアップの開始"
|
|
76
|
+
AIGNE-CLI.interactive-setup -> AIGNE-CLI.generation-process: "設定ファイルの作成"
|
|
77
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.generation-process: "[はい]"
|
|
78
|
+
AIGNE-CLI.generation-process -> AIGNE-CLI.output: "4. ドキュメントの書き込み"
|
|
83
79
|
```
|
|
84
80
|
|
|
85
81
|
## コマンドオプション
|
|
86
82
|
|
|
87
|
-
|
|
83
|
+
デフォルトの `generate` コマンドは、ほとんどのユースケースで十分です。しかし、その動作を変更するためのいくつかのオプションが利用可能で、完全な再生成を強制したり、ドキュメント構造を洗練させたりするのに役立ちます。
|
|
88
84
|
|
|
89
|
-
| オプション | 説明
|
|
90
|
-
|
|
91
|
-
| `--forceRegenerate` |
|
|
92
|
-
| `--feedback` |
|
|
93
|
-
| `--model` | AIGNE Hub
|
|
85
|
+
| オプション | 説明 | 例 |
|
|
86
|
+
| :------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------- |
|
|
87
|
+
| `--forceRegenerate` | 既存のドキュメントをすべて削除し、最初から再生成します。ソースコードや設定に大幅な変更を加えた後に使用してください。 | `aigne doc generate --forceRegenerate` |
|
|
88
|
+
| `--feedback` | セクションの追加、削除、再編成など、ドキュメント全体の構造を洗練させるための大まかなフィードバックを提供します。 | `aigne doc generate --feedback "APIリファレンスを追加"` |
|
|
89
|
+
| `--model` | コンテンツ生成に使用するAIGNE Hubの特定の大規模言語モデルを指定し、異なるモデルを切り替えることができます。 | `aigne doc generate --model openai:gpt-4o` |
|
|
94
90
|
|
|
95
91
|
## 次のステップ
|
|
96
92
|
|
|
97
|
-
|
|
93
|
+
最初のドキュメントを生成した後も、プロジェクトは進化し続けます。ドキュメントをコードと同期させるためには、更新を行う必要があります。次のセクションでは、新しい要件やコードの変更に基づいて、対象を絞った変更を行い、特定のファイルを再生成する方法について説明します。
|
|
98
94
|
|
|
99
|
-
<x-card data-title="更新と改良" data-icon="lucide:file-edit" data-href="/features/update-and-refine">
|
|
100
|
-
コードが変更された際のドキュメントの更新方法や、フィードバックを使用して特定の改善を行う方法を学びます。
|
|
101
|
-
</x-card>
|
|
95
|
+
<x-card data-title="更新と改良" data-icon="lucide:file-edit" data-href="/features/update-and-refine">コードが変更された際のドキュメントの更新方法や、フィードバックを用いた特定の改善方法について学びます。</x-card>
|
|
@@ -1,101 +1,95 @@
|
|
|
1
1
|
# Generate Documentation
|
|
2
2
|
|
|
3
|
-
The `aigne doc generate` command is the
|
|
3
|
+
The `aigne doc generate` command is the primary function for creating a complete documentation set from your source code. This command initiates a process that analyzes your codebase, plans a logical documentation structure, and then generates content for each section. It is the standard method for creating your documentation from an initial state.
|
|
4
4
|
|
|
5
5
|
## Your First Generation
|
|
6
6
|
|
|
7
7
|
To begin, navigate to your project's root directory and run the following command:
|
|
8
8
|
|
|
9
|
-
```bash
|
|
9
|
+
```bash aigne doc generate icon=lucide:play-circle
|
|
10
10
|
aigne doc generate
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
### Automatic Configuration
|
|
14
14
|
|
|
15
|
-
If you
|
|
15
|
+
If you are running this command for the first time in a project, DocSmith will detect that no configuration exists. It will then automatically launch an interactive setup wizard to guide you through the required setup steps. This process ensures a valid configuration is in place before generation begins.
|
|
16
16
|
|
|
17
|
-

|
|
18
18
|
|
|
19
|
-
You will be
|
|
19
|
+
You will be prompted to answer a series of questions to define key aspects of your documentation, including:
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
* Document generation rules and style
|
|
22
|
+
* The target audience
|
|
23
|
+
* Primary language and any additional translation languages
|
|
24
|
+
* Source code input and documentation output paths
|
|
25
25
|
|
|
26
|
-

|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
After the configuration is complete, DocSmith proceeds with the documentation generation.
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
|
-
Upon successful completion,
|
|
32
|
+
Upon successful completion, the newly created documentation will be available in the output directory specified during setup.
|
|
33
33
|
|
|
34
|
-

|
|
35
35
|
|
|
36
36
|
## The Generation Process
|
|
37
37
|
|
|
38
|
-
The `generate` command
|
|
38
|
+
The `generate` command executes an automated, multi-step workflow. The process is outlined below:
|
|
39
39
|
|
|
40
40
|
```d2
|
|
41
41
|
direction: down
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
shape:
|
|
43
|
+
User: {
|
|
44
|
+
shape: c4-person
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
47
|
+
AIGNE-CLI: {
|
|
48
|
+
label: "AIGNE CLI"
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
config-check: {
|
|
51
|
+
label: "Config file exists?"
|
|
52
|
+
shape: diamond
|
|
53
|
+
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
55
|
+
interactive-setup: {
|
|
56
|
+
label: "Interactive Setup Wizard"
|
|
57
|
+
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
59
|
+
generation-process: {
|
|
60
|
+
label: "3. Generation Process"
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
analyze-code: "Analyze Code"
|
|
63
|
+
plan-structure: "Plan Structure"
|
|
64
|
+
generate-content: "Generate Content"
|
|
66
65
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
66
|
+
analyze-code -> plan-structure -> generate-content
|
|
67
|
+
}
|
|
70
68
|
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
output: {
|
|
70
|
+
label: "Output Directory"
|
|
71
|
+
}
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
plan_structure -> gen_content
|
|
81
|
-
gen_content -> save_docs
|
|
82
|
-
save_docs -> end
|
|
74
|
+
User -> AIGNE-CLI.config-check: "'aigne doc generate'"
|
|
75
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.interactive-setup: "[No] 2. Launch setup"
|
|
76
|
+
AIGNE-CLI.interactive-setup -> AIGNE-CLI.generation-process: "Create config file"
|
|
77
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.generation-process: "[Yes]"
|
|
78
|
+
AIGNE-CLI.generation-process -> AIGNE-CLI.output: "4. Write documentation"
|
|
83
79
|
```
|
|
84
80
|
|
|
85
81
|
## Command Options
|
|
86
82
|
|
|
87
|
-
|
|
83
|
+
The default `generate` command is sufficient for most use cases. However, several options are available to modify its behavior, which can be useful for forcing a full regeneration or refining the documentation structure.
|
|
88
84
|
|
|
89
|
-
| Option | Description
|
|
90
|
-
|
|
91
|
-
| `--forceRegenerate` | Deletes all existing documents and regenerates them from scratch. Use this after making significant changes to your source code or configuration. | `aigne doc generate --forceRegenerate`
|
|
92
|
-
| `--feedback` | Provides high-level feedback to refine the overall documentation structure, such as adding, removing, or reorganizing sections.
|
|
93
|
-
| `--model` | Specifies a particular Large Language Model from AIGNE Hub to use for content generation, allowing you to switch between models. | `aigne doc generate --model
|
|
85
|
+
| Option | Description | Example |
|
|
86
|
+
| :------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------- |
|
|
87
|
+
| `--forceRegenerate` | Deletes all existing documents and regenerates them from scratch. Use this after making significant changes to your source code or configuration. | `aigne doc generate --forceRegenerate` |
|
|
88
|
+
| `--feedback` | Provides high-level feedback to refine the overall documentation structure, such as adding, removing, or reorganizing sections. | `aigne doc generate --feedback "Add an API Reference"` |
|
|
89
|
+
| `--model` | Specifies a particular Large Language Model from AIGNE Hub to use for content generation, allowing you to switch between different models. | `aigne doc generate --model openai:gpt-4o` |
|
|
94
90
|
|
|
95
91
|
## What's Next?
|
|
96
92
|
|
|
97
|
-
|
|
93
|
+
After generating the initial documentation, your project will continue to evolve. To keep your documents synchronized with your code, you will need to perform updates. The next section explains how to make targeted changes and regenerate specific files based on new requirements or code modifications.
|
|
98
94
|
|
|
99
|
-
<x-card data-title="Update and Refine" data-icon="lucide:file-edit" data-href="/features/update-and-refine">
|
|
100
|
-
Learn how to update documents when your code changes or make specific improvements using feedback.
|
|
101
|
-
</x-card>
|
|
95
|
+
<x-card data-title="Update and Refine" data-icon="lucide:file-edit" data-href="/features/update-and-refine">Learn how to update documents when your code changes or make specific improvements using feedback.</x-card>
|