@aigne/doc-smith 0.8.2 → 0.8.4

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 (51) hide show
  1. package/.aigne/doc-smith/config.yaml +3 -3
  2. package/.aigne/doc-smith/preferences.yml +58 -12
  3. package/.aigne/doc-smith/upload-cache.yaml +600 -207
  4. package/CHANGELOG.md +17 -0
  5. package/README.md +77 -5
  6. package/docs/advanced-how-it-works.md +55 -60
  7. package/docs/advanced-how-it-works.zh.md +60 -65
  8. package/docs/advanced-quality-assurance.md +73 -38
  9. package/docs/advanced-quality-assurance.zh.md +73 -38
  10. package/docs/advanced.md +2 -14
  11. package/docs/advanced.zh.md +5 -17
  12. package/docs/changelog.md +41 -4
  13. package/docs/changelog.zh.md +77 -40
  14. package/docs/cli-reference.md +79 -13
  15. package/docs/cli-reference.zh.md +92 -26
  16. package/docs/configuration-interactive-setup.md +102 -49
  17. package/docs/configuration-interactive-setup.zh.md +102 -49
  18. package/docs/configuration-language-support.md +69 -39
  19. package/docs/configuration-language-support.zh.md +68 -38
  20. package/docs/configuration-llm-setup.md +25 -62
  21. package/docs/configuration-llm-setup.zh.md +25 -62
  22. package/docs/configuration-preferences.md +79 -67
  23. package/docs/configuration-preferences.zh.md +78 -67
  24. package/docs/configuration.md +122 -109
  25. package/docs/configuration.zh.md +130 -117
  26. package/docs/features-generate-documentation.md +44 -24
  27. package/docs/features-generate-documentation.zh.md +52 -32
  28. package/docs/features-publish-your-docs.md +41 -40
  29. package/docs/features-publish-your-docs.zh.md +50 -49
  30. package/docs/features-translate-documentation.md +73 -17
  31. package/docs/features-translate-documentation.zh.md +76 -20
  32. package/docs/features-update-and-refine.md +72 -21
  33. package/docs/features-update-and-refine.zh.md +80 -29
  34. package/docs/features.md +24 -28
  35. package/docs/features.zh.md +25 -29
  36. package/docs/getting-started.md +87 -38
  37. package/docs/getting-started.zh.md +88 -39
  38. package/docs/overview.md +17 -35
  39. package/docs/overview.zh.md +18 -36
  40. package/package.json +9 -8
  41. package/prompts/content-detail-generator.md +1 -0
  42. package/prompts/document/custom-code-block.md +101 -0
  43. package/prompts/document/d2-chart/rules.md +941 -1031
  44. package/prompts/document/detail-generator.md +7 -53
  45. package/tests/kroki-utils.test.mjs +88 -17
  46. package/utils/constants.mjs +15 -1
  47. package/utils/kroki-utils.mjs +22 -14
  48. package/utils/markdown-checker.mjs +1 -1
  49. package/utils/utils.mjs +3 -2
  50. package/prompts/document/d2-chart/diy-examples.md +0 -44
  51. package/prompts/document/d2-chart/shape-rules.md +0 -182
@@ -1,173 +1,186 @@
1
- ---
2
- labels: ["Reference"]
3
- ---
4
-
5
1
  # Configuration Guide
6
2
 
7
- AIGNE DocSmith's behavior is controlled by a single, powerful configuration file: `config.yaml`. This file, located in the `.aigne/doc-smith` directory of your project, allows you to customize every aspect of the documentation generation process—from the intended audience and style to language support and file structure.
3
+ AIGNE DocSmith's behavior is controlled by a central file, `config.yaml`, typically located at `.aigne/doc-smith/config.yaml`. This file dictates the style, target audience, languages, and structure of your documentation.
8
4
 
9
- This guide provides a detailed reference for all available settings. While you can edit this file manually at any time, we recommend using the [Interactive Setup](./configuration-interactive-setup.md) wizard for your initial configuration.
5
+ You can create and manage this file using the interactive setup wizard by running `aigne doc init`. For a step-by-step walkthrough, see the [Interactive Setup](./configuration-interactive-setup.md) guide.
10
6
 
11
- ## Configuration Overview
7
+ ## Core Configuration Areas
12
8
 
13
- DocSmith offers a flexible configuration system to match your project's unique needs. You can define the goals of your documentation, specify your audience, set up AI models, and manage multiple languages. Explore the key areas of configuration below.
9
+ Your documentation is shaped by several key areas of configuration. Explore these guides to understand how to fine-tune each aspect of the generation process.
14
10
 
15
11
  <x-cards data-columns="2">
