@aigne/doc-smith 0.7.0 → 0.7.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 (44) hide show
  1. package/.aigne/doc-smith/config.yaml +70 -0
  2. package/.aigne/doc-smith/output/structure-plan.json +152 -0
  3. package/.aigne/doc-smith/preferences.yml +31 -0
  4. package/.aigne/doc-smith/upload-cache.yaml +288 -0
  5. package/CHANGELOG.md +7 -0
  6. package/README.md +33 -15
  7. package/agents/input-generator.mjs +10 -20
  8. package/docs/_sidebar.md +17 -0
  9. package/docs/advanced-how-it-works.md +104 -0
  10. package/docs/advanced-how-it-works.zh.md +104 -0
  11. package/docs/advanced-quality-assurance.md +64 -0
  12. package/docs/advanced-quality-assurance.zh.md +64 -0
  13. package/docs/advanced.md +28 -0
  14. package/docs/advanced.zh.md +28 -0
  15. package/docs/changelog.md +272 -0
  16. package/docs/changelog.zh.md +272 -0
  17. package/docs/cli-reference.md +185 -0
  18. package/docs/cli-reference.zh.md +185 -0
  19. package/docs/configuration-interactive-setup.md +82 -0
  20. package/docs/configuration-interactive-setup.zh.md +82 -0
  21. package/docs/configuration-language-support.md +64 -0
  22. package/docs/configuration-language-support.zh.md +64 -0
  23. package/docs/configuration-llm-setup.md +90 -0
  24. package/docs/configuration-llm-setup.zh.md +90 -0
  25. package/docs/configuration-preferences.md +122 -0
  26. package/docs/configuration-preferences.zh.md +123 -0
  27. package/docs/configuration.md +173 -0
  28. package/docs/configuration.zh.md +173 -0
  29. package/docs/features-generate-documentation.md +82 -0
  30. package/docs/features-generate-documentation.zh.md +82 -0
  31. package/docs/features-publish-your-docs.md +98 -0
  32. package/docs/features-publish-your-docs.zh.md +98 -0
  33. package/docs/features-translate-documentation.md +83 -0
  34. package/docs/features-translate-documentation.zh.md +83 -0
  35. package/docs/features-update-and-refine.md +86 -0
  36. package/docs/features-update-and-refine.zh.md +86 -0
  37. package/docs/features.md +56 -0
  38. package/docs/features.zh.md +56 -0
  39. package/docs/getting-started.md +74 -0
  40. package/docs/getting-started.zh.md +74 -0
  41. package/docs/overview.md +48 -0
  42. package/docs/overview.zh.md +48 -0
  43. package/media.md +19 -0
  44. package/package.json +1 -1
