@aigne/doc-smith 0.8.9 → 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.
Files changed (48) hide show
  1. package/.aigne/doc-smith/config.yaml +3 -1
  2. package/.aigne/doc-smith/preferences.yml +4 -4
  3. package/.aigne/doc-smith/upload-cache.yaml +180 -0
  4. package/.github/workflows/release.yml +6 -2
  5. package/.release-please-manifest.json +3 -0
  6. package/CHANGELOG.md +20 -0
  7. package/LICENSE +93 -0
  8. package/README.md +6 -2
  9. package/RELEASE.md +10 -0
  10. package/agents/generate/check-need-generate-structure.mjs +40 -18
  11. package/agents/generate/index.yaml +1 -0
  12. package/agents/generate/user-review-document-structure.mjs +168 -0
  13. package/agents/update/generate-and-translate-document.yaml +3 -3
  14. package/agents/utils/check-feedback-refiner.mjs +2 -0
  15. package/agents/utils/save-docs.mjs +16 -22
  16. package/aigne.yaml +1 -0
  17. package/docs/advanced-how-it-works.md +26 -24
  18. package/docs/advanced-how-it-works.zh.md +32 -30
  19. package/docs/advanced-quality-assurance.md +6 -9
  20. package/docs/advanced-quality-assurance.zh.md +19 -22
  21. package/docs/cli-reference.md +35 -76
  22. package/docs/cli-reference.zh.md +48 -89
  23. package/docs/configuration-interactive-setup.md +18 -18
  24. package/docs/configuration-interactive-setup.zh.md +33 -33
  25. package/docs/configuration-language-support.md +12 -12
  26. package/docs/configuration-language-support.zh.md +20 -20
  27. package/docs/configuration-llm-setup.md +14 -13
  28. package/docs/configuration-llm-setup.zh.md +16 -15
  29. package/docs/configuration-preferences.md +22 -27
  30. package/docs/configuration-preferences.zh.md +35 -40
  31. package/docs/configuration.md +31 -45
  32. package/docs/configuration.zh.md +48 -62
  33. package/docs/features-generate-documentation.md +6 -7
  34. package/docs/features-generate-documentation.zh.md +21 -22
  35. package/docs/features-publish-your-docs.md +38 -30
  36. package/docs/features-publish-your-docs.zh.md +45 -37
  37. package/docs/features-translate-documentation.md +14 -74
  38. package/docs/features-translate-documentation.zh.md +19 -79
  39. package/docs/features-update-and-refine.md +19 -18
  40. package/docs/features-update-and-refine.zh.md +33 -32
  41. package/docs-mcp/get-docs-structure.mjs +1 -1
  42. package/package.json +3 -3
  43. package/prompts/detail/document-rules.md +1 -1
  44. package/prompts/structure/check-document-structure.md +11 -15
  45. package/release-please-config.json +13 -0
  46. package/tests/agents/generate/check-need-generate-structure.test.mjs +21 -24
  47. package/tests/agents/generate/user-review-document-structure.test.mjs +294 -0
  48. package/utils/auth-utils.mjs +2 -2
@@ -1,8 +1,8 @@
1
1
  # 质量保证
2
2
 
3
- 为确保所有生成的文档功能正常、清晰且专业,DocSmith 引入了自动化的质量保证流程。该流程会对 Markdown 内容执行一系列检查,以便在发布前检测并报告从链接失效到图表格式错误等常见问题。
3
+ 为确保所有生成的文档功能正常、清晰且专业,DocSmith 集成了一个自动化的质量保证流程。该流程会对 Markdown 内容执行一系列检查,以便在发布前检测并报告从损坏的链接到格式错误的图表等常见问题。
4
4
 
5
- 该自动化流程会验证内容结构、链接、媒体和语法,以保持一致的质量标准。
5
+ 此自动化管道会验证内容结构、链接、媒体和语法,以保持一致的质量标准。
6
6
 