16
- <x-card data-title="Interactive Setup" data-href="/configuration/interactive-setup" data-icon="lucide:wand-2">
17
- Learn how to use the `aigne doc init` command to run a guided wizard that creates your initial configuration file effortlessly.
12
+ <x-card data-title="Interactive Setup" data-icon="lucide:wand-2" data-href="/configuration/interactive-setup">
13
+ Learn about the guided wizard that helps you configure your documentation project from scratch, including setting recommendations.
18
14
  </x-card>
19
- <x-card data-title="LLM Setup" data-href="/configuration/llm-setup" data-icon="lucide:brain-circuit">
20
- Configure different Large Language Models, including using the integrated AIGNE Hub for key-free access to popular models.
15
+ <x-card data-title="LLM Setup" data-icon="lucide:brain-circuit" data-href="/configuration/llm-setup">
16
+ Discover how to connect different AI models, including using the built-in AIGNE Hub which requires no API keys.
21
17
  </x-card>
22
- <x-card data-title="Language Support" data-href="/configuration/language-support" data-icon="lucide:languages">
23
- Set your primary documentation language and choose from over 12 supported languages for automatic translation.
18
+ <x-card data-title="Language Support" data-icon="lucide:languages" data-href="/configuration/language-support">
19
+ See the full list of supported languages and learn how to set a primary language and enable automatic translations.
24
20
  </x-card>
25
- <x-card data-title="Managing Preferences" data-href="/configuration/preferences" data-icon="lucide:sliders-horizontal">
26
- Understand how DocSmith learns from your feedback to create persistent rules and how to manage them.
21
+ <x-card data-title="Managing Preferences" data-icon="lucide:sliders-horizontal" data-href="/configuration/preferences">
22
+ Understand how DocSmith uses your feedback to create persistent rules and how to manage them via the CLI.
27
23
  </x-card>
28
24
  </x-cards>
29
25
 
30
26
  ## Parameter Reference
31
27
 
32
- The `config.yaml` file contains several key sections that define how your documentation is generated. Below is a comprehensive breakdown of each parameter.
28
+ The `config.yaml` file contains several key-value pairs that control the documentation output. Below is a detailed reference for each parameter.
33
29
 
34
30
  ### Project Information
35
31
 
36
- These settings are used for display purposes when you publish your documentation.
37
-
38
- ```yaml
39
- # Project information for documentation publishing
40
- projectName: AIGNE DocSmith
41
- projectDesc: An AI-driven documentation generation tool.
42
- projectLogo: https://docsmith.aigne.io/image-bin/uploads/def424c20bbdb3c77483894fe0e22819.png
43
- ```
32
+ These settings provide basic context about your project, which is used when publishing the documentation.
44
33
 
45
- - `projectName`: The name of your project.
46
- - `projectDesc`: A short description of your project.
47
- - `projectLogo`: A URL to your project's logo.
34
+ | Parameter | Description |
35
+ |---|---|
36
+ | `projectName` | The name of your project. Automatically detected from `package.json` if available. |
37
+ | `projectDesc` | A short description of your project. Automatically detected from `package.json`. |
38
+ | `projectLogo` | A path or URL to your project's logo image. |
48
39
 
49
- ### Documentation Style
40
+ ### Documentation Strategy
50
41
 
51
- These parameters define the purpose, audience, and overall tone of your documentation.
42
+ These parameters define the tone, style, and depth of the generated content.
52
43
 
53
44
  #### `documentPurpose`
45
+ What is the main outcome you want readers to achieve? This setting influences the overall structure and focus of the documentation.
54
46
 
55
- Defines the primary goal for your readers. You can select multiple purposes.
56
-
57
- | Key | Name | Description |
47
+ | Option | Name | Description |
58
48
  |---|---|---|
59
49
  | `getStarted` | Get started quickly | Help new users go from zero to working in <30 minutes. |
60
50
  | `completeTasks` | Complete specific tasks | Guide users through common workflows and use cases. |
61
51
  | `findAnswers` | Find answers fast | Provide searchable reference for all features and APIs. |
62
- | `understandSystem` | Understand the system | Explain how it works, why design decisions were made. |
52
+ | `understandSystem`| Understand the system | Explain how it works and why design decisions were made. |
63
53
  | `solveProblems` | Troubleshoot common issues | Help users troubleshoot and fix issues. |
64
- | `mixedPurpose` | Serve multiple purposes | Comprehensive documentation covering multiple needs. |
65
-
66
- **Example:**
67
- ```yaml
68
- documentPurpose:
69
- - getStarted
70
- - findAnswers
71
- ```
54
+ | `mixedPurpose` | Serve multiple purposes | Documentation covering multiple needs. |
72
55
 
73
56
  #### `targetAudienceTypes`
57
+ Who will be reading this documentation most often? This choice affects the writing style and examples.
74
58
 
75
- Specifies the primary audience for the documentation.
76
-
77
- | Key | Name | Description |
59
+ | Option | Name | Description |
78
60
  |---|---|---|
79
61
  | `endUsers` | End users (non-technical) | People who use the product but don't code. |
