@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/cli-reference.zh.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# CLI 命令参考
|
|
2
2
|
|
|
3
|
-
本指南为所有可用的 `aigne doc`
|
|
3
|
+
本指南为所有可用的 `aigne doc` 子命令及其参数和选项提供了参考。它旨在帮助希望充分利用命令行的用户。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
通用语法为:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
aigne doc <command> [options]
|
|
@@ -10,7 +10,7 @@ aigne doc <command> [options]
|
|
|
10
10
|
|
|
11
11
|
### 命令工作流
|
|
12
12
|
|
|
13
|
-
下图展示了使用 DocSmith
|
|
13
|
+
下图展示了使用 DocSmith CLI 命令创建和维护文档的典型生命周期:
|
|
14
14
|
|
|
15
15
|
```d2
|
|
16
16
|
direction: down
|
|
@@ -54,11 +54,6 @@ End: {
|
|
|
54
54
|
style.fill: "#a2eeaf"
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
prefs: {
|
|
58
|
-
label: "aigne doc prefs\n(管理学习到的规则)"
|
|
59
|
-
shape: cylinder
|
|
60
|
-
}
|
|
61
|
-
|
|
62
57
|
Start -> init: "可选" {
|
|
63
58
|
style.stroke-dash: 4
|
|
64
59
|
}
|
|
@@ -68,50 +63,44 @@ generate -> refinement-cycle: "优化"
|
|
|
68
63
|
refinement-cycle -> publish: "就绪"
|
|
69
64
|
generate -> publish: "直接部署"
|
|
70
65
|
publish -> End
|
|
71
|
-
|
|
72
|
-
prefs <-> generate: "影响" {
|
|
73
|
-
style.stroke-dash: 2
|
|
74
|
-
}
|
|
75
|
-
prefs <-> refinement-cycle: "影响" {
|
|
76
|
-
style.stroke-dash: 2
|
|
77
|
-
}
|
|
78
66
|
```
|
|
79
67
|
|
|
80
68
|
---
|
|
81
69
|
|
|
82
70
|
## `aigne doc generate`
|
|
83
71
|
|
|
84
|
-
**别名:** `gen`, `g`
|
|
85
|
-
|
|
86
72
|
分析您的源代码,并根据您的配置生成一套完整的文档。如果未找到配置,它将自动启动交互式设置向导。
|
|
87
73
|
|
|
88
74
|
### 选项
|
|
89
75
|
|
|
90
|
-
| Option
|
|
91
|
-
|
|
92
|
-
| `--feedback`
|
|
93
|
-
| `--forceRegenerate` | boolean |
|
|
94
|
-
| `--model`
|
|
95
|
-
| `--glossary` | string | 用于保持术语一致性的术语表文件路径。使用 `@path/to/glossary.md` 格式。 |
|
|
76
|
+
| Option | Type | Description |
|
|
77
|
+
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
|
|
78
|
+
| `--feedback` | string | 提供反馈以调整和优化整体文档结构。 |
|
|
79
|
+
| `--forceRegenerate` | boolean | 丢弃现有内容并从头开始重新生成所有文档。 |
|
|
80
|
+
| `--model` | string | 指定用于生成的特定大语言模型(例如,`openai:gpt-4o`)。此选项将覆盖默认设置。 |
|
|
96
81
|
|
|
97
82
|
### 使用示例
|
|
98
83
|
|
|
99
|
-
|
|
84
|
+
**生成或更新文档:**
|
|
85
|
+
|
|
100
86
|
```bash
|
|
101
87
|
aigne doc generate
|
|
102
88
|
```
|
|
103
89
|
|
|
104
90
|
**强制完全重新生成所有文档:**
|
|
91
|
+
|
|
105
92
|
```bash
|
|
106
93
|
aigne doc generate --forceRegenerate
|
|
107
94
|
```
|
|
108
95
|
|
|
109
96
|
**通过反馈优化文档结构:**
|
|
97
|
+
|
|
110
98
|
```bash
|
|
111
|
-
aigne doc generate --feedback "
|
|
99
|
+
aigne doc generate --feedback "Add a new section for API examples and remove the 'About' page."
|
|
112
100
|
```
|
|
113
101
|
|
|
114
|
-
**使用 AIGNE Hub
|
|
102
|
+
**使用 AIGNE Hub 中的特定模型生成:**
|
|
103
|
+
|
|
115
104
|
```bash
|
|
116
105
|
aigne doc generate --model google:gemini-1.5-flash
|
|
117
106
|
```
|
|
@@ -120,132 +109,102 @@ aigne doc generate --model google:gemini-1.5-flash
|
|
|
120
109
|
|
|
121
110
|
## `aigne doc update`
|
|
122
111
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
优化并重新生成特定文档。您可以以交互方式运行以选择文档,或直接使用选项指定文档。此命令对于根据反馈进行有针对性的改进非常有用,无需重新生成整个项目。
|
|
112
|
+
优化并重新生成特定文档。您可以以交互方式运行它来选择文档,或直接使用选项指定文档。这对于根据反馈进行有针对性的改进非常有用,而无需重新生成整个项目。
|
|
126
113
|
|
|
127
114
|
### 选项
|
|
128
115
|
|
|
129
|
-
| Option
|
|
130
|
-
|
|
131
|
-
| `--docs`
|
|
132
|
-
| `--feedback` | string | 提供具体反馈以改进所选文档的内容。
|
|
133
|
-
| `--glossary` | string | 用于保持术语一致性的术语表文件路径。使用 `@path/to/glossary.md` 格式。 |
|
|
134
|
-
| `--reset` | boolean | 忽略之前的结果,为所选文档从头开始重新生成内容。 |
|
|
116
|
+
| Option | Type | Description |
|
|
117
|
+
| ---------- | ----- | ------------------------------------------------------------------------------------------- |
|
|
118
|
+
| `--docs` | array | 要重新生成的文档路径列表。可多次使用。 |
|
|
119
|
+
| `--feedback` | string | 提供具体反馈以改进所选文档的内容。 |
|
|
135
120
|
|
|
136
121
|
### 使用示例
|
|
137
122
|
|
|
138
123
|
**启动交互式会话以选择要更新的文档:**
|
|
124
|
+
|
|
139
125
|
```bash
|
|
140
126
|
aigne doc update
|
|
141
127
|
```
|
|
142
128
|
|
|
143
|
-
|
|
129
|
+
**使用有针对性的反馈更新特定文档:**
|
|
130
|
+
|
|
144
131
|
```bash
|
|
145
|
-
aigne doc update --docs
|
|
132
|
+
aigne doc update --docs overview.md --feedback "Add more detailed FAQ entries"
|
|
146
133
|
```
|
|
147
134
|
|
|
148
135
|
---
|
|
149
136
|
|
|
150
137
|
## `aigne doc translate`
|
|
151
138
|
|
|
152
|
-
|
|
139
|
+
将现有文档翻译成一种或多种语言。可以以交互方式运行它来选择文档和语言,也可以通过将它们指定为参数以非交互方式运行。
|
|
153
140
|
|
|
154
141
|
### 选项
|
|
155
142
|
|
|
156
|
-
| Option
|
|
157
|
-
|
|
158
|
-
| `--docs`
|
|
159
|
-
| `--langs`
|
|
160
|
-
| `--feedback`
|
|
161
|
-
| `--glossary`
|
|
143
|
+
| Option | Type | Description |
|
|
144
|
+
| ------------ | ----- | ---------------------------------------------------------------------------------------------------------- |
|
|
145
|
+
| `--docs` | array | 要翻译的文档路径列表。可多次使用。 |
|
|
146
|
+
| `--langs` | array | 目标语言代码列表(例如,`zh`、`ja`)。可多次使用。 |
|
|
147
|
+
| `--feedback` | string | 提供反馈以提高翻译质量。 |
|
|
148
|
+
| `--glossary` | string | 词汇表文件的路径,以确保跨语言术语的一致性。使用 `@path/to/glossary.md`。 |
|
|
162
149
|
|
|
163
150
|
### 使用示例
|
|
164
151
|
|
|
165
152
|
**启动交互式翻译会话:**
|
|
153
|
+
|
|
166
154
|
```bash
|
|
167
155
|
aigne doc translate
|
|
168
156
|
```
|
|
169
157
|
|
|
170
158
|
**将特定文档翻译成中文和日文:**
|
|
159
|
+
|
|
171
160
|
```bash
|
|
172
|
-
aigne doc translate --docs
|
|
161
|
+
aigne doc translate --langs zh --langs ja --docs examples.md --docs overview.md
|
|
173
162
|
```
|
|
174
163
|
|
|
175
|
-
|
|
164
|
+
**使用词汇表和反馈进行翻译以获得更好的质量:**
|
|
165
|
+
|
|
176
166
|
```bash
|
|
177
|
-
aigne doc translate --glossary @glossary.md --feedback "
|
|
167
|
+
aigne doc translate --glossary @glossary.md --feedback "Use technical terminology consistently"
|
|
178
168
|
```
|
|
179
169
|
|
|
180
170
|
---
|
|
181
171
|
|
|
182
172
|
## `aigne doc publish`
|
|
183
173
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
将您生成的文档发布到 Discuss Kit 平台。您可以发布到官方的 AIGNE DocSmith 平台,也可以发布到您自己托管的实例。
|
|
174
|
+
将您生成的文档发布到 Discuss Kit 平台。您可以发布到官方的 AIGNE DocSmith 平台或您自己托管的实例。
|
|
187
175
|
|
|
188
176
|
### 选项
|
|
189
177
|
|
|
190
|
-
| Option
|
|
191
|
-
|
|
192
|
-
| `--appUrl` | string |
|
|
178
|
+
| Option | Type | Description |
|
|
179
|
+
| ---------- | ------ | ---------------------------------------------------------------------------------------------------- |
|
|
180
|
+
| `--appUrl` | string | 您自行托管的 Discuss Kit 实例的 URL。如果未提供,该命令将以交互方式运行。 |
|
|
193
181
|
|
|
194
182
|
### 使用示例
|
|
195
183
|
|
|
196
184
|
**启动交互式发布会话:**
|
|
185
|
+
|
|
197
186
|
```bash
|
|
198
187
|
aigne doc publish
|
|
199
188
|
```
|
|
200
189
|
|
|
201
|
-
|
|
190
|
+
**直接发布到自行托管的实例:**
|
|
191
|
+
|
|
202
192
|
```bash
|
|
203
|
-
aigne doc publish --appUrl https://
|
|
193
|
+
aigne doc publish --appUrl https://your-discuss-kit-instance.com
|
|
204
194
|
```
|
|
205
195
|
|
|
206
196
|
---
|
|
207
197
|
|
|
208
198
|
## `aigne doc init`
|
|
209
199
|
|
|
210
|
-
|
|
200
|
+
手动启动交互式配置向导。这对于设置新项目或修改现有项目的配置非常有用。该向导会引导您定义源代码路径、设置输出目录、选择语言以及定义文档的风格和目标受众。
|
|
211
201
|
|
|
212
202
|
### 使用示例
|
|
213
203
|
|
|
214
204
|
**启动设置向导:**
|
|
215
|
-
```bash
|
|
216
|
-
aigne doc init
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
## `aigne doc prefs`
|
|
222
|
-
|
|
223
|
-
管理 DocSmith 随时间从您的反馈中学习到的用户偏好。这些偏好将在未来的生成和更新任务中作为规则应用,以保持与您的风格一致。
|
|
224
|
-
|
|
225
|
-
### 选项
|
|
226
|
-
|
|
227
|
-
| Option | Type | Description |
|
|
228
|
-
|---|---|---|
|
|
229
|
-
| `--list` | boolean | 列出所有已保存的偏好,显示其状态(激活/未激活)、范围和内容。 |
|
|
230
|
-
| `--remove` | boolean | 移除一个或多个偏好。如果未提供 `--id`,则以交互方式运行。 |
|
|
231
|
-
| `--toggle` | boolean | 切换一个或多个偏好的激活状态。如果未提供 `--id`,则以交互方式运行。 |
|
|
232
|
-
| `--id` | array | 为 `--remove` 或 `--toggle` 指定要操作的偏好 ID。可多次使用。 |
|
|
233
205
|
|
|
234
|
-
### 使用示例
|
|
235
|
-
|
|
236
|
-
**列出所有已保存的偏好:**
|
|
237
|
-
```bash
|
|
238
|
-
aigne doc prefs --list
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
**以交互方式选择要移除的偏好:**
|
|
242
206
|
```bash
|
|
243
|
-
aigne doc
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
**通过 ID 切换特定偏好的状态:**
|
|
247
|
-
```bash
|
|
248
|
-
aigne doc prefs --toggle --id <preference-id>
|
|
207
|
+
aigne doc init
|
|
249
208
|
```
|
|
250
209
|
|
|
251
|
-
有关如何根据您的需求定制 DocSmith 的更多详细信息,请参阅[配置指南](./configuration.md)。
|
|
210
|
+
有关如何根据您的需求定制 DocSmith 的更多详细信息,请参阅[配置指南](./configuration.md)。
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
# Interactive Setup
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AIGNE DocSmith includes an interactive setup wizard, launched with the `aigne doc init` command, to streamline project configuration. This guided process asks a series of questions about your documentation goals and generates a `config.yaml` file from your answers. It is the recommended method for starting a new documentation project, as it helps prevent configuration errors and provides specific recommendations based on your inputs.
|
|
4
4
|
|
|
5
5
|
## Running the Wizard
|
|
6
6
|
|
|
7
|
-
To
|
|
7
|
+
To start the process, run the following command in the root directory of your project:
|
|
8
8
|
|
|
9
9
|
```bash aigne doc init icon=lucide:sparkles
|
|
10
10
|
npx aigne doc init
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
The wizard will then
|
|
13
|
+
The wizard will then walk you through an 8-step process to configure your documentation.
|
|
14
14
|
|
|
15
15
|
## The Guided Process
|
|
16
16
|
|
|
17
|
-
The wizard
|
|
17
|
+
The wizard prompts for the following key configuration details:
|
|
18
18
|
|
|
19
|
-
1. **Primary Goal**: Defines the main
|
|
20
|
-
2. **Target Audience**: Specifies
|
|
19
|
+
1. **Primary Goal**: Defines the main purpose for your readers (e.g., getting started, finding answers).
|
|
20
|
+
2. **Target Audience**: Specifies the primary readers of the documentation (e.g., non-technical end-users, developers).
|
|
21
21
|
3. **Reader Knowledge Level**: Assesses the typical starting knowledge of your audience.
|
|
22
|
-
4. **Documentation Depth**: Determines
|
|
22
|
+
4. **Documentation Depth**: Determines the level of detail and scope of the content.
|
|
23
23
|
5. **Primary Language**: Sets the main language for the documentation.
|
|
24
24
|
6. **Translation Languages**: Selects additional languages for translation.
|
|
25
|
-
7. **Output Directory**: Specifies
|
|
25
|
+
7. **Output Directory**: Specifies the location for the generated documentation files.
|
|
26
26
|
8. **Source Code Paths**: Defines which files and directories to analyze, with support for glob patterns.
|
|
27
27
|
|
|
28
28
|
## Assisted Configuration
|
|
29
29
|
|
|
30
|
-
The wizard
|
|
30
|
+
The wizard uses a set of predefined rules to help you create a coherent and effective configuration.
|
|
31
31
|
|
|
32
32
|
```d2
|
|
33
33
|
direction: down
|
|
@@ -38,12 +38,12 @@ User-Selections: {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
Wizard-Engine: {
|
|
41
|
-
label: "2. Wizard's
|
|
41
|
+
label: "2. Wizard's Rule Engine"
|
|
42
42
|
shape: rectangle
|
|
43
43
|
grid-columns: 2
|
|
44
44
|
|
|
45
45
|
Filtering: {
|
|
46
|
-
label: "Option Filtering\n(Prevents
|
|
46
|
+
label: "Option Filtering\n(Prevents incompatible selections)"
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
Conflict-Detection: {
|
|
@@ -70,27 +70,27 @@ Guided-Experience -> User-Selections: "Refines"
|
|
|
70
70
|
|
|
71
71
|
### Default Suggestions and Option Filtering
|
|
72
72
|
|
|
73
|
-
As you
|
|
73
|
+
As you make selections, the wizard provides defaults and filters subsequent options to guide you toward a logical configuration. This is based on a set of cross-question conflict rules.
|
|
74
74
|
|
|
75
75
|
- **Default Suggestions**: If you select "Get started quickly" as your primary goal, the wizard will recommend "Is a total beginner" as the reader's knowledge level.
|
|
76
|
-
- **Real-time Filtering**: If your target audience is "End users (non-technical)," the wizard will hide
|
|
76
|
+
- **Real-time Filtering**: If your target audience is "End users (non-technical)," the wizard will hide the "Is an expert" knowledge level. The rule's reasoning is that non-technical users are typically not experienced technical users, thus preventing an incompatible selection.
|
|
77
77
|
|
|
78
78
|
### Conflict Detection and Resolution
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
In some cases, you may have multiple goals or audiences that require a specific documentation structure to be effective, such as creating documentation for both non-technical **End Users** and expert **Developers**. The wizard identifies these as "resolvable conflicts."
|
|
81
81
|
|
|
82
|
-
It then formulates a strategy to address these
|
|
82
|
+
It then formulates a strategy to address these needs within the document structure. For the End User vs. Developer example, the resolution strategy is to create separate user paths:
|
|
83
83
|
|
|
84
84
|
- **User Guide Path**: Uses plain language, focuses on UI interactions, and is oriented toward business outcomes.
|
|
85
85
|
- **Developer Guide Path**: Is code-first, technically precise, and includes SDK examples and configuration snippets.
|
|
86
86
|
|
|
87
|
-
This approach ensures
|
|
87
|
+
This approach ensures the final documentation is structured to serve multiple audiences effectively, rather than creating a single, confusing mix of content.
|
|
88
88
|
|
|
89
89
|
## Generated Output
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
After you complete the wizard, it saves a `config.yaml` file in your project. This file is fully commented, explaining each option and listing all available choices, which makes it easy to review and modify manually later.
|
|
92
92
|
|
|
93
|
-
Here is a snippet of
|
|
93
|
+
Here is a snippet of a generated file:
|
|
94
94
|
|
|
95
95
|
```yaml config.yaml icon=logos:yaml
|
|
96
96
|
# Project information for documentation publishing
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
# 交互式设置
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AIGNE DocSmith 包含一个交互式设置向导,通过 `aigne doc init` 命令启动,以简化项目配置。该引导过程会询问一系列关于你的文档目标的问题,并根据你的回答生成一个 `config.yaml` 文件。这是启动新文档项目的推荐方法,因为它有助于防止配置错误,并根据你的输入提供具体建议。
|
|
4
4
|
|
|
5
5
|
## 运行向导
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
要开始此过程,请在项目的根目录中运行以下命令:
|
|
8
8
|
|
|
9
9
|
```bash aigne doc init icon=lucide:sparkles
|
|
10
10
|
npx aigne doc init
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
然后,向导将引导你完成一个 8 步流程来配置文档。
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## 引导流程
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
向导会提示输入以下关键配置细节:
|
|
18
18
|
|
|
19
|
-
1.
|
|
20
|
-
2.
|
|
19
|
+
1. **主要目标**:定义读者的主要目的(例如,入门、寻找答案)。
|
|
20
|
+
2. **目标受众**:指明文档的主要读者(例如,非技术最终用户、开发者)。
|
|
21
21
|
3. **读者知识水平**:评估受众的典型初始知识水平。
|
|
22
|
-
4.
|
|
22
|
+
4. **文档深度**:确定内容的详细程度和范围。
|
|
23
23
|
5. **主要语言**:设置文档的主要语言。
|
|
24
|
-
6.
|
|
25
|
-
7.
|
|
24
|
+
6. **翻译语言**:选择其他需要翻译的语言。
|
|
25
|
+
7. **输出目录**:指定生成文档文件的位置。
|
|
26
26
|
8. **源代码路径**:定义要分析的文件和目录,支持 glob 模式。
|
|
27
27
|
|
|
28
28
|
## 辅助配置
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
向导使用一套预定义规则来帮助你创建一致且有效的配置。
|
|
31
31
|
|
|
32
32
|
```d2
|
|
33
33
|
direction: down
|
|
@@ -38,12 +38,12 @@ User-Selections: {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
Wizard-Engine: {
|
|
41
|
-
label: "2.
|
|
41
|
+
label: "2. 向导的规则引擎"
|
|
42
42
|
shape: rectangle
|
|
43
43
|
grid-columns: 2
|
|
44
44
|
|
|
45
45
|
Filtering: {
|
|
46
|
-
label: "
|
|
46
|
+
label: "选项筛选\n(防止不兼容的选择)"
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
Conflict-Detection: {
|
|
@@ -59,61 +59,61 @@ Guided-Experience: {
|
|
|
59
59
|
|
|
60
60
|
Final-Config: {
|
|
61
61
|
label: "4. 最终配置"
|
|
62
|
-
content: "config.yaml
|
|
62
|
+
content: "config.yaml 生成时\n包含冲突解决策略"
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
User-Selections -> Wizard-Engine
|
|
66
66
|
Wizard-Engine.Filtering -> Guided-Experience
|
|
67
67
|
Wizard-Engine.Conflict-Detection -> Final-Config
|
|
68
|
-
Guided-Experience -> User-Selections: "
|
|
68
|
+
Guided-Experience -> User-Selections: "完善"
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
###
|
|
71
|
+
### 默认建议和选项筛选
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
在你进行选择时,向导会提供默认值并筛选后续选项,以引导你进行逻辑配置。这是基于一套跨问题冲突规则。
|
|
74
74
|
|
|
75
|
-
-
|
|
76
|
-
-
|
|
75
|
+
- **默认建议**:如果你选择“快速入门”作为主要目标,向导将推荐“完全是初学者”作为读者的知识水平。
|
|
76
|
+
- **实时筛选**:如果你的目标受众是“最终用户(非技术人员)”,向导将隐藏“是专家”这一知识水平选项。该规则的理由是,非技术用户通常不是经验丰富的技术用户,从而防止不兼容的选择。
|
|
77
77
|
|
|
78
78
|
### 冲突检测与解决
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
在某些情况下,你可能有多个目标或受众,需要特定的文档结构才能有效,例如为非技术的 **最终用户** 和专业的 **开发者** 创建文档。向导将这些识别为“可解决的冲突”。
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
然后,它会制定一个策略来解决文档结构中的这些需求。对于最终用户与开发者的例子,解决策略是创建独立的用户路径:
|
|
83
83
|
|
|
84
|
-
- **用户指南路径**:使用通俗易懂的语言,侧重于 UI
|
|
84
|
+
- **用户指南路径**:使用通俗易懂的语言,侧重于 UI 交互,并以业务成果为导向。
|
|
85
85
|
- **开发者指南路径**:代码优先,技术上精确,并包含 SDK 示例和配置片段。
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
这种方法确保最终的文档结构能够有效地服务于多个受众,而不是创建一个单一、混乱的内容混合体。
|
|
88
88
|
|
|
89
|
-
##
|
|
89
|
+
## 生成输出
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
完成向导后,它会在你的项目中保存一个 `config.yaml` 文件。该文件带有完整的注释,解释了每个选项并列出了所有可用选择,这使得以后手动审查和修改变得容易。
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
以下是生成文件的片段:
|
|
94
94
|
|
|
95
95
|
```yaml config.yaml icon=logos:yaml
|
|
96
96
|
# 用于文档发布的项目信息
|
|
97
97
|
projectName: your-project-name
|
|
98
|
-
projectDesc:
|
|
98
|
+
projectDesc: 你的项目描述。
|
|
99
99
|
projectLogo: ""
|
|
100
100
|
|
|
101
101
|
# =============================================================================
|
|
102
102
|
# 文档配置
|
|
103
103
|
# =============================================================================
|
|
104
104
|
|
|
105
|
-
#
|
|
105
|
+
# 目的:你希望读者实现的主要成果是什么?
|
|
106
106
|
# 可用选项(根据需要取消注释并修改):
|
|
107
107
|
# getStarted - 快速入门:帮助新用户在 30 分钟内从零开始上手
|
|
108
|
-
# completeTasks -
|
|
108
|
+
# completeTasks - 完成特定任务:引导用户了解常见工作流程和用例
|
|
109
109
|
documentPurpose:
|
|
110
110
|
- completeTasks
|
|
111
111
|
- findAnswers
|
|
112
112
|
|
|
113
|
-
#
|
|
113
|
+
# 目标受众:谁会最常阅读本文档?
|
|
114
114
|
# 可用选项(根据需要取消注释并修改):
|
|
115
115
|
# endUsers - 最终用户(非技术人员):使用产品但不编写代码的人
|
|
116
|
-
# developers -
|
|
116
|
+
# developers - 集成你的产品/API 的开发者:将此产品添加到其项目中的工程师
|
|
117
117
|
targetAudienceTypes:
|
|
118
118
|
- endUsers
|
|
119
119
|
- developers
|
|
@@ -123,11 +123,11 @@ targetAudienceTypes:
|
|
|
123
123
|
|
|
124
124
|
## 后续步骤
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
配置文件就绪后,你就可以生成、翻译或发布文档了。
|
|
127
127
|
|
|
128
128
|
<x-cards>
|
|
129
129
|
<x-card data-title="生成文档" data-icon="lucide:play-circle" data-href="/features/generate-documentation">
|
|
130
|
-
|
|
130
|
+
了解如何使用单个命令从源代码自动创建一套完整的文档。
|
|
131
131
|
</x-card>
|
|
132
132
|
<x-card data-title="配置指南" data-icon="lucide:settings" data-href="/configuration">
|
|
133
133
|
深入了解所有可用设置,并学习如何手动微调 config.yaml 文件。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Language Support
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmith uses AI to provide automated documentation translation into 12 languages. This allows you to generate and maintain documentation for a global audience using the `aigne doc translate` command.
|
|
4
4
|
|
|
5
|
-
The translation workflow processes your source documents through
|
|
5
|
+
The translation workflow processes your source documents through an AI engine to generate localized versions in your selected target languages.
|
|
6
6
|
|
|
7
7
|
```d2
|
|
8
8
|
direction: down
|
|
@@ -55,25 +55,25 @@ DocSmith offers AI-powered translations for the following languages. You can def
|
|
|
55
55
|
|
|
56
56
|
## How to Configure and Use Translation
|
|
57
57
|
|
|
58
|
-
Translation languages are set when you initialize your project with `aigne doc init`. You can add new languages or translate documents at any time using the `aigne doc translate` command, which
|
|
58
|
+
Translation languages are set when you initialize your project with `aigne doc init`. You can add new languages or translate documents at any time using the `aigne doc translate` command, which has two modes of operation.
|
|
59
59
|
|
|
60
|
-
### Interactive Mode
|
|
60
|
+
### Interactive Mode for Guided Translation
|
|
61
61
|
|
|
62
|
-
For a guided experience, run the command without any arguments. This is the recommended approach for most users.
|
|
62
|
+
For a step-by-step guided experience, run the command without any arguments. This is the recommended approach for most users.
|
|
63
63
|
|
|
64
64
|
```bash Interactive Translation icon=lucide:wand
|
|
65
65
|
aigne doc translate
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
The interactive mode will then
|
|
68
|
+
The interactive mode will then present a series of prompts that allow you to:
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
1. Select which of your existing documents to translate from a list.
|
|
71
|
+
2. Choose one or more target languages from the supported list.
|
|
72
|
+
3. Add new translation languages to your project's configuration if they are not already included.
|
|
73
73
|
|
|
74
|
-
### Command-Line Arguments
|
|
74
|
+
### Command-Line Arguments for Automation
|
|
75
75
|
|
|
76
|
-
For direct control or for use in automated scripts
|
|
76
|
+
For direct control or for use in automated scripts, you can specify documents and languages directly as command-line arguments. This is ideal for developers and CI/CD pipelines.
|
|
77
77
|
|
|
78
78
|
```bash Command Example icon=lucide:terminal
|
|
79
79
|
# Translate overview.md and examples.md into Chinese and Japanese
|
|
@@ -91,4 +91,4 @@ Key parameters for the command include:
|
|
|
91
91
|
|
|
92
92
|
---
|
|
93
93
|
|
|
94
|
-
This section covers the available languages and how to enable them. For a complete guide on the translation workflow,
|
|
94
|
+
This section covers the available languages and how to enable them. For a complete guide on the translation workflow, see the [Translate Documentation](./features-translate-documentation.md) guide.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# 语言支持
|
|
2
2
|
|
|
3
|
-
AIGNE DocSmith 提供 12
|
|
3
|
+
AIGNE DocSmith 使用 AI 提供 12 种语言的自动化文档翻译。这使您可以使用 `aigne doc translate` 命令为全球用户生成和维护文档。
|
|
4
4
|
|
|
5
|
-
翻译工作流通过
|
|
5
|
+
翻译工作流通过 AI 引擎处理您的源文档,以生成您所选目标语言的本地化版本。
|
|
6
6
|
|
|
7
7
|
```d2
|
|
8
8
|
direction: down
|
|
@@ -18,7 +18,7 @@ AI-Engine: {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
Translated-Docs: {
|
|
21
|
-
label: "
|
|
21
|
+
label: "翻译后的文档"
|
|
22
22
|
shape: rectangle
|
|
23
23
|
grid-columns: 3
|
|
24
24
|
|
|
@@ -36,11 +36,11 @@ AI-Engine -> Translated-Docs: "生成"
|
|
|
36
36
|
|
|
37
37
|
## 支持的语言
|
|
38
38
|
|
|
39
|
-
DocSmith 为以下语言提供 AI
|
|
39
|
+
DocSmith 为以下语言提供 AI 翻译。您可以在初始设置期间定义项目的主要语言,并选择任意数量的目标语言进行翻译。
|
|
40
40
|
|
|
41
41
|
| 语言 | 语言代码 | 示例文本 |
|
|
42
42
|
|---|---|---|
|
|
43
|
-
|
|
|
43
|
+
| English | `en` | Hello |
|
|
44
44
|
| 简体中文 | `zh` | 你好 |
|
|
45
45
|
| 繁體中文 | `zh-TW` | 你好 |
|
|
46
46
|
| 日本語 | `ja` | こんにちは |
|
|
@@ -53,27 +53,27 @@ DocSmith 为以下语言提供 AI 翻译功能。你可以在初始设置期间
|
|
|
53
53
|
| Italiano | `it` | Ciao |
|
|
54
54
|
| العربية | `ar` | مرحبا |
|
|
55
55
|
|
|
56
|
-
##
|
|
56
|
+
## 如何配置和使用翻译
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
翻译语言在您使用 `aigne doc init` 初始化项目时设置。您可以随时使用 `aigne doc translate` 命令添加新语言或翻译文档,该命令有两种操作模式。
|
|
59
59
|
|
|
60
|
-
###
|
|
60
|
+
### 用于引导式翻译的交互模式
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
要获得分步指导体验,请在不带任何参数的情况下运行该命令。这是推荐给大多数用户的方法。
|
|
63
63
|
|
|
64
64
|
```bash Interactive Translation icon=lucide:wand
|
|
65
65
|
aigne doc translate
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
然后,交互模式将显示一系列提示,允许您:
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
1. 从列表中选择要翻译的现有文档。
|
|
71
|
+
2. 从支持的列表中选择一个或多个目标语言。
|
|
72
|
+
3. 如果项目中尚未包含新的翻译语言,则将其添加到项目配置中。
|
|
73
73
|
|
|
74
|
-
###
|
|
74
|
+
### 用于自动化的命令行参数
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
为了直接控制或在自动化脚本中使用,您可以直接将文档和语言指定为命令行参数。这对于开发人员和 CI/CD 流水线非常理想。
|
|
77
77
|
|
|
78
78
|
```bash Command Example icon=lucide:terminal
|
|
79
79
|
# 将 overview.md 和 examples.md 翻译成中文和日文
|
|
@@ -84,11 +84,11 @@ aigne doc translate --langs zh --langs ja --docs overview.md --docs examples.md
|
|
|
84
84
|
|
|
85
85
|
| 参数 | 描述 |
|
|
86
86
|
|---|---|
|
|
87
|
-
| `--langs` |
|
|
88
|
-
| `--docs` | 指定要翻译的文档路径(例如 `overview.md
|
|
89
|
-
| `--feedback` |
|
|
90
|
-
| `--glossary` | 使用自定义术语表文件(例如 `@path/to/glossary.md
|
|
87
|
+
| `--langs` | 指定目标语言代码。此标志可多次使用以选择多种语言。 |
|
|
88
|
+
| `--docs` | 指定要翻译的文档路径(例如 `overview.md`)。此标志也可以多次使用。 |
|
|
89
|
+
| `--feedback` | 提供具体说明以指导翻译模型(例如 `"Use a formal tone"`)。 |
|
|
90
|
+
| `--glossary` | 使用自定义术语表文件(例如 `@path/to/glossary.md`)以确保项目特定术语的翻译一致。 |
|
|
91
91
|
|
|
92
92
|
---
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
本节介绍了可用的语言以及如何启用它们。有关翻译工作流的完整指南,请参阅[翻译文档](./features-translate-documentation.md)指南。
|