7
7
  ```d2
8
8
  direction: down
@@ -13,7 +13,7 @@ Input-Markdown-Content: {
13
13
  }
14
14
 
15
15
  QA-Pipeline: {
16
- label: "质量保证流程"
16
+ label: "质量保证管道"
17
17
  shape: rectangle
18
18
  grid-columns: 1
19
19
  grid-gap: 50
@@ -23,7 +23,7 @@ QA-Pipeline: {
23
23
  shape: rectangle
24
24
  grid-columns: 2
25
25
  Completeness: "确保内容未被截断"
26
- Code-Blocks: "验证代码块语法和缩进"
26
+ Code-Blocks: "验证块语法和缩进"
27
27
  }
28
28
 
29
29
  Content-Validation: {
@@ -40,7 +40,6 @@ QA-Pipeline: {
40
40
  shape: rectangle
41
41
  grid-columns: 2
42
42
  D2-Diagrams: "验证 D2 语法"
43
- Mermaid-Diagrams: "验证 Mermaid 语法"
44
43
  Markdown-Linting: "强制执行样式规则"
45
44
  }
46
45
  }
@@ -60,40 +59,38 @@ DocSmith 的质量保证流程涵盖了几个关键领域,以确保文档的
60
59
 
61
60
  #### 内容结构与完整性
62
61
 
63
- DocSmith 会执行多项检查以确保内容的结构完整性:
62
+ DocSmith 会执行多项检查,以确保内容的结构完整性:
64
63
 
65
- - **不完整的代码块**:检测以 ```` ``` ```` 开头但未关闭的代码块。
66
- - **缺少换行符**:识别显示在单行上的内容,这可能表示缺少换行符。
64
+ - **代码块不完整**:检测以 ` ``` ` 开头但未关闭的代码块。
65
+ - **缺少换行符**:识别出现在单行上的内容,这可能表示缺少换行符。
67
66
  - **内容结尾**:验证内容是否以适当的标点符号(例如 `.`、`)`、`|`、`>`)结尾,以防止输出被截断。
67
+ - **代码块缩进**:分析代码块中不一致的缩进。如果某行代码的缩进小于起始的 ` ``` ` 标记,可能会导致渲染问题。此项检查有助于保持正确的代码呈现。
68
68
 
69
- #### 链接和媒体完整性
69
+ #### 链接与媒体完整性
70
70
 
71
- - **链接完整性**:文档中的所有相对链接都会根据项目的 `structurePlan` 进行验证,以防止出现死链接。这确保了所有内部导航都能正常工作。检查程序会忽略外部链接(以 `http://` 或 `https://` 开头)和 `mailto:` 链接。
71
+ - **链接完整性**:文档中的所有相对链接都会根据文档结构计划进行验证,以防止出现死链接。这确保了所有内部导航都能正常工作。检查器会忽略外部链接(以 `http://` 或 `https://` 开头)和 `mailto:` 链接。
72
72
 
73
- - **图片验证**:为避免图片损坏,检查程序会验证文档中引用的任何本地图片文件是否存在于文件系统中。它会解析相对路径和绝对路径以确认文件存在。外部图片 URL 和数据 URL 不会被检查。
73
+ - **图片验证**:为避免图片损坏,检查器会验证文档中引用的任何本地图片文件是否存在于文件系统中。它会解析相对路径和绝对路径,以确认文件存在。外部图片 URL 和数据 URL 不会被检查。
74
74
 
75
75
  #### 图表语法验证
76
76
 
77
- - **D2 图表**:DocSmith 通过将代码发送到渲染服务来验证 D2 图表语法。此过程会确认图表能否成功编译为 SVG 图片,从而在导致图形损坏前捕获任何语法错误。
77
+ - **D2 图表**:DocSmith 通过尝试将代码编译成 SVG 图片来验证 D2 图表语法。这个过程可以在语法错误导致图形损坏之前捕获它们。
78
78
 
79
- - **Mermaid 图表**:Mermaid 图表会经过多项检查:一次主语法验证,以及针对已知会导致渲染问题的模式的特定检查,例如节点标签内的反引号或编号列表,以及需要加引号但未加的特殊字符。
79
+ #### 格式与样式强制
80
80
 