80
62
  | `developers` | Developers integrating your product/API | Engineers adding this to their projects. |
81
- | `devops` | DevOps / SRE / Infrastructure teams | Teams deploying, monitoring, maintaining systems. |
82
- | `decisionMakers` | Technical decision makers | Architects, leads evaluating or planning implementation. |
63
+ | `devops` | DevOps / SRE / Infrastructure teams | Teams deploying, monitoring, and maintaining systems. |
64
+ | `decisionMakers`| Technical decision makers | Architects or leads evaluating or planning implementation. |
83
65
  | `supportTeams` | Support teams | People helping others use the product. |
84
- | `mixedTechnical` | Mixed technical audience | Developers, DevOps, and technical users. |
85
-
86
- **Example:**
87
- ```yaml
88
- targetAudienceTypes:
89
- - developers
90
- ```
66
+ | `mixedTechnical`| Mixed technical audience | Developers, DevOps, and other technical users. |
91
67
 
92
68
  #### `readerKnowledgeLevel`
69
+ What do readers typically know when they arrive? This adjusts how much foundational knowledge is assumed.
93
70
 
94
- Describes the typical starting knowledge level of your readers.
95
-
96
- | Key | Name | Description |
71
+ | Option | Name | Description |
97
72
  |---|---|---|
98
73
  | `completeBeginners` | Is a total beginner, starting from scratch | New to this domain/technology entirely. |
99
- | `domainFamiliar` | Has used similar tools before | Knows the problem space, new to this specific solution. |
100
- | `experiencedUsers` | Is an expert trying to do something specific | Regular users needing reference/advanced topics. |
101
- | `emergencyTroubleshooting` | Emergency/troubleshooting | Something's broken, need to fix it quickly. |
74
+ | `domainFamiliar` | Has used similar tools before | Knows the problem space, but new to this specific solution. |
75
+ | `experiencedUsers` | Is an expert trying to do something specific | Regular users needing reference or advanced topics. |
76
+ | `emergencyTroubleshooting`| Emergency/troubleshooting | Something is broken and needs to be fixed quickly. |
102
77
  | `exploringEvaluating` | Is evaluating this tool against others | Trying to understand if this fits their needs. |
103
78
 
104
- **Example:**
105
- ```yaml
106
- readerKnowledgeLevel: completeBeginners
107
- ```
108
-
109
79
  #### `documentationDepth`
80
+ How comprehensive should the documentation be?
110
81
 
111
- Controls how comprehensive the documentation should be.
112
-
113
- | Key | Name | Description |
82
+ | Option | Name | Description |
114
83
  |---|---|---|
115
- | `essentialOnly` | Essential only | Cover the 80% use cases, keep it concise. |
116
- | `balancedCoverage` | Balanced coverage | Good depth with practical examples [RECOMMENDED]. |
84
+ | `essentialOnly` | Essential only | Cover the 80% use cases, keeping it concise. |
85
+ | `balancedCoverage`| Balanced coverage | Good depth with practical examples [RECOMMENDED]. |
117
86
  | `comprehensive` | Comprehensive | Cover all features, edge cases, and advanced scenarios. |
118
87
  | `aiDecide` | Let AI decide | Analyze code complexity and suggest appropriate depth. |
119
88
 
120
- **Example:**
121
- ```yaml
122
- documentationDepth: balancedCoverage
123
- ```
89
+ ### Custom Directives
124
90
 
125
- ### Custom Rules & Descriptions
91
+ For more granular control, you can provide free-text instructions.
126
92
 
127
- These fields allow for more specific instructions to the AI.
93
+ | Parameter | Description |
94
+ |---|---|
95
+ | `rules` | A multi-line string where you can define specific documentation generation rules and requirements (e.g., "Always include performance benchmarks"). |
96
+ | `targetAudience`| A multi-line string to describe your specific target audience and their characteristics in more detail than the presets allow. |
128
97
 
129
- - `rules`: A multi-line string where you can define specific rules and requirements for generation, such as "Always include a 'Prerequisites' section in tutorials."
130
- - `targetAudience`: A multi-line string to describe your target audience in more detail than the presets allow.
98
+ ### Language and Path Configuration
131
99
 
132
- **Example:**
133
- ```yaml
134
- rules: |
135
- - All code examples must be complete and copy-paste ready.
136
- - Avoid using technical jargon without explaining it first.
137
- targetAudience: |
138
- Our audience consists of front-end developers who are familiar with JavaScript but may be new to backend concepts. They value clear, practical examples.
139
- ```
100
+ These settings control localization and file locations.
140
101
 