@@ -0,0 +1,185 @@
1
+ ---
2
+ labels: ["Reference"]
3
+ ---
4
+
5
+ # CLI Command Reference
6
+
7
+ This guide provides a comprehensive reference for all available `aigne doc` sub-commands, their arguments, and options. It's designed for users who want to understand the full capabilities of the command-line interface.
8
+
9
+ The general syntax is:
10
+
11
+ ```bash
12
+ aigne doc <command> [options]
13
+ ```
14
+
15
+ ---
16
+
17
+ ## `aigne doc generate`
18
+
19
+ **Aliases:** `gen`, `g`
20
+
21
+ Automatically analyzes your source code and generates a complete set of documentation based on your configuration. If no configuration is found, it will automatically launch the interactive setup wizard.
22
+
23
+ ### Options
24
+
25
+ | Option | Type | Description |
26
+ |---|---|---|
27
+ | `--feedback` | string | Provides feedback to adjust and refine the overall document structure plan. |
28
+ | `--forceRegenerate` | boolean | Discards existing content and regenerates all documentation from scratch. |
29
+ | `--model` | string | Specifies a particular LLM to use for generation (e.g., `openai:gpt-4o`, `claude:claude-3-5-sonnet`). Overrides the default model. |
30
+ | `--glossary` | string | Path to a glossary file for consistent terminology. Use the format `@path/to/glossary.md`. |
31
+
32
+ ### Usage Examples
33
+
34
+ **Generate documentation for the first time or update it:**
35
+ ```bash
36
+ aigne doc generate
37
+ ```
38
+
39
+ **Force a complete regeneration of all documents:**
40
+ ```bash
41
+ aigne doc generate --forceRegenerate
42
+ ```
43
+
44
+ **Refine the document structure with feedback:**
45
+ ```bash
46
+ aigne doc generate --feedback "Add a new section for API examples and remove the 'About' page."
47
+ ```
48
+
49
+ **Generate using a specific model from AIGNE Hub:**
50
+ ```bash
51
+ aigne doc generate --model google:gemini-1.5-flash
52
+ ```
53
+
54
+ ---
55
+
56
+ ## `aigne doc update`
57
+
58
+ **Alias:** `up`
59
+
60
+ 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.
61
+
62
+ ### Options
63
+
64
+ | Option | Type | Description |
65
+ |---|---|---|
66
+ | `--docs` | array | A list of document paths to regenerate (e.g., `--docs overview.md --docs /features/authentication.md`). |
67
+ | `--feedback` | string | Provides specific feedback to improve the content of the selected document(s). |
68
+ | `--glossary` | string | Path to a glossary file for consistent terminology. Use the format `@path/to/glossary.md`. |
69
+
70
+ ### Usage Examples
71
+
72
+ **Start an interactive session to select which document to update:**
73
+ ```bash
74
+ aigne doc update
75
+ ```
76
+
77
+ **Update a specific document with targeted feedback:**
78
+ ```bash
79
+ aigne doc update --docs /cli-reference.md --feedback "Clarify the difference between the --docs and --langs options."
80
+ ```
81
+
82
+ ---
83
+
84
+ ## `aigne doc translate`
85
+
86
+ Translates existing documentation into one or more languages. It can be run interactively to select documents and languages, or non-interactively by specifying them as arguments.
87
+
88
+ ### Options
89
+
90
+ | Option | Type | Description |
91
+ |---|---|---|
92
+ | `--docs` | array | A list of document paths to translate. If omitted in interactive mode, you can select them. |
93
+ | `--langs` | array | A list of target language codes (e.g., `zh`, `ja`, `es`). If omitted, you can select them interactively. |
94
+ | `--feedback` | string | Provides feedback to improve the quality of the translation. |
95
+ | `--glossary` | string | Path to a glossary file to ensure consistent terminology across languages. Use `@path/to/glossary.md`. |
96
+
97
+ ### Usage Examples
98
+
99
+ **Start an interactive translation session:**
100
+ ```bash
101
+ aigne doc translate
102
+ ```
103
+
104
+ **Translate specific documents into Chinese and Japanese:**
105
+ ```bash
106
+ aigne doc translate --docs overview.md --docs getting-started.md --langs zh --langs ja
107
+ ```
108
+
109
+ **Translate with a glossary and feedback for better quality:**
110
+ ```bash
111
+ aigne doc translate --glossary @glossary.md --feedback "Use formal language for the Japanese translation."
112
+ ```
113
+
114
+ ---
115
+
116
+ ## `aigne doc publish`
117
+
118
+ **Aliases:** `pub`, `p`
119
+
120
+ 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.
121
+
122
+ ### Options
123
+
124
+ | Option | Type | Description |
125
+ |---|---|---|
126
+ | `--appUrl` | string | The URL of your self-hosted Discuss Kit instance. If not provided, the command runs interactively, allowing you to choose between the official platform and a custom URL. |
127
+
128
+ ### Usage Examples
129
+
130
+ **Start an interactive publishing session:**
131
+ ```bash
132
+ aigne doc publish
133
+ ```
134
+
135
+ **Publish directly to a self-hosted instance:**
136
+ ```bash
137
+ aigne doc publish --appUrl https://docs.my-company.com
138
+ ```
139
+
140
+ ---
141
+
142
+ ## `aigne doc init`
143
+
144
+ Manually starts the interactive configuration wizard. This is useful for setting up a new project or modifying the configuration of an existing one. The wizard guides you through defining source code paths, setting output directories, choosing languages, and defining the documentation's style and target audience.
145
+
146
+ ### Usage Example
147
+
148
+ **Launch the setup wizard:**
149
+ ```bash
150
+ aigne doc init
151
+ ```
152
+
153
+ ---
154
+
155
+ ## `aigne doc prefs`
156
+
157
+ 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.
158
+
159
+ ### Options
160
+
161
+ | Option | Type | Description |
162
+ |---|---|---|
163
+ | `--list` | boolean | Lists all saved preferences, showing their status (active/inactive), scope, and content. |
164
+ | `--remove` | boolean | Removes one or more preferences. Runs interactively if `--id` is not provided. |
165
+ | `--toggle` | boolean | Toggles the active status of one or more preferences. Runs interactively if `--id` is not provided. |
166
+ | `--id` | array | Specifies the preference ID(s) to act upon for `--remove` or `--toggle`. |
167
+
168
+ ### Usage Examples
169
+
170
+ **List all your saved preferences:**
171
+ ```bash
172
+ aigne doc prefs --list
173
+ ```
174
+
175
+ **Interactively select preferences to remove:**
176
+ ```bash
177
+ aigne doc prefs --remove
178
+ ```
179
+
180
+ **Toggle the status of a specific preference by its ID:**
181
+ ```bash
182
+ aigne doc prefs --toggle --id <preference-id>
183
+ ```
184
+
185
+ For more details on how to tailor DocSmith to your needs, see the [Configuration Guide](./configuration.md).
@@ -0,0 +1,185 @@
1
+ ---
2
+ labels: ["Reference"]
3
+ ---
4
+
5
+ # CLI 命令参考
6
+
7
+ 本指南为所有可用的 `aigne doc` 子命令及其参数和选项提供了全面的参考。它专为希望了解命令行界面全部功能的用户设计。
8
+
9
+ 通用语法如下:
10
+
11
+ ```bash
12
+ aigne doc <command> [options]
13
+ ```
14
+
15
+ ---
16
+
17
+ ## `aigne doc generate`
18
+
19
+ **别名:** `gen`, `g`
20
+
21
+ 自动分析您的源代码,并根据您的配置生成一整套文档。如果未找到配置,它将自动启动交互式设置向导。
22
+
23
+ ### 选项
24
+
25
+ | 选项 | 类型 | 描述 |
26
+ |---|---|---|
27
+ | `--feedback` | string | 提供反馈以调整和优化整体文档结构规划。 |
28
+ | `--forceRegenerate` | boolean | 丢弃现有内容并从头开始重新生成所有文档。 |
29
+ | `--model` | string | 指定用于生成的特定 LLM(例如,`openai:gpt-4o`、`claude:claude-3-5-sonnet`)。这将覆盖默认模型。 |
30
+ | `--glossary` | string | 用于保持术语一致性的术语表文件路径。使用 `@path/to/glossary.md` 格式。 |
31
+
32
+ ### 使用示例
33
+
34
+ **首次生成或更新文档:**
35
+ ```bash
36
+ aigne doc generate
37
+ ```
38
+
39
+ **强制完全重新生成所有文档:**
40
+ ```bash
41
+ aigne doc generate --forceRegenerate
42
+ ```
43
+
44
+ **通过反馈优化文档结构:**
45
+ ```bash
46
+ aigne doc generate --feedback "为 API 示例添加一个新部分,并删除‘关于’页面。"
47
+ ```
48
+
49
+ **使用 AIGNE Hub 中的特定模型进行生成:**
50
+ ```bash
51
+ aigne doc generate --model google:gemini-1.5-flash
52
+ ```
53
+
54
+ ---
55
+
56
+ ## `aigne doc update`
57
+
58
+ **别名:** `up`
59
+
60
+ 优化并重新生成特定文档。您可以以交互方式运行它来选择文档,或直接使用选项指定文档。这对于根据反馈进行有针对性的改进非常有用,而无需重新生成整个项目。
61
+
62
+ ### 选项
63
+
64
+ | 选项 | 类型 | 描述 |
65
+ |---|---|---|
66
+ | `--docs` | array | 要重新生成的文档路径列表(例如,`--docs overview.md --docs /features/authentication.md`)。 |
67
+ | `--feedback` | string | 提供具体反馈以改进所选文档的内容。 |
68
+ | `--glossary` | string | 用于保持术语一致性的术语表文件路径。使用 `@path/to/glossary.md` 格式。 |
69
+
70
+ ### 使用示例
71
+
72
+ **启动交互式会话以选择要更新的文档:**
73
+ ```bash
74
+ aigne doc update
75
+ ```
76
+
77
+ **使用有针对性的反馈更新特定文档:**
78
+ ```bash
79
+ aigne doc update --docs /cli-reference.md --feedback "阐明 --docs 和 --langs 选项之间的区别。"
80
+ ```
81
+
82
+ ---
83
+
84
+ ## `aigne doc translate`
85
+
86
+ 将现有文档翻译成一种或多种语言。可以以交互方式运行以选择文档和语言,也可以通过将它们指定为参数以非交互方式运行。
87
+
88
+ ### 选项
89
+
90
+ | 选项 | 类型 | 描述 |
91
+ |---|---|---|
92
+ | `--docs` | array | 要翻译的文档路径列表。如果在交互模式下省略,您可以进行选择。 |
93
+ | `--langs` | array | 目标语言代码列表(例如,`zh`、`ja`、`es`)。如果省略,您可以以交互方式选择它们。 |
94
+ | `--feedback` | string | 提供反馈以提高翻译质量。 |
95
+ | `--glossary` | string | 用于确保跨语言术语一致性的术语表文件路径。使用 `@path/to/glossary.md`。 |
96
+
97
+ ### 使用示例
98
+
99
+ **启动交互式翻译会话:**
100
+ ```bash
101
+ aigne doc translate
102
+ ```
103
+
104
+ **将特定文档翻译成中文和日文:**
105
+ ```bash
106
+ aigne doc translate --docs overview.md --docs getting-started.md --langs zh --langs ja
107
+ ```
108
+
109
+ **结合使用术语表和反馈以获得更高质量的翻译:**
110
+ ```bash
111
+ aigne doc translate --glossary @glossary.md --feedback "日语翻译请使用正式语言。"
112
+ ```
113
+
114
+ ---
115
+
116
+ ## `aigne doc publish`
117
+
118
+ **别名:** `pub`, `p`
119
+
120
+ 将您生成的文档发布到 Discuss Kit 平台。您可以发布到官方的 AIGNE DocSmith 平台,也可以发布到您自己自托管的实例。
121
+
122
+ ### 选项
123
+
124
+ | 选项 | 类型 | 描述 |
125
+ |---|---|---|
126
+ | `--appUrl` | string | 您自托管的 Discuss Kit 实例的 URL。如果未提供,该命令将以交互方式运行,允许您在官方平台和自定义 URL 之间进行选择。 |
127
+
128
+ ### 使用示例
129
+
130
+ **启动交互式发布会话:**
131
+ ```bash
132
+ aigne doc publish
133
+ ```
134
+
135
+ **直接发布到自托管实例:**
136
+ ```bash
137
+ aigne doc publish --appUrl https://docs.my-company.com
138
+ ```
139
+
140
+ ---
141
+
142
+ ## `aigne doc init`
143
+
144
+ 手动启动交互式配置向导。这对于设置新项目或修改现有项目的配置非常有用。该向导会引导您定义源代码路径、设置输出目录、选择语言以及定义文档的风格和目标受众。
145
+
146
+ ### 使用示例
147
+
148
+ **启动设置向导:**
149
+ ```bash
150
+ aigne doc init
151
+ ```
152
+
153
+ ---
154
+
155
+ ## `aigne doc prefs`
156
+
157
+ 管理 DocSmith 随着时间的推移从您的反馈中学习到的用户偏好。这些偏好将在未来的生成和更新任务中作为规则应用,以保持与您的风格一致。
158
+
159
+ ### 选项
160
+
161
+ | 选项 | 类型 | 描述 |
162
+ |---|---|---|
163
+ | `--list` | boolean | 列出所有已保存的偏好,显示其状态(激活/未激活)、范围和内容。 |
164
+ | `--remove` | boolean | 移除一个或多个偏好。如果未提供 `--id`,则以交互方式运行。 |
165
+ | `--toggle` | boolean | 切换一个或多个偏好的激活状态。如果未提供 `--id`,则以交互方式运行。 |
166
+ | `--id` | array | 指定要执行 `--remove` 或 `--toggle` 操作的偏好 ID。 |
167
+
168
+ ### 使用示例
169
+
170
+ **列出所有已保存的偏好:**
171
+ ```bash
172
+ aigne doc prefs --list
173
+ ```
174
+
175
+ **以交互方式选择要移除的偏好:**
176
+ ```bash
177
+ aigne doc prefs --remove
178
+ ```
179
+
180
+ **通过 ID 切换特定偏好的状态:**
181
+ ```bash
182
+ aigne doc prefs --toggle --id <preference-id>
183
+ ```
184
+
185
+ 有关如何根据您的需求定制 DocSmith 的更多详细信息,请参阅 [配置指南](./configuration.md)。
@@ -0,0 +1,82 @@
1
+ ---
2
+ labels: ["Reference"]
3
+ ---
4
+
5
+ # Interactive Setup
6
+
7
+ Setting up a new documentation project is straightforward with the interactive setup wizard. By running a single command, `aigne doc init`, you can generate a comprehensive `config.yaml` file tailored to your project's needs. The wizard guides you through a series of questions, provides intelligent defaults, and helps prevent configuration mistakes.
8
+
9
+ This is the recommended way to start a new DocSmith project, as it ensures all necessary settings are considered from the beginning.
10
+
11
+ ## The Setup Process
12
+
13
+ The `init` command launches a guided, 8-step process to understand your documentation goals. At each step, it asks a question and often suggests a default based on your previous answers.
14
+
15
+ ```d2
16
+ direction: down
17
+
18
+ start: "Start: `aigne doc init`" {
19
+ shape: hexagon
20
+ }
21
+
22
+ step1: "[1/8] Define Primary Goal"
23
+ step2: "[2/8] Select Target Audience"
24
+ step3: "[3/8] Set Reader Knowledge Level"
25
+ step4: "[4/8] Choose Documentation Depth"
26
+ step5: "[5/8] Select Primary Language"
27
+ step6: "[6/8] Add Translation Languages"
28
+ step7: "[7/8] Specify Output Directory"
29
+ step8: "[8/8] Configure Source Paths"
30
+
31
+ finish: "config.yaml is generated!" {
32
+ shape: hexagon
33
+ }
34
+
35
+ start -> step1 -> step2 -> step3 -> step4 -> step5 -> step6 -> step7 -> step8 -> finish
36
+
37
+ subsystem: "Throughout the process, DocSmith provides intelligent defaults and detects potential configuration conflicts to ensure a coherent setup." {
38
+ shape: callout
39
+ }
40
+
41
+ subsystem -- step3
42
+ subsystem -- step4
43
+ ```
44
+
45
+ Here is a breakdown of each step:
46
+
47
+ 1. **Primary Goal**: Define the main purpose of your documentation. This choice heavily influences the style and structure of the generated content.
48
+ 2. **Target Audience**: Specify who will be reading the documentation. This helps tailor the tone, language, and examples to the right audience.
49
+ 3. **Reader Knowledge Level**: Indicate the typical starting knowledge of your readers. The wizard filters this list to show only options compatible with your previous selections.
50
+ 4. **Documentation Depth**: Decide how comprehensive the documentation should be. A recommended default is provided based on your goal and audience.
51
+ 5. **Primary Language**: Choose the main language for your documentation. It defaults to your detected system language.
52
+ 6. **Translation Languages**: Select any additional languages you want to translate the documentation into.
53
+ 7. **Documentation Directory**: Set the output folder for the generated documentation files.
54
+ 8. **Source Code Paths**: Specify which files and folders DocSmith should analyze to generate documentation. You can use both direct paths (e.g., `./src`) and glob patterns (e.g., `src/**/*.js`).
55
+
56
+ ## Intelligent Conflict Prevention
57
+
58
+ A key feature of the interactive setup is its ability to prevent conflicting configurations. As you make selections, the wizard intelligently filters the options in subsequent steps to ensure your final configuration is logical and effective.
59
+
60
+ For example, if you select **"Get started quickly"** as your primary goal, the wizard will prevent you from choosing **"Is an expert trying to do something specific"** as the reader's knowledge level. A quick-start guide is fundamentally incompatible with the needs of an expert who requires advanced, in-depth reference material. This mechanism guides you toward creating a coherent documentation strategy without requiring you to memorize every possible combination of settings.
61
+
62
+ ## Handling Complex Scenarios
63
+
64
+ Sometimes, you may want to target multiple, distinct audiences. For instance, you might need documentation for both non-technical **End Users** and expert **Developers**. While these audiences have conflicting needs, the setup wizard allows you to select both.
65
+
66
+ Instead of treating this as an error, DocSmith uses this information as a guideline for the documentation's structure. It will resolve the conflict by planning separate user paths:
67
+
68
+ * **A User Guide**: Written in plain language, focusing on UI and business outcomes.
69
+ * **A Developer Guide**: Featuring code snippets, API references, and technical details.
70
+
71
+ This approach ensures that the final documentation can serve diverse needs effectively through intelligent structural design rather than simple concatenation.
72
+
73
+ After completing the wizard, your configuration will be saved, and you'll be ready to generate your first set of documents.
74
+
75
+ <x-cards>
76
+ <x-card data-title="Configuration Guide" data-icon="lucide:file-cog" data-href="/configuration">
77
+ Learn how to manually edit the `config.yaml` file for advanced customization.
78
+ </x-card>
79
+ <x-card data-title="Generate Documentation" data-icon="lucide:play-circle" data-href="/features/generate-documentation">
80
+ Run the command to generate your first set of documents based on your new configuration.
81
+ </x-card>
82
+ </x-cards>
@@ -0,0 +1,82 @@
1
+ ---
2
+ labels: ["Reference"]
3
+ ---
4
+
5
+ # 交互式设置
6
+
7
+ 使用交互式设置向导可以轻松地设置新的文档项目。只需运行 `aigne doc init` 命令,即可根据项目需求生成一个全面的 `config.yaml` 文件。该向导将引导你完成一系列问题,提供智能的默认值,并帮助你避免配置错误。
8
+
9
+ 这是启动新 DocSmith 项目的推荐方法,因为它能确保从一开始就考虑到所有必要的设置。
10
+
11
+ ## 设置过程
12
+
13
+ `init` 命令会启动一个包含 8 个步骤的引导式流程,以了解你的文档目标。在每一步中,它都会提出一个问题,并通常会根据你之前的回答建议一个默认值。
14
+
15
+ ```d2
16
+ direction: down
17
+
18
+ start: "开始: `aigne doc init`" {
19
+ shape: hexagon
20
+ }
21
+
22
+ step1: "[1/8] 定义主要目标"
23
+ step2: "[2/8] 选择目标受众"
24
+ step3: "[3/8] 设置读者知识水平"
25
+ step4: "[4/8] 选择文档深度"
26
+ step5: "[5/8] 选择主要语言"
27
+ step6: "[6/8] 添加翻译语言"
28
+ step7: "[7/8] 指定输出目录"
29
+ step8: "[8/8] 配置源路径"
30
+
31
+ finish: "config.yaml 已生成!" {
32
+ shape: hexagon
33
+ }
34
+
35
+ start -> step1 -> step2 -> step3 -> step4 -> step5 -> step6 -> step7 -> step8 -> finish
36
+
37
+ subsystem: "在整个过程中,DocSmith 提供智能的默认值并检测潜在的配置冲突,以确保设置的一致性。" {
38
+ shape: callout
39
+ }
40
+
41
+ subsystem -- step3
42
+ subsystem -- step4
43
+ ```
44
+
45
+ 以下是每个步骤的详细说明:
46
+
47
+ 1. **主要目标**:定义文档的主要目的。这个选择会极大地影响生成内容的风格和结构。
48
+ 2. **目标受众**:明确文档的读者。这有助于针对正确的受众调整语气、语言和示例。
49
+ 3. **读者知识水平**:指明读者的典型初始知识水平。向导会筛选此列表,仅显示与你先前选择兼容的选项。
50
+ 4. **文档深度**:决定文档的全面程度。系统会根据你的目标和受众提供一个推荐的默认值。
51
+ 5. **主要语言**:选择文档的主要语言。它会默认为你检测到的系统语言。
52
+ 6. **翻译语言**:选择你希望将文档翻译成的其他语言。
53
+ 7. **文档目录**:为生成的文档文件设置输出文件夹。
54
+ 8. **源代码路径**:指定 DocSmith 应分析以生成文档的文件和文件夹。你可以使用直接路径(例如 `./src`)和 glob 模式(例如 `src/**/*.js`)。
55
+
56
+ ## 智能冲突预防
57
+
58
+ 交互式设置的一个关键特性是它能够防止配置冲突。在你进行选择时,向导会智能地筛选后续步骤中的选项,以确保你的最终配置是合乎逻辑且有效的。
59
+
60
+ 例如,如果你选择 **“快速入门”** 作为主要目标,向导将阻止你选择 **“试图完成特定任务的专家”** 作为读者知识水平。快速入门指南与需要高级、深入参考资料的专家的需求在根本上是不兼容的。这种机制引导你制定一个连贯的文档策略,而无需你记住每一种可能的设置组合。
61
+
62
+ ## 处理复杂场景
63
+
64
+ 有时,你可能希望面向多个不同的受众。例如,你可能需要为非技术的 **最终用户** 和专业的 **开发者** 提供文档。虽然这些受众的需求存在冲突,但设置向导允许你同时选择两者。
65
+
66
+ DocSmith 不会将此视为错误,而是将此信息用作文档结构的指导。它将通过规划独立的用户路径来解决冲突:
67
+
68
+ * **用户指南**:用通俗易懂的语言编写,侧重于用户界面和业务成果。
69
+ * **开发者指南**:包含代码片段、API 参考和技术细节。
70
+
71
+ 这种方法通过智能的结构设计,而非简单的内容拼接,确保最终的文档能够有效地满足不同需求。
72
+
73
+ 完成向导后,你的配置将被保存,你就可以生成第一套文档了。
74
+
75
+ <x-cards>
76
+ <x-card data-title="配置指南" data-icon="lucide:file-cog" data-href="/configuration">
77
+ 了解如何手动编辑 `config.yaml` 文件以进行高级定制。
78
+ </x-card>
79
+ <x-card data-title="生成文档" data-icon="lucide:play-circle" data-href="/features/generate-documentation">
80
+ 运行命令,根据你的新配置生成第一套文档。
81
+ </x-card>
82
+ </x-cards>
@@ -0,0 +1,64 @@
1
+ ---
2
+ labels: ["Reference"]
3
+ ---
4
+
5
+ # Language Support
6
+
7
+ AIGNE DocSmith is designed for a global audience, offering automated translation capabilities for over a dozen languages. This allows you to generate and maintain documentation in multiple languages with minimal effort, ensuring your project is accessible to users worldwide. The translation feature is powered by the `aigne doc translate` command.
8
+
9
+ ## Supported Languages
10
+
11
+ DocSmith provides high-quality, AI-powered translations for the following languages. You can select your primary documentation language and any number of target languages for translation during the project setup.
12
+
13
+ | Language | Language Code |
14
+ |---|---|
15
+ | English (en) | `en` |
16
+ | 简体中文 (zh) | `zh` |
17
+ | 繁體中文 (zh-TW) | `zh-TW` |
18
+ | 日本語 (ja) | `ja` |
19
+ | 한국어 (ko) | `ko` |
20
+ | Español (es) | `es` |
21
+ | Français (fr) | `fr` |
22
+ | Deutsch (de) | `de` |
23
+ | Português (pt) | `pt` |
24
+ | Русский (ru) | `ru` |
25
+ | Italiano (it) | `it` |
26
+ | العربية (ar) | `ar` |
27
+
28
+ ## How to Enable and Use Translation
29
+
30
+ Translation languages are typically configured when you first initialize your project using `aigne doc init`. However, you can easily add new languages or translate documents at any time using the `aigne doc translate` command.
31
+
32
+ ### Interactive Mode
33
+
34
+ The simplest way to translate your documents is by running the command without any arguments. This will launch an interactive wizard.
35
+
36
+ ```bash
37
+ aigne doc translate
38
+ ```
39
+
40
+ The interactive mode will guide you through:
41
+
42
+ - Selecting which existing documents you want to translate.
43
+ - Choosing target languages from the supported list.
44
+ - Adding new translation languages to your project's configuration.
45
+
46
+ ### Command-Line Mode
47
+
48
+ For automation or more direct control, you can specify documents and languages as command-line arguments. This is ideal for use in scripts or CI/CD environments.
49
+
50
+ ```bash
51
+ # Translate overview.md and examples.md into Chinese and Japanese
52
+ aigne doc translate --langs zh --langs ja --docs overview.md --docs examples.md
53
+ ```
54
+
55
+ Key parameters include:
56
+
57
+ - `--langs`: Specify a target language code. You can use this flag multiple times for multiple languages.
58
+ - `--docs`: Specify the path to a document you want to translate. This can also be used multiple times.
59
+ - `--feedback`: Provide specific instructions to improve the quality of the translation.
60
+ - `--glossary`: Use a custom glossary file to ensure consistent terminology.
61
+
62
+ ---
63
+
64
+ Now that you know which languages are supported and how to enable them, you can start reaching a broader audience. For a more detailed walkthrough of the translation workflow and its advanced features, see the [Translate Documentation](./features-translate-documentation.md) guide.
@@ -0,0 +1,64 @@
1
+ ---
2
+ labels: ["Reference"]
3
+ ---
4
+
5
+ # 语言支持
6
+
7
+ AIGNE DocSmith 面向全球用户设计,提供十几种语言的自动翻译功能。这使你能够以最少的工作量生成和维护多语言文档,确保你的项目能够被世界各地的用户访问。该翻译功能由 `aigne doc translate` 命令提供支持。
8
+
9
+ ## 支持的语言
10
+
11
+ DocSmith 为以下语言提供高质量的 AI 翻译。你可以在项目设置期间选择你的主要文档语言和任意数量的目标翻译语言。
12
+
13
+ | 语言 | 语言代码 |
14
+ |---|---|
15
+ | 英语 (en) | `en` |
16
+ | 简体中文 (zh) | `zh` |
17
+ | 繁體中文 (zh-TW) | `zh-TW` |
18
+ | 日语 (ja) | `ja` |
19
+ | 韩语 (ko) | `ko` |
20
+ | 西班牙语 (es) | `es` |
21
+ | 法语 (fr) | `fr` |
22
+ | 德语 (de) | `de` |
23
+ | 葡萄牙语 (pt) | `pt` |
24
+ | 俄语 (ru) | `ru` |
25
+ | 意大利语 (it) | `it` |
26
+ | 阿拉伯语 (ar) | `ar` |
27
+
28
+ ## 如何启用和使用翻译
29
+
30
+ 翻译语言通常在首次使用 `aigne doc init` 初始化项目时进行配置。但是,你可以随时使用 `aigne doc translate` 命令轻松添加新语言或翻译文档。
31
+
32
+ ### 交互模式
33
+
34
+ 翻译文档最简单的方法是直接运行该命令,不带任何参数。这将启动一个交互式向导。
35
+
36
+ ```bash
37
+ aigne doc translate
38
+ ```
39
+
40
+ 交互模式将引导你完成以下操作:
41
+
42
+ - 选择要翻译的现有文档。
43
+ - 从支持的语言列表中选择目标语言。
44
+ - 将新的翻译语言添加到你的项目配置中。
45
+
46
+ ### 命令行模式
47
+
48
+ 为了实现自动化或更直接的控制,你可以将文档和语言指定为命令行参数。这非常适合在脚本或 CI/CD 环境中使用。
49
+
50
+ ```bash
51
+ # 将 overview.md 和 examples.md 翻译成中文和日文
52
+ aigne doc translate --langs zh --langs ja --docs overview.md --docs examples.md
53
+ ```
54
+
55
+ 关键参数包括:
56
+
57
+ - `--langs`: 指定目标语言代码。你可以多次使用此标志以指定多种语言。
58
+ - `--docs`: 指定要翻译的文档的路径。此标志也可以多次使用。
59
+ - `--feedback`: 提供具体说明以提高翻译质量。
60
+ - `--glossary`: 使用自定义术语表文件以确保术语的一致性。
61
+
62
+ ---
63
+
64
+ 现在你已经了解了支持哪些语言以及如何启用它们,可以开始覆盖更广泛的受众了。有关翻译工作流程及其高级功能的更详细演练,请参阅 [翻译文档](./features-translate-documentation.md) 指南。