81
- #### 格式化与样式强制
82
-
83
- - **表格格式化**:检查表格的表头、分隔线和数据行之间的列数是否不匹配。此检查可防止常见的表格渲染失败。
84
-
85
- - **代码块缩进**:检查程序会分析代码块中不一致的缩进。如果某行代码的缩进小于开头的 ```` ``` ```` 标记,可能会导致渲染问题。此检查有助于保持正确的代码呈现。
81
+ - **表格格式**:检查表格的表头、分隔线和数据行之间的列数是否不匹配。此项检查可防止常见的表格渲染失败。
86
82
 
87
83
  - **Markdown Linting**:内置的 linter 会强制执行一致的 Markdown 结构。关键规则包括:
88
84
 
89
85
  | 规则 ID | 描述 |
90
86
  |---|---|
91
- | `no-duplicate-headings` | 防止同一节中出现内容相同的多个标题。 |
92
- | `no-undefined-references` | 确保所有链接和图片引用都已定义。 |
87
+ | `no-duplicate-headings` | 防止在同一部分中出现内容相同的多个标题。 |
88
+ | `no-undefined-references` | 确保所有的链接和图片引用都已定义。 |
89
+ | `no-unused-definitions` | 标记未使用的链接或图片定义。 |
93
90
  | `no-heading-content-indent` | 不允许在标题内容前缩进。 |
94
91
  | `no-multiple-toplevel-headings` | 每个文档只允许一个顶级标题 (H1)。 |
95
- | `code-block-style` | 强制代码块使用一致的样式(例如,使用反引号)。 |
92
+ | `code-block-style` | 对代码块强制执行一致的样式(例如,使用反引号)。 |
96
93
 
97
94
  通过自动化这些检查,DocSmith 保持了文档的一致标准,确保最终输出准确且易于导航。
98
95
 
99
- 要了解有关整体架构的更多信息,请参阅 [工作原理](./advanced-how-it-works.md) 部分。
96
+ 要了解有关整体架构的更多信息,请参阅 [工作原理](./advanced-how-it-works.md) 部分。
@@ -54,11 +54,6 @@ End: {
54
54
  style.fill: "#a2eeaf"
55
55
  }
56
56
 
57
- prefs: {
58
- label: "aigne doc prefs\n(Manage Learned Rules)"
59
- shape: cylinder
60
- }
61
-
62
57
  Start -> init: "Optional" {
63
58
  style.stroke-dash: 4
64
59
  }
@@ -68,50 +63,44 @@ generate -> refinement-cycle: "Refine"
68
63
  refinement-cycle -> publish: "Ready"
69
64
  generate -> publish: "Direct Deploy"
70
65
  publish -> End
71
-
72
- prefs <-> generate: "Influences" {
73
- style.stroke-dash: 2
74
- }
75
- prefs <-> refinement-cycle: "Influences" {
76
- style.stroke-dash: 2
77
- }
78
66
  ```
79
67
 
80
68
  ---
81
69
 
82
70
  ## `aigne doc generate`
83
71
 
84
- **Aliases:** `gen`, `g`
85
-
86
72
  Analyzes your source code and generates a complete set of documentation based on your configuration. If no configuration is found, it automatically launches the interactive setup wizard.
87
73
 
88
74
  ### Options
89
75
 
90
- | Option | Type | Description |
91
- |---|---|---|
92
- | `--feedback` | string | Provides feedback to adjust and refine the overall documentation structure. |
93
- | `--forceRegenerate` | boolean | Discards existing content and regenerates all documentation from scratch. |
94
- | `--model` | string | Specifies a particular LLM to use for generation (e.g., `openai:gpt-4o`). Overrides the default model. |
95
- | `--glossary` | string | Path to a glossary file for consistent terminology. Use the format `@path/to/glossary.md`. |
76
+ | Option | Type | Description |
77
+ | ------------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
78
+ | `--feedback` | string | Provides feedback to adjust and refine the overall documentation structure. |
79
+ | `--forceRegenerate` | boolean | Discards existing content and regenerates all documentation from scratch. |
80
+ | `--model` | string | Specifies a particular large language model to use for generation (e.g., `openai:gpt-4o`). Overrides the default. |
96
81
 
97
82
  ### Usage Examples
98
83
 
99
- **Generate documentation for the first time or update it:**
84
+ **Generate or update documentation:**
85
+
100
86
  ```bash
101
87
  aigne doc generate
102
88
  ```
103
89
 
104
90
  **Force a complete regeneration of all documents:**
91
+
105
92
  ```bash
106
93
  aigne doc generate --forceRegenerate
107
94
  ```
108
95
 
109
96
  **Refine the document structure with feedback:**
97
+
110
98
  ```bash
111
99
  aigne doc generate --feedback "Add a new section for API examples and remove the 'About' page."
112
100
  ```
113
101
 
114
102
  **Generate using a specific model from AIGNE Hub:**
103
+
115
104
  ```bash
116
105
  aigne doc generate --model google:gemini-1.5-flash
117
106
  ```
@@ -120,29 +109,27 @@ aigne doc generate --model google:gemini-1.5-flash
120
109
 
121
110
  ## `aigne doc update`
122
111
 