141
- ### Language and Path Settings
102
+ | Parameter | Description |
103
+ |---|---|
104
+ | `locale` | The primary language for the documentation (e.g., `en`, `zh`). |
105
+ | `translateLanguages` | A list of language codes to translate the documentation into (e.g., `[ja, fr, es]`). |
106
+ | `docsDir` | The directory where generated documentation files will be saved. |
107
+ | `sourcesPath` | A list of source code paths or glob patterns for DocSmith to analyze (e.g., `['./src', './lib/**/*.js']`). |
108
+ | `glossary` | Path to a markdown file (`@glossary.md`) containing project-specific terms to ensure consistent translations. |
142
109
 
143
- These parameters configure the languages and file locations for your documentation.
110
+ ## Example `config.yaml`
144
111
 
145
- - `locale`: The primary language for the documentation (e.g., `en`, `zh`).
146
- - `translateLanguages`: A list of language codes to translate the documentation into.
147
- - `glossary`: Path to a Markdown file containing project-specific terms to ensure consistent translations.
148
- - `docsDir`: The directory where the generated documentation will be saved.
149
- - `sourcesPath`: A list of source code paths or glob patterns for the AI to analyze.
112
+ Here is an example of a complete configuration file with comments explaining each section. You can edit this file directly to change settings at any time.
150
113
 
151
- **Example:**
152
- ```yaml
153
- # Language settings
154
- locale: en
155
- translateLanguages:
156
- - zh
157
- - ja
114
+ ```yaml Example config.yaml icon=logos:yaml
115
+ # Project information for documentation publishing
116
+ projectName: AIGNE DocSmith
117
+ projectDesc: A powerful, AI-driven documentation generation tool.
118
+ projectLogo: https://docsmith.aigne.io/image-bin/uploads/def424c20bbdb3c77483894fe0e22819.png
158
119
 
159
- # Glossary for consistent terminology
160
- glossary: "@glossary.md"
120
+ # =============================================================================
121
+ # Documentation Configuration
122
+ # =============================================================================
123
+
124
+ # Purpose: What's the main outcome you want readers to achieve?
125
+ # Available options (uncomment and modify as needed):
126
+ # getStarted - Get started quickly: Help new users go from zero to working in <30 minutes
127
+ # completeTasks - Complete specific tasks: Guide users through common workflows and use cases
128
+ # findAnswers - Find answers fast: Provide searchable reference for all features and APIs
129
+ # understandSystem - Understand the system: Explain how it works, why design decisions were made
130
+ # solveProblems - Troubleshoot common issues: Help users troubleshoot and fix issues
131
+ # mixedPurpose - Serve multiple purposes: Comprehensive documentation covering multiple needs
132
+ documentPurpose:
133
+ - completeTasks
134
+ - findAnswers
161
135
 
162
- # Directory and source path configurations
136
+ # Target Audience: Who will be reading this most often?
137
+ # Available options (uncomment and modify as needed):
138
+ # endUsers - End users (non-technical): People who use the product but don't code
139
+ # developers - Developers integrating your product/API: Engineers adding this to their projects
140
+ # devops - DevOps / SRE / Infrastructure teams: Teams deploying, monitoring, maintaining systems
141
+ # decisionMakers - Technical decision makers: Architects, leads evaluating or planning implementation
142
+ # supportTeams - Support teams: People helping others use the product
143
+ # mixedTechnical - Mixed technical audience: Developers, DevOps, and technical users
144
+ targetAudienceTypes:
145
+ - developers
146
+
147
+ # Reader Knowledge Level: What do readers typically know when they arrive?
148
+ # Available options (uncomment and modify as needed):
149
+ # completeBeginners - Is a total beginner, starting from scratch: New to this domain/technology entirely
150
+ # domainFamiliar - Has used similar tools before: Know the problem space, new to this specific solution
151
+ # experiencedUsers - Is an expert trying to do something specific: Regular users needing reference/advanced topics
152
+ # emergencyTroubleshooting - Emergency/troubleshooting: Something's broken, need to fix it quickly
153
+ # exploringEvaluating - Is evaluating this tool against others: Trying to understand if this fits their needs
154
+ readerKnowledgeLevel: domainFamiliar
155
+
156
+ # Documentation Depth: How comprehensive should the documentation be?
157
+ # Available options (uncomment and modify as needed):
158
+ # essentialOnly - Essential only: Cover the 80% use cases, keep it concise
159
+ # balancedCoverage - Balanced coverage: Good depth with practical examples [RECOMMENDED]
160
+ # comprehensive - Comprehensive: Cover all features, edge cases, and advanced scenarios
161
+ # aiDecide - Let AI decide: Analyze code complexity and suggest appropriate depth
162
+ documentationDepth: balancedCoverage
163
+
164
+ # Custom Rules: Define specific documentation generation rules and requirements
165
+ rules: |+
166
+
167
+
168
+ # Target Audience: Describe your specific target audience and their characteristics
169
+ targetAudience: |+
170
+
171
+
172
+ # Glossary: Define project-specific terms and definitions
173
+ # glossary: "@glossary.md" # Path to markdown file containing glossary definitions
174
+
175
+ locale: en
176
+ # translateLanguages: # List of languages to translate the documentation to
177
+ # - zh # Example: Chinese translation
178
+ # - fr # Example: French translation
163
179
  docsDir: .aigne/doc-smith/docs # Directory to save generated documentation
