@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/cli-reference.md
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# CLI Command Reference
|
|
6
2
|
|
|
7
|
-
This guide provides a
|
|
3
|
+
This guide provides a reference for all available `aigne doc` sub-commands, their arguments, and options. It is intended for users who want to use the command-line interface to its full potential.
|
|
8
4
|
|
|
9
5
|
The general syntax is:
|
|
10
6
|
|
|
@@ -12,13 +8,82 @@ The general syntax is:
|
|
|
12
8
|
aigne doc <command> [options]
|
|
13
9
|
```
|
|
14
10
|
|
|
11
|
+
### Command Workflow
|
|
12
|
+
|
|
13
|
+
The following diagram illustrates the typical lifecycle of creating and maintaining documentation with DocSmith's CLI commands:
|
|
14
|
+
|
|
15
|
+
```d2
|
|
16
|
+
direction: down
|
|
17
|
+
|
|
18
|
+
Start: {
|
|
19
|
+
label: "Project Setup"
|
|
20
|
+
shape: circle
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
init: {
|
|
24
|
+
label: "aigne doc init\n(Interactive Setup)"
|
|
25
|
+
shape: rectangle
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
generate: {
|
|
29
|
+
label: "aigne doc generate\n(Create/Update All Docs)"
|
|
30
|
+
shape: rectangle
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
refinement-cycle: {
|
|
34
|
+
label: "Refinement Cycle"
|
|
35
|
+
shape: rectangle
|
|
36
|
+
grid-columns: 2
|
|
37
|
+
|
|
38
|
+
update: {
|
|
39
|
+
label: "aigne doc update\n(Refine Single Doc)"
|
|
40
|
+
}
|
|
41
|
+
translate: {
|
|
42
|
+
label: "aigne doc translate\n(Localize Content)"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
publish: {
|
|
47
|
+
label: "aigne doc publish\n(Deploy Docs)"
|
|
48
|
+
shape: rectangle
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
End: {
|
|
52
|
+
label: "Docs Live"
|
|
53
|
+
shape: circle
|
|
54
|
+
style.fill: "#a2eeaf"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
prefs: {
|
|
58
|
+
label: "aigne doc prefs\n(Manage Learned Rules)"
|
|
59
|
+
shape: cylinder
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
Start -> init: "Optional" {
|
|
63
|
+
style.stroke-dash: 4
|
|
64
|
+
}
|
|
65
|
+
init -> generate: "Configure"
|
|
66
|
+
Start -> generate: "Direct"
|
|
67
|
+
generate -> refinement-cycle: "Refine"
|
|
68
|
+
refinement-cycle -> publish: "Ready"
|
|
69
|
+
generate -> publish: "Direct Deploy"
|
|
70
|
+
publish -> End
|
|
71
|
+
|
|
72
|
+
prefs <-> generate: "Influences" {
|
|
73
|
+
style.stroke-dash: 2
|
|
74
|
+
}
|
|
75
|
+
prefs <-> refinement-cycle: "Influences" {
|
|
76
|
+
style.stroke-dash: 2
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
15
80
|
---
|
|
16
81
|
|
|
17
82
|
## `aigne doc generate`
|
|
18
83
|
|
|
19
84
|
**Aliases:** `gen`, `g`
|
|
20
85
|
|
|
21
|
-
|
|
86
|
+
Analyzes your source code and generates a complete set of documentation based on your configuration. If no configuration is found, it automatically launches the interactive setup wizard.
|
|
22
87
|
|
|
23
88
|
### Options
|
|
24
89
|
|
|
@@ -26,7 +91,7 @@ Automatically analyzes your source code and generates a complete set of document
|
|
|
26
91
|
|---|---|---|
|
|
27
92
|
| `--feedback` | string | Provides feedback to adjust and refine the overall document structure plan. |
|
|
28
93
|
| `--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
|
|
94
|
+
| `--model` | string | Specifies a particular LLM to use for generation (e.g., `openai:gpt-4o`). Overrides the default model. |
|
|
30
95
|
| `--glossary` | string | Path to a glossary file for consistent terminology. Use the format `@path/to/glossary.md`. |
|
|
31
96
|
|
|
32
97
|
### Usage Examples
|
|
@@ -63,9 +128,10 @@ Optimizes and regenerates specific documents. You can run it interactively to se
|
|
|
63
128
|
|
|
64
129
|
| Option | Type | Description |
|
|
65
130
|
|---|---|---|
|
|
66
|
-
| `--docs` | array | A list of document paths to regenerate (e.g., `--docs overview.md
|
|
131
|
+
| `--docs` | array | A list of document paths to regenerate (e.g., `--docs overview.md`). Can be used multiple times. |
|
|
67
132
|
| `--feedback` | string | Provides specific feedback to improve the content of the selected document(s). |
|
|
68
133
|
| `--glossary` | string | Path to a glossary file for consistent terminology. Use the format `@path/to/glossary.md`. |
|
|
134
|
+
| `--reset` | boolean | Ignores previous results and regenerates content from scratch for the selected documents. |
|
|
69
135
|
|
|
70
136
|
### Usage Examples
|
|
71
137
|
|
|
@@ -76,7 +142,7 @@ aigne doc update
|
|
|
76
142
|
|
|
77
143
|
**Update a specific document with targeted feedback:**
|
|
78
144
|
```bash
|
|
79
|
-
aigne doc update --docs /cli-reference
|
|
145
|
+
aigne doc update --docs /cli-reference --feedback "Clarify the difference between the --docs and --langs options."
|
|
80
146
|
```
|
|
81
147
|
|
|
82
148
|
---
|
|
@@ -89,8 +155,8 @@ Translates existing documentation into one or more languages. It can be run inte
|
|
|
89
155
|
|
|
90
156
|
| Option | Type | Description |
|
|
91
157
|
|---|---|---|
|
|
92
|
-
| `--docs` | array | A list of document paths to translate.
|
|
93
|
-
| `--langs` | array | A list of target language codes (e.g., `zh`, `ja`, `es`).
|
|
158
|
+
| `--docs` | array | A list of document paths to translate. Can be used multiple times. |
|
|
159
|
+
| `--langs` | array | A list of target language codes (e.g., `zh`, `ja`, `es`). Can be used multiple times. |
|
|
94
160
|
| `--feedback` | string | Provides feedback to improve the quality of the translation. |
|
|
95
161
|
| `--glossary` | string | Path to a glossary file to ensure consistent terminology across languages. Use `@path/to/glossary.md`. |
|
|
96
162
|
|
|
@@ -123,7 +189,7 @@ Publishes your generated documentation to a Discuss Kit platform. You can publis
|
|
|
123
189
|
|
|
124
190
|
| Option | Type | Description |
|
|
125
191
|
|---|---|---|
|
|
126
|
-
| `--appUrl` | string | The URL of your self-hosted Discuss Kit instance. If not provided, the command runs interactively
|
|
192
|
+
| `--appUrl` | string | The URL of your self-hosted Discuss Kit instance. If not provided, the command runs interactively. |
|
|
127
193
|
|
|
128
194
|
### Usage Examples
|
|
129
195
|
|
|
@@ -163,7 +229,7 @@ Manages user preferences that DocSmith learns from your feedback over time. Thes
|
|
|
163
229
|
| `--list` | boolean | Lists all saved preferences, showing their status (active/inactive), scope, and content. |
|
|
164
230
|
| `--remove` | boolean | Removes one or more preferences. Runs interactively if `--id` is not provided. |
|
|
165
231
|
| `--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`. |
|
|
232
|
+
| `--id` | array | Specifies the preference ID(s) to act upon for `--remove` or `--toggle`. Can be used multiple times. |
|
|
167
233
|
|
|
168
234
|
### Usage Examples
|
|
169
235
|
|
package/docs/cli-reference.zh.md
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
---
|
|
2
|
-
labels: ["Reference"]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
1
|
# CLI 命令参考
|
|
6
2
|
|
|
7
|
-
本指南为所有可用的 `aigne doc`
|
|
3
|
+
本指南为所有可用的 `aigne doc` 子命令及其参数和选项提供了参考。旨在帮助用户充分利用命令行界面。
|
|
8
4
|
|
|
9
5
|
通用语法如下:
|
|
10
6
|
|
|
@@ -12,21 +8,90 @@ labels: ["Reference"]
|
|
|
12
8
|
aigne doc <command> [options]
|
|
13
9
|
```
|
|
14
10
|
|
|
11
|
+
### 命令工作流
|
|
12
|
+
|
|
13
|
+
下图展示了使用 DocSmith 的 CLI 命令创建和维护文档的典型生命周期:
|
|
14
|
+
|
|
15
|
+
```d2
|
|
16
|
+
direction: down
|
|
17
|
+
|
|
18
|
+
Start: {
|
|
19
|
+
label: "项目设置"
|
|
20
|
+
shape: circle
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
init: {
|
|
24
|
+
label: "aigne doc init\n(交互式设置)"
|
|
25
|
+
shape: rectangle
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
generate: {
|
|
29
|
+
label: "aigne doc generate\n(创建/更新所有文档)"
|
|
30
|
+
shape: rectangle
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
refinement-cycle: {
|
|
34
|
+
label: "优化周期"
|
|
35
|
+
shape: rectangle
|
|
36
|
+
grid-columns: 2
|
|
37
|
+
|
|
38
|
+
update: {
|
|
39
|
+
label: "aigne doc update\n(优化单个文档)"
|
|
40
|
+
}
|
|
41
|
+
translate: {
|
|
42
|
+
label: "aigne doc translate\n(本地化内容)"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
publish: {
|
|
47
|
+
label: "aigne doc publish\n(部署文档)"
|
|
48
|
+
shape: rectangle
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
End: {
|
|
52
|
+
label: "文档上线"
|
|
53
|
+
shape: circle
|
|
54
|
+
style.fill: "#a2eeaf"
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
prefs: {
|
|
58
|
+
label: "aigne doc prefs\n(管理学习到的规则)"
|
|
59
|
+
shape: cylinder
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
Start -> init: "可选" {
|
|
63
|
+
style.stroke-dash: 4
|
|
64
|
+
}
|
|
65
|
+
init -> generate: "配置"
|
|
66
|
+
Start -> generate: "直接"
|
|
67
|
+
generate -> refinement-cycle: "优化"
|
|
68
|
+
refinement-cycle -> publish: "就绪"
|
|
69
|
+
generate -> publish: "直接部署"
|
|
70
|
+
publish -> End
|
|
71
|
+
|
|
72
|
+
prefs <-> generate: "影响" {
|
|
73
|
+
style.stroke-dash: 2
|
|
74
|
+
}
|
|
75
|
+
prefs <-> refinement-cycle: "影响" {
|
|
76
|
+
style.stroke-dash: 2
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
15
80
|
---
|
|
16
81
|
|
|
17
82
|
## `aigne doc generate`
|
|
18
83
|
|
|
19
84
|
**别名:** `gen`, `g`
|
|
20
85
|
|
|
21
|
-
|
|
86
|
+
分析您的源代码,并根据您的配置生成一套完整的文档。如果未找到配置,它将自动启动交互式设置向导。
|
|
22
87
|
|
|
23
88
|
### 选项
|
|
24
89
|
|
|
25
|
-
|
|
|
90
|
+
| Option | Type | Description |
|
|
26
91
|
|---|---|---|
|
|
27
92
|
| `--feedback` | string | 提供反馈以调整和优化整体文档结构规划。 |
|
|
28
|
-
| `--forceRegenerate` | boolean |
|
|
29
|
-
| `--model` | string | 指定用于生成的特定 LLM(例如,`openai:gpt-4o
|
|
93
|
+
| `--forceRegenerate` | boolean | 丢弃现有内容,从头开始重新生成所有文档。 |
|
|
94
|
+
| `--model` | string | 指定用于生成的特定 LLM(例如,`openai:gpt-4o`)。此选项将覆盖默认模型。 |
|
|
30
95
|
| `--glossary` | string | 用于保持术语一致性的术语表文件路径。使用 `@path/to/glossary.md` 格式。 |
|
|
31
96
|
|
|
32
97
|
### 使用示例
|
|
@@ -57,15 +122,16 @@ aigne doc generate --model google:gemini-1.5-flash
|
|
|
57
122
|
|
|
58
123
|
**别名:** `up`
|
|
59
124
|
|
|
60
|
-
|
|
125
|
+
优化并重新生成特定文档。您可以以交互方式运行以选择文档,或直接使用选项指定文档。此命令对于根据反馈进行有针对性的改进非常有用,无需重新生成整个项目。
|
|
61
126
|
|
|
62
127
|
### 选项
|
|
63
128
|
|
|
64
|
-
|
|
|
129
|
+
| Option | Type | Description |
|
|
65
130
|
|---|---|---|
|
|
66
|
-
| `--docs` | array | 要重新生成的文档路径列表(例如,`--docs overview.md
|
|
131
|
+
| `--docs` | array | 要重新生成的文档路径列表(例如,`--docs overview.md`)。可多次使用。 |
|
|
67
132
|
| `--feedback` | string | 提供具体反馈以改进所选文档的内容。 |
|
|
68
133
|
| `--glossary` | string | 用于保持术语一致性的术语表文件路径。使用 `@path/to/glossary.md` 格式。 |
|
|
134
|
+
| `--reset` | boolean | 忽略之前的结果,为所选文档从头开始重新生成内容。 |
|
|
69
135
|
|
|
70
136
|
### 使用示例
|
|
71
137
|
|
|
@@ -74,23 +140,23 @@ aigne doc generate --model google:gemini-1.5-flash
|
|
|
74
140
|
aigne doc update
|
|
75
141
|
```
|
|
76
142
|
|
|
77
|
-
|
|
143
|
+
**使用针对性反馈更新特定文档:**
|
|
78
144
|
```bash
|
|
79
|
-
aigne doc update --docs /cli-reference
|
|
145
|
+
aigne doc update --docs /cli-reference --feedback "阐明 --docs 和 --langs 选项之间的区别。"
|
|
80
146
|
```
|
|
81
147
|
|
|
82
148
|
---
|
|
83
149
|
|
|
84
150
|
## `aigne doc translate`
|
|
85
151
|
|
|
86
|
-
|
|
152
|
+
将现有文档翻译成一种或多种语言。可以以交互方式运行以选择文档和语言,也可以通过参数指定以非交互方式运行。
|
|
87
153
|
|
|
88
154
|
### 选项
|
|
89
155
|
|
|
90
|
-
|
|
|
156
|
+
| Option | Type | Description |
|
|
91
157
|
|---|---|---|
|
|
92
|
-
| `--docs` | array |
|
|
93
|
-
| `--langs` | array | 目标语言代码列表(例如,`zh`、`ja`、`es
|
|
158
|
+
| `--docs` | array | 要翻译的文档路径列表。可多次使用。 |
|
|
159
|
+
| `--langs` | array | 目标语言代码列表(例如,`zh`、`ja`、`es`)。可多次使用。 |
|
|
94
160
|
| `--feedback` | string | 提供反馈以提高翻译质量。 |
|
|
95
161
|
| `--glossary` | string | 用于确保跨语言术语一致性的术语表文件路径。使用 `@path/to/glossary.md`。 |
|
|
96
162
|
|
|
@@ -117,13 +183,13 @@ aigne doc translate --glossary @glossary.md --feedback "日语翻译请使用正
|
|
|
117
183
|
|
|
118
184
|
**别名:** `pub`, `p`
|
|
119
185
|
|
|
120
|
-
将您生成的文档发布到 Discuss Kit 平台。您可以发布到官方的 AIGNE DocSmith
|
|
186
|
+
将您生成的文档发布到 Discuss Kit 平台。您可以发布到官方的 AIGNE DocSmith 平台,也可以发布到您自己托管的实例。
|
|
121
187
|
|
|
122
188
|
### 选项
|
|
123
189
|
|
|
124
|
-
|
|
|
190
|
+
| Option | Type | Description |
|
|
125
191
|
|---|---|---|
|
|
126
|
-
| `--appUrl` | string | 您自托管的 Discuss Kit 实例的 URL
|
|
192
|
+
| `--appUrl` | string | 您自托管的 Discuss Kit 实例的 URL。如果未提供,该命令将以交互方式运行。 |
|
|
127
193
|
|
|
128
194
|
### 使用示例
|
|
129
195
|
|
|
@@ -141,7 +207,7 @@ aigne doc publish --appUrl https://docs.my-company.com
|
|
|
141
207
|
|
|
142
208
|
## `aigne doc init`
|
|
143
209
|
|
|
144
|
-
|
|
210
|
+
手动启动交互式配置向导。这对于设置新项目或修改现有项目的配置非常有用。该向导将引导您定义源代码路径、设置输出目录、选择语言以及定义文档的风格和目标受众。
|
|
145
211
|
|
|
146
212
|
### 使用示例
|
|
147
213
|
|
|
@@ -154,16 +220,16 @@ aigne doc init
|
|
|
154
220
|
|
|
155
221
|
## `aigne doc prefs`
|
|
156
222
|
|
|
157
|
-
管理 DocSmith
|
|
223
|
+
管理 DocSmith 随时间从您的反馈中学习到的用户偏好。这些偏好将在未来的生成和更新任务中作为规则应用,以保持与您的风格一致。
|
|
158
224
|
|
|
159
225
|
### 选项
|
|
160
226
|
|
|
161
|
-
|
|
|
227
|
+
| Option | Type | Description |
|
|
162
228
|
|---|---|---|
|
|
163
229
|
| `--list` | boolean | 列出所有已保存的偏好,显示其状态(激活/未激活)、范围和内容。 |
|
|
164
230
|
| `--remove` | boolean | 移除一个或多个偏好。如果未提供 `--id`,则以交互方式运行。 |
|
|
165
231
|
| `--toggle` | boolean | 切换一个或多个偏好的激活状态。如果未提供 `--id`,则以交互方式运行。 |
|
|
166
|
-
| `--id` | array |
|
|
232
|
+
| `--id` | array | 为 `--remove` 或 `--toggle` 指定要操作的偏好 ID。可多次使用。 |
|
|
167
233
|
|
|
168
234
|
### 使用示例
|
|
169
235
|
|
|
@@ -182,4 +248,4 @@ aigne doc prefs --remove
|
|
|
182
248
|
aigne doc prefs --toggle --id <preference-id>
|
|
183
249
|
```
|
|
184
250
|
|
|
185
|
-
有关如何根据您的需求定制 DocSmith 的更多详细信息,请参阅
|
|
251
|
+
有关如何根据您的需求定制 DocSmith 的更多详细信息,请参阅[配置指南](./configuration.md)。
|
|
@@ -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>
|