123
- **Alias:** `up`
124
-
125
112
  Optimizes and regenerates specific documents. You can run it interactively to select documents or specify them directly with options. This is useful for making targeted improvements based on feedback without regenerating the entire project.
126
113
 
127
114
  ### Options
128
115
 
129
- | Option | Type | Description |
130
- |---|---|---|
131
- | `--docs` | array | A list of document paths to regenerate (e.g., `--docs overview.md`). Can be used multiple times. |
132
- | `--feedback` | string | Provides specific feedback to improve the content of the selected document(s). |
133
- | `--glossary` | string | Path to a glossary file for consistent terminology. Use the format `@path/to/glossary.md`. |
134
- | `--reset` | boolean | Ignores previous results and regenerates content from scratch for the selected documents. |
116
+ | Option | Type | Description |
117
+ | ---------- | ----- | ------------------------------------------------------------------------------------------- |
118
+ | `--docs` | array | A list of document paths to regenerate. Can be used multiple times. |
119
+ | `--feedback` | string | Provides specific feedback to improve the content of the selected document(s). |
135
120
 
136
121
  ### Usage Examples
137
122
 
138
- **Start an interactive session to select which document to update:**
123
+ **Start an interactive session to select a document to update:**
124
+
139
125
  ```bash
140
126
  aigne doc update
141
127
  ```
142
128
 
143
129
  **Update a specific document with targeted feedback:**
130
+
144
131
  ```bash
145
- aigne doc update --docs /cli-reference --feedback "Clarify the difference between the --docs and --langs options."
132
+ aigne doc update --docs overview.md --feedback "Add more detailed FAQ entries"
146
133
  ```
147
134
 
148
135
  ---
@@ -153,54 +140,57 @@ Translates existing documentation into one or more languages. It can be run inte
153
140
 
154
141
  ### Options
155
142
 
156
- | Option | Type | Description |
157
- |---|---|---|
158
- | `--docs` | array | A list of document paths to translate. Can be used multiple times. |
159
- | `--langs` | array | A list of target language codes (e.g., `zh`, `ja`, `es`). Can be used multiple times. |
160
- | `--feedback` | string | Provides feedback to improve the quality of the translation. |
161
- | `--glossary` | string | Path to a glossary file to ensure consistent terminology across languages. Use `@path/to/glossary.md`. |
143
+ | Option | Type | Description |
144
+ | ------------ | ----- | ---------------------------------------------------------------------------------------------------------- |
145
+ | `--docs` | array | A list of document paths to translate. Can be used multiple times. |
146
+ | `--langs` | array | A list of target language codes (e.g., `zh`, `ja`). Can be used multiple times. |
147
+ | `--feedback` | string | Provides feedback to improve the quality of the translation. |
148
+ | `--glossary` | string | Path to a glossary file to ensure consistent terminology across languages. Use `@path/to/glossary.md`. |
162
149
 
163
150
  ### Usage Examples
164
151
 
165
152
  **Start an interactive translation session:**
153
+
166
154
  ```bash
167
155
  aigne doc translate
168
156
  ```
169
157
 
170
158
  **Translate specific documents into Chinese and Japanese:**
159
+
171
160
  ```bash
172
- aigne doc translate --docs overview.md --docs getting-started.md --langs zh --langs ja
161
+ aigne doc translate --langs zh --langs ja --docs examples.md --docs overview.md
173
162
  ```
174
163
 
175
164
  **Translate with a glossary and feedback for better quality:**
165
+
176
166
  ```bash
177
- aigne doc translate --glossary @glossary.md --feedback "Use formal language for the Japanese translation."
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
- **Aliases:** `pub`, `p`
185
-
186
174
  Publishes your generated documentation to a Discuss Kit platform. You can publish to the official AIGNE DocSmith platform or to your own self-hosted instance.
187
175
 
188
176
  ### Options
189
177
 
190
- | Option | Type | Description |
191
- |---|---|---|
178
+ | Option | Type | Description |
179
+ | ---------- | ------ | ---------------------------------------------------------------------------------------------------- |
192
180
  | `--appUrl` | string | The URL of your self-hosted Discuss Kit instance. If not provided, the command runs interactively. |
193
181
 
194
182
  ### Usage Examples
195
183
 
196
184
  **Start an interactive publishing session:**
185
+
197
186
  ```bash
198
187
  aigne doc publish
199
188
  ```
200
189
 
201
190
  **Publish directly to a self-hosted instance:**
191
+
202
192
  ```bash