164
180
  sourcesPath: # Source code paths to analyze
165
- - ./src
166
- - ./README.md
181
+ - ./
167
182
  ```
168
183
 
169
- ---
170
-
171
- With your `config.yaml` file tailored to your project, you're ready to create your documentation. The next step is to run the generation command.
184
+ With your configuration set, you are ready to create documentation that matches your project's needs. The next step is to run the generation command.
172
185
 
173
- ➡️ **Next:** Learn how to [Generate Documentation](./features-generate-documentation.md).
186
+ ➡️ **Next:** [Generate Documentation](./features-generate-documentation.md)
@@ -1,173 +1,186 @@
1
- ---
2
- labels: ["Reference"]
3
- ---
4
-
5
1
  # 配置指南
6
2
 
7
- AIGNE DocSmith 的行为由一个强大的配置文件 `config.yaml` 控制。该文件位于项目的 `.aigne/doc-smith` 目录中,你可以通过它自定义文档生成过程的各个方面,从目标受众、风格到语言支持和文件结构。
3
+ AIGNE DocSmith 的行为由一个中心文件 `config.yaml` 控制,该文件通常位于 `.aigne/doc-smith/config.yaml`。此文件规定了文档的风格、目标受众、语言和结构。
8
4
 
9
- 本指南为所有可用设置提供了详细的参考。虽然你可以随时手动编辑此文件,但我们建议使用 [交互式设置](./configuration-interactive-setup.md) 向导来完成初始配置。
5
+ 你可以通过运行 `aigne doc init`,使用交互式设置向导来创建和管理此文件。有关分步指南,请参阅[交互式设置](./configuration-interactive-setup.md)指南。
10
6
 
11
- ## 配置概览
7
+ ## 核心配置区域
12
8
 
13
- DocSmith 提供灵活的配置系统,以满足你项目的独特需求。你可以定义文档的目标、指定受众、设置 AI 模型以及管理多种语言。请在下方探索主要的配置领域。
9
+ 你的文档由几个关键的配置区域决定。浏览这些指南,了解如何微调生成过程的各个方面。
14
10
 
15
11
  <x-cards data-columns="2">
16
- <x-card data-title="交互式设置" data-href="/configuration/interactive-setup" data-icon="lucide:wand-2">
17
- 了解如何使用 `aigne doc init` 命令运行引导式向导,轻松创建初始配置文件。
12
+ <x-card data-title="交互式设置" data-icon="lucide:wand-2" data-href="/configuration/interactive-setup">
13
+ 了解引导式向导,它能帮助你从头开始配置文档项目,包括设置建议。
18
14
  </x-card>
19
- <x-card data-title="LLM 设置" data-href="/configuration/llm-setup" data-icon="lucide:brain-circuit">
20
- 配置不同的大语言模型,包括使用集成的 AIGNE Hub 免密钥访问热门模型。
15
+ <x-card data-title="LLM 设置" data-icon="lucide:brain-circuit" data-href="/configuration/llm-setup">
16
+ 了解如何连接不同的 AI 模型,包括使用无需 API 密钥的内置 AIGNE Hub
21
17
  </x-card>
22
- <x-card data-title="语言支持" data-href="/configuration/language-support" data-icon="lucide:languages">
23
- 设置你的主要文档语言,并从超过 12 种支持的语言中选择进行自动翻译。
18
+ <x-card data-title="语言支持" data-icon="lucide:languages" data-href="/configuration/language-support">
19
+ 查看支持的语言完整列表,并了解如何设置主语言和启用自动翻译。
24
20
  </x-card>
25
- <x-card data-title="管理偏好" data-href="/configuration/preferences" data-icon="lucide:sliders-horizontal">
26
- 了解 DocSmith 如何从你的反馈中学习以创建持久化规则,以及如何管理这些规则。
21
+ <x-card data-title="管理偏好" data-icon="lucide:sliders-horizontal" data-href="/configuration/preferences">
22
+ 了解 DocSmith 如何利用你的反馈创建持久化规则,以及如何通过 CLI 管理这些规则。
27
23
  </x-card>
28
24
  </x-cards>
29
25
 
30
26
  ## 参数参考
31
27
 
32
- `config.yaml` 文件包含几个关键部分,用于定义文档的生成方式。以下是每个参数的详细说明。
28
+ `config.yaml` 文件包含几个用于控制文档输出的键值对。以下是每个参数的详细参考。
33
29
 
34
30
  ### 项目信息
35
31
 
36
- 这些设置用于发布文档时的信息展示。
37
-
38
- ```yaml
39
- # 用于文档发布的项目信息
40
- projectName: AIGNE DocSmith
41
- projectDesc: 一款 AI 驱动的文档生成工具。
42
- projectLogo: https://docsmith.aigne.io/image-bin/uploads/def424c20bbdb3c77483894fe0e22819.png
43
- ```
32
+ 这些设置提供了关于你项目的基本背景信息,用于发布文档。
44
33
 
45
- - `projectName`: 你的项目名称。
46
- - `projectDesc`: 你的项目的简短描述。
47
- - `projectLogo`: 你的项目徽标的 URL。
34
+ | Parameter | Description |
35
+ |---|---|
36
+ | `projectName` | 你的项目名称。如果 `package.json` 文件存在,则自动从中检测。 |
37
+ | `projectDesc` | 你的项目的简短描述。自动从 `package.json` 检测。 |
38
+ | `projectLogo` | 你的项目徽标图片的路径或 URL。 |
48
39
 
49
- ### 文档风格
40
+ ### 文档策略
50
41
 
51
- 这些参数定义了文档的用途、受众和整体基调。
42
+ 这些参数定义了生成内容的基调、风格和深度。
52
43
 
53
44
  #### `documentPurpose`
45
+ 你希望读者实现的主要成果是什么?此设置会影响文档的整体结构和重点。
54
46
 
55
- 定义读者的主要目标。你可以选择多个用途。
56
-
57
- | Key | Name | Description |
47
+ | Option | Name | Description |
58
48
  |---|---|---|
59
49
  | `getStarted` | 快速入门 | 帮助新用户在 30 分钟内从零开始上手。 |
60
- | `completeTasks` | 完成特定任务 | 引导用户完成常见的工作流程和用例。 |
50
+ | `completeTasks` | 完成特定任务 | 引导用户完成常见工作流和用例。 |
61
51
  | `findAnswers` | 快速查找答案 | 为所有功能和 API 提供可搜索的参考。 |
62
- | `understandSystem` | 理解系统 | 解释其工作原理以及做出设计决策的原因。 |
52
+ | `understandSystem`| 理解系统 | 解释其工作原理以及做出设计决策的原因。 |
63
53
  | `solveProblems` | 排查常见问题 | 帮助用户排查和修复问题。 |
64
- | `mixedPurpose` | 满足多种用途 | 涵盖多种需求的综合性文档。 |
65
-
66
- **示例:**
67
- ```yaml
68
- documentPurpose:
69
- - getStarted
70
- - findAnswers
71
- ```
54
+ | `mixedPurpose` | 服务于多种目的 | 涵盖多种需求的文档。 |
72
55
 
73
56
  #### `targetAudienceTypes`
57
+ 谁会最常阅读这份文档?这个选择会影响写作风格和示例。
74
58
 
75
- 指定文档的主要受众。
76
-
77
- | Key | Name | Description |
59
+ | Option | Name | Description |
78
60
  |---|---|---|
79
61
  | `endUsers` | 最终用户(非技术人员) | 使用产品但不编写代码的人员。 |
80
- | `developers` | 集成你的产品/API 的开发者 | 将此产品添加到其项目中的工程师。 |
81
- | `devops` | DevOps / SRE / 基础设施团队 | 负责部署、监控和维护系统的团队。 |
82
- | `decisionMakers` | 技术决策者 | 评估或规划实施方案的架构师和负责人。 |
62
+ | `developers` | 集成你的产品/API 的开发者 | 将此添加到其项目中的工程师。 |
63
+ | `devops` | DevOps / SRE / 基础设施团队 | 部署、监控和维护系统的团队。 |
64
+ | `decisionMakers`| 技术决策者 | 评估或规划实施的架构师或负责人。 |
83
65
  | `supportTeams` | 支持团队 | 帮助他人使用产品的人员。 |
84
- | `mixedTechnical` | 混合技术受众 | 开发者、DevOps 和技术用户。 |
85
-
86
- **示例:**
87
- ```yaml
88
- targetAudienceTypes:
89
- - developers
90
- ```
66
+ | `mixedTechnical`| 混合技术受众 | 开发者、DevOps 和其他技术用户。 |
91
67
 
92
68
  #### `readerKnowledgeLevel`
69
+ 读者通常具备哪些知识?这会调整所假定的基础知识水平。
93
70
 
94
- 描述读者的典型初始知识水平。
95
-
96
- | Key | Name | Description |
71
+ | Option | Name | Description |
97
72
  |---|---|---|
98
- | `completeBeginners` | 完全的初学者,从零开始 | 完全不了解该领域/技术。 |
99
- | `domainFamiliar` | 以前使用过类似的工具 | 了解问题领域,但对这个具体解决方案不熟悉。 |
100
- | `experiencedUsers` | 试图做特定事情的专家 | 需要参考/高级主题的普通用户。 |
101
- | `emergencyTroubleshooting` | 紧急情况/故障排查 | 出现问题,需要快速修复。 |
102
- | `exploringEvaluating` | 正在评估此工具并与其他工具进行比较 | 试图了解这是否满足他们的需求。 |
103
-
104
- **示例:**
105
- ```yaml
106
- readerKnowledgeLevel: completeBeginners
107
- ```
73
+ | `completeBeginners` | 完全的初学者,从零开始 | 完全不了解此领域/技术。 |
74
+ | `domainFamiliar` | 之前使用过类似的工具 | 了解问题领域,但对这个具体解决方案不熟悉。 |
75
+ | `experiencedUsers` | 希望完成特定任务的专家 | 需要参考或高级主题的普通用户。 |
76
+ | `emergencyTroubleshooting`| 紧急情况/故障排查 | 出现问题,需要快速修复。 |
77
+ | `exploringEvaluating` | 正在评估此工具并与其他工具进行比较 | 试图了解这是否符合他们的需求。 |
108
78
 
109
79
  #### `documentationDepth`
80
+ 文档应有多全面?
110
81
 
111
- 控制文档的全面程度。
112
-
113
- | Key | Name | Description |
82
+ | Option | Name | Description |
114
83
  |---|---|---|
115
- | `essentialOnly` | 仅包含基本内容 | 覆盖 80% 的用例,保持简洁。 |
116
- | `balancedCoverage` | 平衡的覆盖范围 | 具有良好深度和实际示例 [推荐]。 |
84
+ | `essentialOnly` | 仅包含核心内容 | 覆盖 80% 的用例,保持简洁。 |
85
+ | `balancedCoverage`| 均衡覆盖 | 具有良好深度和实际示例 [推荐]。 |
117
86
  | `comprehensive` | 全面 | 覆盖所有功能、边缘情况和高级场景。 |
118
- | `aiDecide` | AI 决定 | 分析代码复杂性并建议适当的深度。 |
87
+ | `aiDecide` | AI 决定 | 分析代码复杂性并建议合适的深度。 |
119
88
 
120
- **示例:**
121
- ```yaml
122
- documentationDepth: balancedCoverage
123
- ```
89
+ ### 自定义指令
124
90
 
125
- ### 自定义规则和描述
91
+ 为实现更精细的控制,你可以提供自由文本指令。
126
92
 
127
- 这些字段允许你向 AI 提供更具体的指令。
93
+ | Parameter | Description |
94
+ |---|---|
95
+ | `rules` | 一个多行字符串,你可以在其中定义具体的文档生成规则和要求(例如,“始终包含性能基准测试”)。 |
96
+ | `targetAudience`| 一个多行字符串,用于比预设更详细地描述你的特定目标受众及其特征。 |
128
97
 
129
- - `rules`: 一个多行字符串,你可以在其中定义具体的生成规则和要求,例如“在教程中始终包含‘先决条件’部分”。
130
- - `targetAudience`: 一个多行字符串,用于比预设选项更详细地描述你的目标受众。
98
+ ### 语言和路径配置
131
99
 
132
- **示例:**
133
- ```yaml
134
- rules: |
135
- - 所有代码示例必须是完整的,并且可以直接复制粘贴。
136
- - 避免使用未加解释的技术术语。
137
- targetAudience: |
138
- 我们的受众是熟悉 JavaScript 但可能不熟悉后端概念的前端开发者。他们重视清晰、实用的示例。
139
- ```
100
+ 这些设置控制本地化和文件位置。
101
+
102
+ | Parameter | Description |
103
+ |---|---|
104
+ | `locale` | 文档的主要语言(例如,`en`、`zh`)。 |
105
+ | `translateLanguages` | 要将文档翻译成的语言代码列表(例如,`[ja, fr, es]`)。 |
106
+ | `docsDir` | 保存生成的文档文件的目录。 |
107
+ | `sourcesPath` | 供 DocSmith 分析的源代码路径或 glob 模式列表(例如,`['./src', './lib/**/*.js']`)。 |
108
+ | `glossary` | 包含项目特定术语的 markdown 文件(`@glossary.md`)的路径,以确保翻译的一致性。 |
109
+
110
+ ## config.yaml 示例
140
111
 
141
- ### 语言和路径设置
112
+ 这是一个完整的配置文件示例,其中包含解释每个部分的注释。你可以随时直接编辑此文件以更改设置。
142
113
 
143
- 这些参数用于配置文档的语言和文件位置。
114
+ ```yaml Example config.yaml icon=logos:yaml
115
+ # 用于文档发布的项目信息
116
+ projectName: AIGNE DocSmith
117
+ projectDesc: A powerful, AI-driven documentation generation tool.
118
+ projectLogo: https://docsmith.aigne.io/image-bin/uploads/def424c20bbdb3c77483894fe0e22819.png
144
119
 
