@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.
- 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 +17 -0
- package/README.md +77 -5
- 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/kroki-utils.test.mjs +88 -17
- package/utils/constants.mjs +15 -1
- 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
package/docs/configuration.md
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
|
7
|
+
## Core Configuration Areas
|
|
12
8
|
|
|
13
|
-
|
|
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-
|
|
17
|
-
Learn
|
|
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-
|
|
20
|
-
|
|
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"
|
|
23
|
-
|
|
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-
|
|
26
|
-
Understand how DocSmith
|
|
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
|
|
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
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
40
|
+
### Documentation Strategy
|
|
50
41
|
|
|
51
|
-
These parameters define the
|
|
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
|
-
|
|
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
|
|
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 |
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
101
|
-
| `emergencyTroubleshooting
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
| Key | Name | Description |
|
|
82
|
+
| Option | Name | Description |
|
|
114
83
|
|---|---|---|
|
|
115
|
-
| `essentialOnly` | Essential only | Cover the 80% use cases,
|
|
116
|
-
| `balancedCoverage
|
|
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
|
-
|
|
121
|
-
```yaml
|
|
122
|
-
documentationDepth: balancedCoverage
|
|
123
|
-
```
|
|
89
|
+
### Custom Directives
|
|
124
90
|
|
|
125
|
-
|
|
91
|
+
For more granular control, you can provide free-text instructions.
|
|
126
92
|
|
|
127
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
110
|
+
## Example `config.yaml`
|
|
144
111
|
|
|
145
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
#
|
|
160
|
-
|
|
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
|
-
#
|
|
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
|
-
- ./
|
|
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:**
|
|
186
|
+
➡️ **Next:** [Generate Documentation](./features-generate-documentation.md)
|
package/docs/configuration.zh.md
CHANGED
|
@@ -1,173 +1,186 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# 配置指南
|
|
6
2
|
|
|
7
|
-
AIGNE DocSmith
|
|
3
|
+
AIGNE DocSmith 的行为由一个中心文件 `config.yaml` 控制,该文件通常位于 `.aigne/doc-smith/config.yaml`。此文件规定了文档的风格、目标受众、语言和结构。
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
你可以通过运行 `aigne doc init`,使用交互式设置向导来创建和管理此文件。有关分步指南,请参阅[交互式设置](./configuration-interactive-setup.md)指南。
|
|
10
6
|
|
|
11
|
-
##
|
|
7
|
+
## 核心配置区域
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
你的文档由几个关键的配置区域决定。浏览这些指南,了解如何微调生成过程的各个方面。
|
|
14
10
|
|
|
15
11
|
<x-cards data-columns="2">
|
|
16
|
-
<x-card data-title="交互式设置" data-
|
|
17
|
-
|
|
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-
|
|
20
|
-
|
|
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"
|
|
23
|
-
|
|
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-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
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` |
|
|
116
|
-
| `balancedCoverage
|
|
84
|
+
| `essentialOnly` | 仅包含核心内容 | 覆盖 80% 的用例,保持简洁。 |
|
|
85
|
+
| `balancedCoverage`| 均衡覆盖 | 具有良好深度和实际示例 [推荐]。 |
|
|
117
86
|
| `comprehensive` | 全面 | 覆盖所有功能、边缘情况和高级场景。 |
|
|
118
|
-
| `aiDecide` |
|
|
87
|
+
| `aiDecide` | 由 AI 决定 | 分析代码复杂性并建议合适的深度。 |
|
|
119
88
|
|
|
120
|
-
|
|
121
|
-
```yaml
|
|
122
|
-
documentationDepth: balancedCoverage
|
|
123
|
-
```
|
|
89
|
+
### 自定义指令
|
|
124
90
|
|
|
125
|
-
|
|
91
|
+
为实现更精细的控制,你可以提供自由文本指令。
|
|
126
92
|
|
|
127
|
-
|
|
93
|
+
| Parameter | Description |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `rules` | 一个多行字符串,你可以在其中定义具体的文档生成规则和要求(例如,“始终包含性能基准测试”)。 |
|
|
96
|
+
| `targetAudience`| 一个多行字符串,用于比预设更详细地描述你的特定目标受众及其特征。 |
|
|
128
97
|
|
|
129
|
-
|
|
130
|
-
- `targetAudience`: 一个多行字符串,用于比预设选项更详细地描述你的目标受众。
|
|
98
|
+
### 语言和路径配置
|
|
131
99
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
#
|
|
160
|
-
|
|
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
|
-
➡️ **下一步:**
|
|
186
|
+
➡️ **下一步:** [生成文档](./features-generate-documentation.md)
|