203
- aigne doc publish --appUrl https://docs.my-company.com
193
+ aigne doc publish --appUrl https://your-discuss-kit-instance.com
204
194
  ```
205
195
 
206
196
  ---
@@ -212,40 +202,9 @@ Manually starts the interactive configuration wizard. This is useful for setting
212
202
  ### Usage Example
213
203
 
214
204
  **Launch the setup wizard:**
215
- ```bash
216
- aigne doc init
217
- ```
218
-
219
- ---
220
-
221
- ## `aigne doc prefs`
222
-
223
- Manages user preferences that DocSmith learns from your feedback over time. These preferences are applied as rules in future generation and update tasks to maintain consistency with your style.
224
-
225
- ### Options
226
-
227
- | Option | Type | Description |
228
- |---|---|---|
229
- | `--list` | boolean | Lists all saved preferences, showing their status (active/inactive), scope, and content. |
230
- | `--remove` | boolean | Removes one or more preferences. Runs interactively if `--id` is not provided. |
231
- | `--toggle` | boolean | Toggles the active status of one or more preferences. Runs interactively if `--id` is not provided. |
232
- | `--id` | array | Specifies the preference ID(s) to act upon for `--remove` or `--toggle`. Can be used multiple times. |
233
205
 
234
- ### Usage Examples
235
-
236
- **List all your saved preferences:**
237
- ```bash
238
- aigne doc prefs --list
239
- ```
240
-
241
- **Interactively select preferences to remove:**
242
206
  ```bash
243
- aigne doc prefs --remove
244
- ```
245
-
246
- **Toggle the status of a specific preference by its ID:**
247
- ```bash
248
- aigne doc prefs --toggle --id <preference-id>
207
+ aigne doc init
249
208
  ```
250
209
 
251
210
  For more details on how to tailor DocSmith to your needs, see the [Configuration Guide](./configuration.md).
@@ -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 CLI 命令创建和维护文档的典型生命周期:
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 | Type | Description |
91
- |---|---|---|
92
- | `--feedback` | string | 提供反馈以调整和优化整体文档结构规划。 |
93
- | `--forceRegenerate` | boolean | 丢弃现有内容,从头开始重新生成所有文档。 |
94
- | `--model` | string | 指定用于生成的特定 LLM(例如,`openai:gpt-4o`)。此选项将覆盖默认模型。 |
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 " API 示例添加一个新部分,并删除‘关于’页面。"
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
- **别名:** `up`
124
-
125
- 优化并重新生成特定文档。您可以以交互方式运行以选择文档,或直接使用选项指定文档。此命令对于根据反馈进行有针对性的改进非常有用,无需重新生成整个项目。
112
+ 优化并重新生成特定文档。您可以以交互方式运行它来选择文档,或直接使用选项指定文档。这对于根据反馈进行有针对性的改进非常有用,而无需重新生成整个项目。
126
113
 
127
114
  ### 选项
128
115
 
129
- | Option | Type | Description |
130
- |---|---|---|
131
- | `--docs` | array | 要重新生成的文档路径列表(例如,`--docs overview.md`)。可多次使用。 |
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 /cli-reference --feedback "阐明 --docs --langs 选项之间的区别。"
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 | Type | Description |
157
- |---|---|---|
158
- | `--docs` | array | 要翻译的文档路径列表。可多次使用。 |
159
- | `--langs` | array | 目标语言代码列表(例如,`zh`、`ja`、`es`)。可多次使用。 |
160
- | `--feedback` | string | 提供反馈以提高翻译质量。 |
161
- | `--glossary` | string | 用于确保跨语言术语一致性的术语表文件路径。使用 `@path/to/glossary.md`。 |
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 overview.md --docs getting-started.md --langs zh --langs ja
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
- **别名:** `pub`, `p`
185
-
186
- 将您生成的文档发布到 Discuss Kit 平台。您可以发布到官方的 AIGNE DocSmith 平台,也可以发布到您自己托管的实例。
174
+ 将您生成的文档发布到 Discuss Kit 平台。您可以发布到官方的 AIGNE DocSmith 平台或您自己托管的实例。
187
175
 
188
176
  ### 选项
189
177
 
190
- | Option | Type | Description |
191
- |---|---|---|
192
- | `--appUrl` | string | 您自托管的 Discuss Kit 实例的 URL。如果未提供,该命令将以交互方式运行。 |
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://docs.my-company.com
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 prefs --remove
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)。