@aigne/doc-smith 0.8.3 → 0.8.5
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 -3
- package/.aigne/doc-smith/preferences.yml +58 -12
- package/.aigne/doc-smith/upload-cache.yaml +600 -207
- package/CHANGELOG.md +22 -0
- package/README.md +77 -5
- package/agents/input-generator.mjs +12 -6
- package/agents/publish-docs.mjs +53 -4
- package/docs/_sidebar.md +1 -1
- package/docs/advanced-how-it-works.md +55 -60
- package/docs/advanced-how-it-works.zh.md +60 -65
- package/docs/advanced-quality-assurance.md +73 -38
- package/docs/advanced-quality-assurance.zh.md +73 -38
- package/docs/advanced.md +2 -14
- package/docs/advanced.zh.md +5 -17
- package/docs/changelog.md +41 -4
- package/docs/changelog.zh.md +77 -40
- package/docs/cli-reference.md +79 -13
- package/docs/cli-reference.zh.md +92 -26
- package/docs/configuration-interactive-setup.md +102 -49
- package/docs/configuration-interactive-setup.zh.md +102 -49
- package/docs/configuration-language-support.md +69 -39
- package/docs/configuration-language-support.zh.md +68 -38
- package/docs/configuration-llm-setup.md +25 -62
- package/docs/configuration-llm-setup.zh.md +25 -62
- package/docs/configuration-preferences.md +79 -67
- package/docs/configuration-preferences.zh.md +78 -67
- package/docs/configuration.md +122 -109
- package/docs/configuration.zh.md +130 -117
- package/docs/features-generate-documentation.md +44 -24
- package/docs/features-generate-documentation.zh.md +52 -32
- package/docs/features-publish-your-docs.md +41 -40
- package/docs/features-publish-your-docs.zh.md +50 -49
- package/docs/features-translate-documentation.md +73 -17
- package/docs/features-translate-documentation.zh.md +76 -20
- package/docs/features-update-and-refine.md +72 -21
- package/docs/features-update-and-refine.zh.md +80 -29
- package/docs/features.md +24 -28
- package/docs/features.zh.md +25 -29
- package/docs/getting-started.md +87 -38
- package/docs/getting-started.zh.md +88 -39
- package/docs/overview.md +17 -35
- package/docs/overview.zh.md +18 -36
- package/package.json +9 -8
- package/prompts/content-detail-generator.md +1 -0
- package/prompts/document/custom-code-block.md +101 -0
- package/prompts/document/d2-chart/rules.md +941 -1031
- package/prompts/document/detail-generator.md +7 -53
- package/tests/input-generator.test.mjs +2 -2
- package/tests/kroki-utils.test.mjs +88 -17
- package/utils/auth-utils.mjs +9 -2
- package/utils/blocklet.mjs +25 -6
- package/utils/constants.mjs +17 -1
- package/utils/deploy.mjs +404 -0
- package/utils/kroki-utils.mjs +22 -14
- package/utils/markdown-checker.mjs +1 -1
- package/utils/utils.mjs +3 -2
- package/prompts/document/d2-chart/diy-examples.md +0 -44
- package/prompts/document/d2-chart/shape-rules.md +0 -182
|
@@ -1,82 +1,135 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Interactive Setup
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
To simplify project configuration, AIGNE DocSmith provides an interactive setup wizard launched with the `aigne doc init` command. This guided process asks a series of questions about your documentation goals and generates a `config.yaml` file based on your answers. It is the recommended way to start a new documentation project, as it helps prevent configuration errors and provides specific recommendations.
|
|
4
|
+
|
|
5
|
+
## Running the Wizard
|
|
6
|
+
|
|
7
|
+
To begin, run the following command in your project's root directory:
|
|
8
|
+
|
|
9
|
+
```bash aigne doc init icon=lucide:sparkles
|
|
10
|
+
npx aigne doc init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The wizard will then guide you through an 8-step process to configure your documentation.
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
## The Guided Process
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
The wizard covers the following key areas:
|
|
12
18
|
|
|
13
|
-
|
|
19
|
+
1. **Primary Goal**: Defines the main outcome for your readers (e.g., getting started quickly, finding answers fast).
|
|
20
|
+
2. **Target Audience**: Specifies who will be reading the documentation (e.g., non-technical end-users, developers).
|
|
21
|
+
3. **Reader Knowledge Level**: Assesses the typical starting knowledge of your audience.
|
|
22
|
+
4. **Documentation Depth**: Determines how comprehensive the content should be.
|
|
23
|
+
5. **Primary Language**: Sets the main language for the documentation.
|
|
24
|
+
6. **Translation Languages**: Selects additional languages for translation.
|
|
25
|
+
7. **Output Directory**: Specifies where to save the generated documentation files.
|
|
26
|
+
8. **Source Code Paths**: Defines which files and directories to analyze, with support for glob patterns.
|
|
27
|
+
|
|
28
|
+
## Assisted Configuration
|
|
29
|
+
|
|
30
|
+
The wizard includes built-in logic to help you create a more effective and coherent configuration.
|
|
14
31
|
|
|
15
32
|
```d2
|
|
16
33
|
direction: down
|
|
17
34
|
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
User-Selections: {
|
|
36
|
+
label: "1. User provides input\n(Purpose, Audience, etc.)"
|
|
37
|
+
shape: rectangle
|
|
20
38
|
}
|
|
21
39
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
Wizard-Engine: {
|
|
41
|
+
label: "2. Wizard's Logic Engine"
|
|
42
|
+
shape: rectangle
|
|
43
|
+
grid-columns: 2
|
|
44
|
+
|
|
45
|
+
Filtering: {
|
|
46
|
+
label: "Option Filtering\n(Prevents invalid combos)"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
Conflict-Detection: {
|
|
50
|
+
label: "Conflict Detection\n(Identifies complex needs)"
|
|
51
|
+
}
|
|
33
52
|
}
|
|
34
53
|
|
|
35
|
-
|
|
54
|
+
Guided-Experience: {
|
|
55
|
+
label: "3. Guided Experience"
|
|
56
|
+
shape: rectangle
|
|
57
|
+
content: "User sees simplified, relevant options"
|
|
58
|
+
}
|
|
36
59
|
|
|
37
|
-
|
|
38
|
-
|
|
60
|
+
Final-Config: {
|
|
61
|
+
label: "4. Final Configuration"
|
|
62
|
+
content: "config.yaml is generated with\nconflict resolution strategies"
|
|
39
63
|
}
|
|
40
64
|
|
|
41
|
-
|
|
42
|
-
|
|
65
|
+
User-Selections -> Wizard-Engine
|
|
66
|
+
Wizard-Engine.Filtering -> Guided-Experience
|
|
67
|
+
Wizard-Engine.Conflict-Detection -> Final-Config
|
|
68
|
+
Guided-Experience -> User-Selections: "Refines"
|
|
43
69
|
```
|
|
44
70
|
|
|
45
|
-
|
|
71
|
+
### Default Suggestions and Option Filtering
|
|
46
72
|
|
|
47
|
-
|
|
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`).
|
|
73
|
+
As you answer questions, the wizard provides defaults and filters subsequent options to guide you toward a logical configuration. For instance:
|
|
55
74
|
|
|
56
|
-
|
|
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 technically advanced knowledge levels like "Is an expert trying to do something specific" to prevent incompatible selections.
|
|
57
77
|
|
|
58
|
-
|
|
78
|
+
### Conflict Detection and Resolution
|
|
59
79
|
|
|
60
|
-
|
|
80
|
+
Sometimes, you may have multiple goals or audiences that seem to conflict, such as creating documentation for both non-technical **End Users** and expert **Developers**. The wizard identifies these as "resolvable conflicts."
|
|
61
81
|
|
|
62
|
-
|
|
82
|
+
It then formulates a strategy to address these diverse needs within the documentation's structure. For the End User vs. Developer example, the resolution strategy is to create separate user paths:
|
|
63
83
|
|
|
64
|
-
|
|
84
|
+
- **User Guide Path**: Uses plain language, focuses on UI interactions, and is oriented toward business outcomes.
|
|
85
|
+
- **Developer Guide Path**: Is code-first, technically precise, and includes SDK examples and configuration snippets.
|
|
65
86
|
|
|
66
|
-
|
|
87
|
+
This approach ensures that the final documentation is structured to serve multiple audiences effectively, rather than creating a confusing mix of content.
|
|
67
88
|
|
|
68
|
-
|
|
69
|
-
* **A Developer Guide**: Featuring code snippets, API references, and technical details.
|
|
89
|
+
## Generated Output
|
|
70
90
|
|
|
71
|
-
This
|
|
91
|
+
Upon completion, the wizard saves a `config.yaml` file in your project. This file is fully commented, explaining each option and listing all available choices, making it easy to review and modify manually later.
|
|
72
92
|
|
|
73
|
-
|
|
93
|
+
Here is a snippet of what the generated file looks like:
|
|
94
|
+
|
|
95
|
+
```yaml config.yaml icon=logos:yaml
|
|
96
|
+
# Project information for documentation publishing
|
|
97
|
+
projectName: your-project-name
|
|
98
|
+
projectDesc: Your project description.
|
|
99
|
+
projectLogo: ""
|
|
100
|
+
|
|
101
|
+
# =============================================================================
|
|
102
|
+
# Documentation Configuration
|
|
103
|
+
# =============================================================================
|
|
104
|
+
|
|
105
|
+
# Purpose: What's the main outcome you want readers to achieve?
|
|
106
|
+
# Available options (uncomment and modify as needed):
|
|
107
|
+
# getStarted - Get started quickly: Help new users go from zero to working in <30 minutes
|
|
108
|
+
# completeTasks - Complete specific tasks: Guide users through common workflows and use cases
|
|
109
|
+
documentPurpose:
|
|
110
|
+
- completeTasks
|
|
111
|
+
- findAnswers
|
|
112
|
+
|
|
113
|
+
# Target Audience: Who will be reading this most often?
|
|
114
|
+
# Available options (uncomment and modify as needed):
|
|
115
|
+
# endUsers - End users (non-technical): People who use the product but don't code
|
|
116
|
+
# developers - Developers integrating your product/API: Engineers adding this to their projects
|
|
117
|
+
targetAudienceTypes:
|
|
118
|
+
- endUsers
|
|
119
|
+
- developers
|
|
120
|
+
|
|
121
|
+
# ... other settings
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Next Steps
|
|
125
|
+
|
|
126
|
+
With your configuration file in place, you are ready to generate, translate, or publish your documentation.
|
|
74
127
|
|
|
75
128
|
<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
129
|
<x-card data-title="Generate Documentation" data-icon="lucide:play-circle" data-href="/features/generate-documentation">
|
|
80
|
-
|
|
130
|
+
Learn how to use a single command to automatically create a complete set of documentation from your source code.
|
|
131
|
+
</x-card>
|
|
132
|
+
<x-card data-title="Configuration Guide" data-icon="lucide:settings" data-href="/configuration">
|
|
133
|
+
Dive deeper into all available settings and learn how to fine-tune the config.yaml file manually.
|
|
81
134
|
</x-card>
|
|
82
135
|
</x-cards>
|
|
@@ -1,82 +1,135 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# 交互式设置
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
为简化项目配置,AIGNE DocSmith 提供了一个交互式设置向导,可通过 `aigne doc init` 命令启动。该引导式流程会询问一系列关于文档目标的问题,并根据您的回答生成一个 `config.yaml` 文件。这是开始新文档项目的推荐方式,因为它有助于防止配置错误并提供具体建议。
|
|
4
|
+
|
|
5
|
+
## 运行向导
|
|
6
|
+
|
|
7
|
+
首先,在您项目的根目录中运行以下命令:
|
|
8
|
+
|
|
9
|
+
```bash aigne doc init icon=lucide:sparkles
|
|
10
|
+
npx aigne doc init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
然后,向导将引导您完成一个 8 步流程来配置您的文档。
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
## 引导式流程
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
向导涵盖以下关键领域:
|
|
12
18
|
|
|
13
|
-
|
|
19
|
+
1. **主要目标**:定义读者的主要预期成果(例如,快速入门、快速找到答案)。
|
|
20
|
+
2. **目标受众**:明确文档的阅读对象(例如,非技术最终用户、开发者)。
|
|
21
|
+
3. **读者知识水平**:评估受众的典型初始知识水平。
|
|
22
|
+
4. **文档深度**:决定内容的详尽程度。
|
|
23
|
+
5. **主要语言**:设置文档的主要语言。
|
|
24
|
+
6. **翻译语言**:选择用于翻译的其他语言。
|
|
25
|
+
7. **输出目录**:指定保存生成的文档文件的位置。
|
|
26
|
+
8. **源代码路径**:定义要分析的文件和目录,支持 glob 模式。
|
|
27
|
+
|
|
28
|
+
## 辅助配置
|
|
29
|
+
|
|
30
|
+
该向导包含内置逻辑,可帮助您创建更有效、更一致的配置。
|
|
14
31
|
|
|
15
32
|
```d2
|
|
16
33
|
direction: down
|
|
17
34
|
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
User-Selections: {
|
|
36
|
+
label: "1. 用户提供输入\n(目的、受众等)"
|
|
37
|
+
shape: rectangle
|
|
20
38
|
}
|
|
21
39
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
Wizard-Engine: {
|
|
41
|
+
label: "2. 向导的逻辑引擎"
|
|
42
|
+
shape: rectangle
|
|
43
|
+
grid-columns: 2
|
|
44
|
+
|
|
45
|
+
Filtering: {
|
|
46
|
+
label: "选项过滤\n(防止无效组合)"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
Conflict-Detection: {
|
|
50
|
+
label: "冲突检测\n(识别复杂需求)"
|
|
51
|
+
}
|
|
33
52
|
}
|
|
34
53
|
|
|
35
|
-
|
|
54
|
+
Guided-Experience: {
|
|
55
|
+
label: "3. 引导式体验"
|
|
56
|
+
shape: rectangle
|
|
57
|
+
content: "用户看到简化、相关的选项"
|
|
58
|
+
}
|
|
36
59
|
|
|
37
|
-
|
|
38
|
-
|
|
60
|
+
Final-Config: {
|
|
61
|
+
label: "4. 最终配置"
|
|
62
|
+
content: "config.yaml 根据\n冲突解决策略生成"
|
|
39
63
|
}
|
|
40
64
|
|
|
41
|
-
|
|
42
|
-
|
|
65
|
+
User-Selections -> Wizard-Engine
|
|
66
|
+
Wizard-Engine.Filtering -> Guided-Experience
|
|
67
|
+
Wizard-Engine.Conflict-Detection -> Final-Config
|
|
68
|
+
Guided-Experience -> User-Selections: "优化"
|
|
43
69
|
```
|
|
44
70
|
|
|
45
|
-
|
|
71
|
+
### 默认建议和选项过滤
|
|
46
72
|
|
|
47
|
-
|
|
48
|
-
2. **目标受众**:明确文档的读者。这有助于针对正确的受众调整语气、语言和示例。
|
|
49
|
-
3. **读者知识水平**:指明读者的典型初始知识水平。向导会筛选此列表,仅显示与你先前选择兼容的选项。
|
|
50
|
-
4. **文档深度**:决定文档的全面程度。系统会根据你的目标和受众提供一个推荐的默认值。
|
|
51
|
-
5. **主要语言**:选择文档的主要语言。它会默认为你检测到的系统语言。
|
|
52
|
-
6. **翻译语言**:选择你希望将文档翻译成的其他语言。
|
|
53
|
-
7. **文档目录**:为生成的文档文件设置输出文件夹。
|
|
54
|
-
8. **源代码路径**:指定 DocSmith 应分析以生成文档的文件和文件夹。你可以使用直接路径(例如 `./src`)和 glob 模式(例如 `src/**/*.js`)。
|
|
73
|
+
在您回答问题时,向导会提供默认值并筛选后续选项,以引导您进行逻辑配置。例如:
|
|
55
74
|
|
|
56
|
-
|
|
75
|
+
- **默认建议**:如果您选择“快速入门”作为主要目标,向导将推荐“完全是初学者”作为读者的知识水平。
|
|
76
|
+
- **实时过滤**:如果您的目标受众是“最终用户(非技术人员)”,向导将隐藏“试图做特定事情的专家”等技术高级知识水平,以防止不兼容的选择。
|
|
57
77
|
|
|
58
|
-
|
|
78
|
+
### 冲突检测与解决
|
|
59
79
|
|
|
60
|
-
|
|
80
|
+
有时,您可能有多个似乎相互冲突的目标或受众,例如同时为非技术的**最终用户**和专业的**开发者**创建文档。向导会将这些识别为“可解决的冲突”。
|
|
61
81
|
|
|
62
|
-
|
|
82
|
+
然后,它会制定一个策略,在文档结构中解决这些多样化的需求。对于最终用户与开发者的例子,解决方法是创建独立的用户路径:
|
|
63
83
|
|
|
64
|
-
|
|
84
|
+
- **用户指南路径**:使用通俗易懂的语言,侧重于 UI 交互,并面向业务成果。
|
|
85
|
+
- **开发者指南路径**:代码优先,技术上精确,并包含 SDK 示例和配置片段。
|
|
65
86
|
|
|
66
|
-
|
|
87
|
+
这种方法可确保最终的文档结构能够有效地服务于多个受众,而不是产生令人困惑的内容混合。
|
|
67
88
|
|
|
68
|
-
|
|
69
|
-
* **开发者指南**:包含代码片段、API 参考和技术细节。
|
|
89
|
+
## 生成的输出
|
|
70
90
|
|
|
71
|
-
|
|
91
|
+
完成后,向导会在您的项目中保存一个 `config.yaml` 文件。该文件带有完整的注释,解释了每个选项并列出了所有可用选择,方便日后手动审查和修改。
|
|
72
92
|
|
|
73
|
-
|
|
93
|
+
以下是生成文件的片段示例:
|
|
94
|
+
|
|
95
|
+
```yaml config.yaml icon=logos:yaml
|
|
96
|
+
# 用于文档发布的项目信息
|
|
97
|
+
projectName: your-project-name
|
|
98
|
+
projectDesc: 您的项目描述。
|
|
99
|
+
projectLogo: ""
|
|
100
|
+
|
|
101
|
+
# =============================================================================
|
|
102
|
+
# 文档配置
|
|
103
|
+
# =============================================================================
|
|
104
|
+
|
|
105
|
+
# 目的:您希望读者达到的主要成果是什么?
|
|
106
|
+
# 可用选项(根据需要取消注释并修改):
|
|
107
|
+
# getStarted - 快速入门:帮助新用户在 30 分钟内从零开始上手
|
|
108
|
+
# completeTasks - 完成特定任务:引导用户完成常见的工作流程和用例
|
|
109
|
+
documentPurpose:
|
|
110
|
+
- completeTasks
|
|
111
|
+
- findAnswers
|
|
112
|
+
|
|
113
|
+
# 目标受众:谁会最常阅读这份文档?
|
|
114
|
+
# 可用选项(根据需要取消注释并修改):
|
|
115
|
+
# endUsers - 最终用户(非技术人员):使用产品但不编写代码的人
|
|
116
|
+
# developers - 开发者(集成您的产品/API):将此添加到其项目中的工程师
|
|
117
|
+
targetAudienceTypes:
|
|
118
|
+
- endUsers
|
|
119
|
+
- developers
|
|
120
|
+
|
|
121
|
+
# ... 其他设置
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 后续步骤
|
|
125
|
+
|
|
126
|
+
配置文件就绪后,您就可以生成、翻译或发布您的文档了。
|
|
74
127
|
|
|
75
128
|
<x-cards>
|
|
76
|
-
<x-card data-title="配置指南" data-icon="lucide:file-cog" data-href="/configuration">
|
|
77
|
-
了解如何手动编辑 `config.yaml` 文件以进行高级定制。
|
|
78
|
-
</x-card>
|
|
79
129
|
<x-card data-title="生成文档" data-icon="lucide:play-circle" data-href="/features/generate-documentation">
|
|
80
|
-
|
|
130
|
+
了解如何使用单个命令从您的源代码自动创建一套完整的文档。
|
|
131
|
+
</x-card>
|
|
132
|
+
<x-card data-title="配置指南" data-icon="lucide:settings" data-href="/configuration">
|
|
133
|
+
深入了解所有可用设置,并学习如何手动微调 config.yaml 文件。
|
|
81
134
|
</x-card>
|
|
82
135
|
</x-cards>
|
|
@@ -1,64 +1,94 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# Language Support
|
|
6
2
|
|
|
7
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmith provides automated translation for 12 languages, allowing you to generate and maintain documentation for a global audience. The entire process is handled by the `aigne doc translate` command, which uses an AI engine to process your source documents and create localized versions.
|
|
4
|
+
|
|
5
|
+
The translation workflow processes your source documents through the AIGNE AI engine to generate localized versions in your selected target languages.
|
|
6
|
+
|
|
7
|
+
```d2
|
|
8
|
+
direction: down
|
|
9
|
+
|
|
10
|
+
Source-Doc: {
|
|
11
|
+
label: "Source Document\n(e.g., English)"
|
|
12
|
+
shape: rectangle
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
AI-Engine: {
|
|
16
|
+
label: "AIGNE DocSmith\nAI Translation Engine"
|
|
17
|
+
shape: rectangle
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Translated-Docs: {
|
|
21
|
+
label: "Translated Documents"
|
|
22
|
+
shape: rectangle
|
|
23
|
+
grid-columns: 3
|
|
24
|
+
|
|
25
|
+
zh: "简体中文"
|
|
26
|
+
ja: "日本語"
|
|
27
|
+
es: "Español"
|
|
28
|
+
fr: "Français"
|
|
29
|
+
de: "Deutsch"
|
|
30
|
+
more: "..."
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
Source-Doc -> AI-Engine: "`aigne doc translate`"
|
|
34
|
+
AI-Engine -> Translated-Docs: "Generates"
|
|
35
|
+
```
|
|
8
36
|
|
|
9
37
|
## Supported Languages
|
|
10
38
|
|
|
11
|
-
DocSmith
|
|
39
|
+
DocSmith offers AI-powered translations for the following languages. You can define your project's primary language during the initial setup and select any number of target languages for translation.
|
|
12
40
|
|
|
13
|
-
| Language | Language Code |
|
|
14
|
-
|
|
15
|
-
| English
|
|
16
|
-
| 简体中文
|
|
17
|
-
| 繁體中文
|
|
18
|
-
| 日本語
|
|
19
|
-
| 한국어
|
|
20
|
-
| Español
|
|
21
|
-
| Français
|
|
22
|
-
| Deutsch
|
|
23
|
-
| Português
|
|
24
|
-
| Русский
|
|
25
|
-
| Italiano
|
|
26
|
-
| العربية
|
|
27
|
-
|
|
28
|
-
## How to
|
|
29
|
-
|
|
30
|
-
Translation languages are
|
|
41
|
+
| Language | Language Code | Sample Text |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| English | `en` | Hello |
|
|
44
|
+
| 简体中文 | `zh` | 你好 |
|
|
45
|
+
| 繁體中文 | `zh-TW` | 你好 |
|
|
46
|
+
| 日本語 | `ja` | こんにちは |
|
|
47
|
+
| 한국어 | `ko` | 안녕하세요 |
|
|
48
|
+
| Español | `es` | Hola |
|
|
49
|
+
| Français | `fr` | Bonjour |
|
|
50
|
+
| Deutsch | `de` | Hallo |
|
|
51
|
+
| Português | `pt` | Olá |
|
|
52
|
+
| Русский | `ru` | Привет |
|
|
53
|
+
| Italiano | `it` | Ciao |
|
|
54
|
+
| العربية | `ar` | مرحبا |
|
|
55
|
+
|
|
56
|
+
## How to Configure and Use Translation
|
|
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 offers two modes of operation.
|
|
31
59
|
|
|
32
60
|
### Interactive Mode
|
|
33
61
|
|
|
34
|
-
|
|
62
|
+
For a guided experience, run the command without any arguments. This is the recommended approach for most users.
|
|
35
63
|
|
|
36
|
-
```bash
|
|
64
|
+
```bash Interactive Translation icon=lucide:wand
|
|
37
65
|
aigne doc translate
|
|
38
66
|
```
|
|
39
67
|
|
|
40
|
-
The interactive mode will
|
|
68
|
+
The interactive mode will then prompt you to:
|
|
41
69
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
70
|
+
- Select which of your existing documents to translate.
|
|
71
|
+
- Choose one or more target languages from the supported list.
|
|
72
|
+
- Add new translation languages to your project's configuration if they are not already included.
|
|
45
73
|
|
|
46
|
-
### Command-Line
|
|
74
|
+
### Command-Line Arguments
|
|
47
75
|
|
|
48
|
-
For
|
|
76
|
+
For direct control or for use in automated scripts (like CI/CD pipelines), you can specify documents and languages directly as command-line arguments.
|
|
49
77
|
|
|
50
|
-
```bash
|
|
78
|
+
```bash Command Example icon=lucide:terminal
|
|
51
79
|
# Translate overview.md and examples.md into Chinese and Japanese
|
|
52
80
|
aigne doc translate --langs zh --langs ja --docs overview.md --docs examples.md
|
|
53
81
|
```
|
|
54
82
|
|
|
55
|
-
Key parameters include:
|
|
83
|
+
Key parameters for the command include:
|
|
56
84
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
85
|
+
| Parameter | Description |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `--langs` | Specify a target language code. This flag can be used multiple times to select several languages. |
|
|
88
|
+
| `--docs` | Specify the path to a document to translate (e.g., `overview.md`). This can also be used multiple times. |
|
|
89
|
+
| `--feedback` | Provide specific instructions to guide the translation model (e.g., `"Use a formal tone"`). |
|
|
90
|
+
| `--glossary` | Use a custom glossary file (e.g., `@path/to/glossary.md`) to ensure consistent translation of project-specific terms. |
|
|
61
91
|
|
|
62
92
|
---
|
|
63
93
|
|
|
64
|
-
|
|
94
|
+
This section covers the available languages and how to enable them. For a complete guide on the translation workflow, including advanced options and best practices, see the [Translate Documentation](./features-translate-documentation.md) guide.
|
|
@@ -1,64 +1,94 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# 语言支持
|
|
6
2
|
|
|
7
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmith 提供 12 种语言的自动翻译功能,让你能够为全球用户生成和维护文档。整个过程由 `aigne doc translate` 命令处理,该命令使用 AI 引擎处理你的源文档并创建本地化版本。
|
|
4
|
+
|
|
5
|
+
翻译工作流通过 AIGNE AI 引擎处理你的源文档,以在你选择的目标语言中生成本地化版本。
|
|
6
|
+
|
|
7
|
+
```d2
|
|
8
|
+
direction: down
|
|
9
|
+
|
|
10
|
+
Source-Doc: {
|
|
11
|
+
label: "源文档\n(例如,英语)"
|
|
12
|
+
shape: rectangle
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
AI-Engine: {
|
|
16
|
+
label: "AIGNE DocSmith\nAI 翻译引擎"
|
|
17
|
+
shape: rectangle
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Translated-Docs: {
|
|
21
|
+
label: "翻译后文档"
|
|
22
|
+
shape: rectangle
|
|
23
|
+
grid-columns: 3
|
|
24
|
+
|
|
25
|
+
zh: "简体中文"
|
|
26
|
+
ja: "日本語"
|
|
27
|
+
es: "Español"
|
|
28
|
+
fr: "Français"
|
|
29
|
+
de: "Deutsch"
|
|
30
|
+
more: "..."
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
Source-Doc -> AI-Engine: "`aigne doc translate`"
|
|
34
|
+
AI-Engine -> Translated-Docs: "生成"
|
|
35
|
+
```
|
|
8
36
|
|
|
9
37
|
## 支持的语言
|
|
10
38
|
|
|
11
|
-
DocSmith
|
|
39
|
+
DocSmith 为以下语言提供 AI 翻译功能。你可以在初始设置期间定义项目的主要语言,并选择任意数量的目标语言进行翻译。
|
|
12
40
|
|
|
13
|
-
| 语言 | 语言代码 |
|
|
14
|
-
|
|
15
|
-
| 英语
|
|
16
|
-
| 简体中文
|
|
17
|
-
| 繁體中文
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
28
|
-
##
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
| 语言 | 语言代码 | 示例文本 |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| 英语 | `en` | Hello |
|
|
44
|
+
| 简体中文 | `zh` | 你好 |
|
|
45
|
+
| 繁體中文 | `zh-TW` | 你好 |
|
|
46
|
+
| 日本語 | `ja` | こんにちは |
|
|
47
|
+
| 한국어 | `ko` | 안녕하세요 |
|
|
48
|
+
| Español | `es` | Hola |
|
|
49
|
+
| Français | `fr` | Bonjour |
|
|
50
|
+
| Deutsch | `de` | Hallo |
|
|
51
|
+
| Português | `pt` | Olá |
|
|
52
|
+
| Русский | `ru` | Привет |
|
|
53
|
+
| Italiano | `it` | Ciao |
|
|
54
|
+
| العربية | `ar` | مرحبا |
|
|
55
|
+
|
|
56
|
+
## 如何配置和使用翻译功能
|
|
57
|
+
|
|
58
|
+
翻译语言在你使用 `aigne doc init` 初始化项目时设置。你可以随时使用 `aigne doc translate` 命令添加新语言或翻译文档,该命令提供两种操作模式。
|
|
31
59
|
|
|
32
60
|
### 交互模式
|
|
33
61
|
|
|
34
|
-
|
|
62
|
+
如需引导式体验,请在不带任何参数的情况下运行该命令。这是为大多数用户推荐的方法。
|
|
35
63
|
|
|
36
|
-
```bash
|
|
64
|
+
```bash Interactive Translation icon=lucide:wand
|
|
37
65
|
aigne doc translate
|
|
38
66
|
```
|
|
39
67
|
|
|
40
|
-
|
|
68
|
+
交互模式将提示你:
|
|
41
69
|
|
|
42
70
|
- 选择要翻译的现有文档。
|
|
43
|
-
-
|
|
44
|
-
-
|
|
71
|
+
- 从支持的语言列表中选择一个或多个目标语言。
|
|
72
|
+
- 如果项目中尚未包含新的翻译语言,则将其添加到项目配置中。
|
|
45
73
|
|
|
46
|
-
###
|
|
74
|
+
### 命令行参数
|
|
47
75
|
|
|
48
|
-
|
|
76
|
+
为了直接控制或在自动化脚本(如 CI/CD 流水线)中使用,你可以直接将文档和语言指定为命令行参数。
|
|
49
77
|
|
|
50
|
-
```bash
|
|
78
|
+
```bash Command Example icon=lucide:terminal
|
|
51
79
|
# 将 overview.md 和 examples.md 翻译成中文和日文
|
|
52
80
|
aigne doc translate --langs zh --langs ja --docs overview.md --docs examples.md
|
|
53
81
|
```
|
|
54
82
|
|
|
55
|
-
|
|
83
|
+
该命令的关键参数包括:
|
|
56
84
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
85
|
+
| 参数 | 描述 |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `--langs` | 指定目标语言代码。该标志可以多次使用以选择多种语言。 |
|
|
88
|
+
| `--docs` | 指定要翻译的文档路径(例如 `overview.md`)。该标志也可以多次使用。 |
|
|
89
|
+
| `--feedback` | 提供具体指令以指导翻译模型(例如,`"Use a formal tone"`)。 |
|
|
90
|
+
| `--glossary` | 使用自定义术语表文件(例如 `@path/to/glossary.md`)以确保项目特定术语的翻译一致性。 |
|
|
61
91
|
|
|
62
92
|
---
|
|
63
93
|
|
|
64
|
-
|
|
94
|
+
本节介绍了可用语言以及如何启用它们。有关翻译工作流的完整指南,包括高级选项和最佳实践,请参阅[翻译文档](./features-translate-documentation.md)指南。
|