145
- - `locale`: 文档的主要语言(例如 `en`、`zh`)。
146
- - `translateLanguages`: 要将文档翻译成的目标语言代码列表。
147
- - `glossary`: 指向一个 Markdown 文件的路径,该文件包含项目特定术语,以确保翻译的一致性。
148
- - `docsDir`: 用于保存生成的文档的目录。
149
- - `sourcesPath`: 供 AI 分析的源代码路径或 glob 模式列表。
120
+ # =============================================================================
121
+ # 文档配置
122
+ # =============================================================================
123
+
124
+ # 目的:你希望读者实现的主要成果是什么?
125
+ # 可用选项(根据需要取消注释并修改):
126
+ # getStarted - 快速入门:帮助新用户在 30 分钟内从零开始上手
127
+ # completeTasks - 完成特定任务:引导用户完成常见工作流和用例
128
+ # findAnswers - 快速查找答案:为所有功能和 API 提供可搜索的参考
129
+ # understandSystem - 理解系统:解释其工作原理以及做出设计决策的原因
130
+ # solveProblems - 排查常见问题:帮助用户排查和修复问题
131
+ # mixedPurpose - 服务于多种目的:涵盖多种需求的综合性文档
132
+ documentPurpose:
133
+ - completeTasks
134
+ - findAnswers
135
+
136
+ # 目标受众:谁会最常阅读这份文档?
137
+ # 可用选项(根据需要取消注释并修改):
138
+ # endUsers - 最终用户(非技术人员):使用产品但不编写代码的人员
139
+ # developers - 集成你的产品/API 的开发者:将此添加到其项目中的工程师
140
+ # devops - DevOps / SRE / 基础设施团队:部署、监控、维护系统的团队
141
+ # decisionMakers - 技术决策者:评估或规划实施的架构师、负责人
142
+ # supportTeams - 支持团队:帮助他人使用产品的人员
143
+ # mixedTechnical - 混合技术受众:开发者、DevOps 和技术用户
144
+ targetAudienceTypes:
145
+ - developers
146
+
147
+ # 读者知识水平:读者通常具备哪些知识?
148
+ # 可用选项(根据需要取消注释并修改):
149
+ # completeBeginners - 完全的初学者,从零开始:完全不了解此领域/技术
150
+ # domainFamiliar - 之前使用过类似的工具:了解问题领域,但对这个具体解决方案不熟悉
151
+ # experiencedUsers - 希望完成特定任务的专家:需要参考/高级主题的普通用户
152
+ # emergencyTroubleshooting - 紧急情况/故障排查:出现问题,需要快速修复
153
+ # exploringEvaluating - 正在评估此工具并与其他工具进行比较:试图了解这是否符合他们的需求
154
+ readerKnowledgeLevel: domainFamiliar
155
+
156
+ # 文档深度:文档应有多全面?
157
+ # 可用选项(根据需要取消注释并修改):
158
+ # essentialOnly - 仅包含核心内容:覆盖 80% 的用例,保持简洁
159
+ # balancedCoverage - 均衡覆盖:具有良好深度和实际示例 [推荐]
160
+ # comprehensive - 全面:覆盖所有功能、边缘情况和高级场景
161
+ # aiDecide - 由 AI 决定:分析代码复杂性并建议合适的深度
162
+ documentationDepth: balancedCoverage
163
+
164
+ # 自定义规则:定义具体的文档生成规则和要求
165
+ rules: |+
166
+
167
+
168
+ # 目标受众:描述你的特定目标受众及其特征
169
+ targetAudience: |+
170
+
171
+
172
+ # 术语表:定义项目特定的术语和定义
173
+ # glossary: "@glossary.md" # 包含术语表定义的 markdown 文件路径
150
174
 
151
- **示例:**
152
- ```yaml
153
- # 语言设置
154
175
  locale: en
155
- translateLanguages:
156
- - zh
157
- - ja
158
-
159
- # 用于确保术语一致性的词汇表
160
- glossary: "@glossary.md"
161
-
162
- # 目录和源路径配置
163
- docsDir: .aigne/doc-smith/docs # 保存生成文档的目录
164
- sourcesPath: # 需要分析的源代码路径
165
- - ./src
166
- - ./README.md
176
+ # translateLanguages: # 要将文档翻译成的语言列表
177
+ # - zh # 示例:中文翻译
178
+ # - fr # 示例:法语翻译
179
+ docsDir: .aigne/doc-smith/docs # 保存生成的文档的目录
180
+ sourcesPath: # 要分析的源代码路径
181
+ - ./
167
182
  ```
168
183
 
169
- ---
170
-
171
- 根据你的项目定制好 `config.yaml` 文件后,你就可以开始创建文档了。下一步是运行生成命令。
184
+ 配置设置完成后,你就可以创建符合项目需求的文档了。下一步是运行生成命令。
172
185
 
173
- ➡️ **下一步:** 学习如何 [生成文档](./features-generate-documentation.md)
186
+ ➡️ **下一步:** [生成文档](./features-generate-documentation.md)