@aigne/doc-smith 0.8.11-beta.6 → 0.8.11
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 +2 -0
- package/.aigne/doc-smith/output/structure-plan.json +2 -2
- package/.aigne/doc-smith/preferences.yml +28 -20
- package/.aigne/doc-smith/upload-cache.yaml +702 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/agents/generate/document-structure-tools/add-document.mjs +35 -10
- package/agents/generate/document-structure-tools/delete-document.mjs +35 -12
- package/agents/generate/document-structure-tools/move-document.mjs +43 -17
- package/agents/generate/document-structure-tools/update-document.mjs +37 -10
- package/agents/generate/update-document-structure.yaml +1 -7
- package/agents/generate/user-review-document-structure.mjs +5 -4
- package/agents/translate/translate-document.yaml +1 -9
- package/agents/update/check-update-is-single.mjs +2 -1
- package/agents/update/document-tools/update-document-content.mjs +24 -14
- package/agents/update/fs-tools/glob.mjs +184 -0
- package/agents/update/fs-tools/grep.mjs +317 -0
- package/agents/update/fs-tools/read-file.mjs +307 -0
- package/agents/update/generate-document.yaml +4 -7
- package/agents/update/update-document-detail.yaml +6 -10
- package/agents/update/user-review-document.mjs +13 -13
- package/assets/screenshots/doc-complete-setup.png +0 -0
- package/assets/screenshots/doc-generate-docs.png +0 -0
- package/assets/screenshots/doc-generate.png +0 -0
- package/assets/screenshots/doc-generated-successfully.png +0 -0
- package/assets/screenshots/doc-publish.png +0 -0
- package/assets/screenshots/doc-regenerate.png +0 -0
- package/assets/screenshots/doc-translate-langs.png +0 -0
- package/assets/screenshots/doc-translate.png +0 -0
- package/assets/screenshots/doc-update.png +0 -0
- package/docs/advanced-how-it-works.ja.md +31 -31
- package/docs/advanced-how-it-works.md +9 -9
- package/docs/advanced-how-it-works.zh-TW.md +24 -24
- package/docs/advanced-how-it-works.zh.md +20 -20
- package/docs/advanced-quality-assurance.ja.md +57 -61
- package/docs/advanced-quality-assurance.md +57 -61
- package/docs/advanced-quality-assurance.zh-TW.md +57 -61
- package/docs/advanced-quality-assurance.zh.md +57 -61
- package/docs/advanced.ja.md +8 -4
- package/docs/advanced.md +7 -3
- package/docs/advanced.zh-TW.md +9 -5
- package/docs/advanced.zh.md +9 -5
- package/docs/changelog.ja.md +206 -29
- package/docs/changelog.md +177 -0
- package/docs/changelog.zh-TW.md +229 -52
- package/docs/changelog.zh.md +204 -27
- package/docs/cli-reference.ja.md +82 -52
- package/docs/cli-reference.md +56 -26
- package/docs/cli-reference.zh-TW.md +82 -52
- package/docs/cli-reference.zh.md +70 -40
- package/docs/configuration-interactive-setup.ja.md +45 -42
- package/docs/configuration-interactive-setup.md +8 -5
- package/docs/configuration-interactive-setup.zh-TW.md +26 -23
- package/docs/configuration-interactive-setup.zh.md +25 -22
- package/docs/configuration-language-support.ja.md +33 -63
- package/docs/configuration-language-support.md +32 -62
- package/docs/configuration-language-support.zh-TW.md +35 -65
- package/docs/configuration-language-support.zh.md +32 -62
- package/docs/configuration-llm-setup.ja.md +25 -23
- package/docs/configuration-llm-setup.md +20 -18
- package/docs/configuration-llm-setup.zh-TW.md +21 -19
- package/docs/configuration-llm-setup.zh.md +20 -18
- package/docs/configuration-preferences.ja.md +67 -52
- package/docs/configuration-preferences.md +56 -41
- package/docs/configuration-preferences.zh-TW.md +69 -54
- package/docs/configuration-preferences.zh.md +68 -53
- package/docs/configuration.ja.md +65 -81
- package/docs/configuration.md +19 -35
- package/docs/configuration.zh-TW.md +62 -79
- package/docs/configuration.zh.md +50 -67
- package/docs/features-generate-documentation.ja.md +44 -69
- package/docs/features-generate-documentation.md +36 -61
- package/docs/features-generate-documentation.zh-TW.md +42 -67
- package/docs/features-generate-documentation.zh.md +41 -67
- package/docs/features-publish-your-docs.ja.md +36 -36
- package/docs/features-publish-your-docs.md +2 -2
- package/docs/features-publish-your-docs.zh-TW.md +21 -21
- package/docs/features-publish-your-docs.zh.md +23 -23
- package/docs/features-translate-documentation.ja.md +40 -31
- package/docs/features-translate-documentation.md +15 -6
- package/docs/features-translate-documentation.zh-TW.md +37 -28
- package/docs/features-translate-documentation.zh.md +23 -14
- package/docs/features-update-and-refine.ja.md +68 -118
- package/docs/features-update-and-refine.md +58 -108
- package/docs/features-update-and-refine.zh-TW.md +67 -116
- package/docs/features-update-and-refine.zh.md +64 -114
- package/docs/features.ja.md +29 -19
- package/docs/features.md +25 -15
- package/docs/features.zh-TW.md +28 -18
- package/docs/features.zh.md +31 -21
- package/docs/getting-started.ja.md +40 -43
- package/docs/getting-started.md +36 -39
- package/docs/getting-started.zh-TW.md +38 -41
- package/docs/getting-started.zh.md +45 -48
- package/docs/overview.ja.md +63 -11
- package/docs/overview.md +60 -8
- package/docs/overview.zh-TW.md +67 -15
- package/docs/overview.zh.md +62 -10
- package/media.md +9 -9
- package/package.json +1 -1
- package/prompts/detail/custom/custom-components.md +304 -188
- package/prompts/detail/document-rules.md +4 -4
- package/prompts/detail/generate-document.md +21 -8
- package/prompts/detail/update-document.md +8 -12
- package/prompts/structure/update-document-structure.md +12 -8
- package/prompts/utils/feedback-refiner.md +3 -3
- package/tests/agents/generate/document-structure-tools/move-document.test.mjs +9 -9
- package/tests/agents/generate/user-review-document-structure.test.mjs +29 -8
- package/tests/agents/update/document-tools/update-document-content.test.mjs +115 -112
- package/tests/agents/update/fs-tools/glob.test.mjs +438 -0
- package/tests/agents/update/fs-tools/grep.test.mjs +279 -0
- package/tests/agents/update/fs-tools/read-file.test.mjs +553 -0
- package/tests/agents/update/user-review-document.test.mjs +48 -27
- package/types/document-schema.mjs +5 -6
- package/types/document-structure-schema.mjs +20 -8
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
`aigne doc generate` コマンドは、ソースコードから完全なドキュメントセットを作成するための主要な機能です。このコマンドは、コードベースを分析し、論理的なドキュメント構造を計画し、各セクションのコンテンツを生成するプロセスを開始します。これは、初期状態からドキュメントを作成するための標準的な方法です。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 最初の生成
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
まず、プロジェクトのルートディレクトリに移動し、次のコマンドを実行します。
|
|
8
8
|
|
|
9
9
|
```bash aigne doc generate icon=lucide:play-circle
|
|
10
10
|
aigne doc generate
|
|
@@ -12,30 +12,30 @@ aigne doc generate
|
|
|
12
12
|
|
|
13
13
|
### 自動設定
|
|
14
14
|
|
|
15
|
-
プロジェクトでこのコマンドを初めて実行する場合、DocSmith
|
|
15
|
+
プロジェクトでこのコマンドを初めて実行する場合、DocSmith は設定が存在しないことを検出します。その後、対話式のセットアップウィザードが自動的に起動し、必要な設定手順を案内します。このプロセスにより、生成が開始される前に有効な設定が確実に配置されます。
|
|
16
16
|
|
|
17
|
-

|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
ドキュメントの主要な側面を定義するための一連の質問に答えるよう求められます。これには以下が含まれます。
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
* ドキュメント生成ルールとスタイル
|
|
22
|
+
* 対象読者
|
|
23
|
+
* 主要言語と追加の翻訳言語
|
|
24
|
+
* ソースコードの入力パスとドキュメントの出力パス
|
|
25
25
|
|
|
26
|
-

|
|
27
27
|
|
|
28
28
|
設定が完了すると、DocSmith はドキュメントの生成に進みます。
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
正常に完了すると、新しく作成されたドキュメントは、セットアップ中に指定された出力ディレクトリで利用可能になります。
|
|
33
33
|
|
|
34
|
-

|
|
35
35
|
|
|
36
36
|
## 生成プロセス
|
|
37
37
|
|
|
38
|
-
`generate`
|
|
38
|
+
`generate` コマンドは、自動化されたマルチステップのワークフローを実行します。プロセスは以下の通りです。
|
|
39
39
|
|
|
40
40
|
```d2
|
|
41
41
|
direction: down
|
|
@@ -46,75 +46,50 @@ User: {
|
|
|
46
46
|
|
|
47
47
|
AIGNE-CLI: {
|
|
48
48
|
label: "AIGNE CLI"
|
|
49
|
-
}
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
50
|
+
config-check: {
|
|
51
|
+
label: "設定ファイルは存在しますか?"
|
|
52
|
+
shape: diamond
|
|
53
|
+
}
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
55
|
+
interactive-setup: {
|
|
56
|
+
label: "対話式セットアップウィザード"
|
|
57
|
+
}
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
grid-columns: 1
|
|
59
|
+
generation-process: {
|
|
60
|
+
label: "3. 生成プロセス"
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
62
|
+
analyze-code: "コードの分析"
|
|
63
|
+
plan-structure: "構造の計画"
|
|
64
|
+
generate-content: "コンテンツの生成"
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
shape: cylinder
|
|
72
|
-
}
|
|
66
|
+
analyze-code -> plan-structure -> generate-content
|
|
67
|
+
}
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
output: {
|
|
70
|
+
label: "出力ディレクトリ"
|
|
71
|
+
}
|
|
77
72
|
}
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
User -> AIGNE-CLI: "1. aigne doc generate"
|
|
85
|
-
AIGNE-CLI -> Config-Check: "2. 設定の確認"
|
|
86
|
-
|
|
87
|
-
Config-Check -> Setup-Wizard: "3a. いいえ"
|
|
88
|
-
Setup-Wizard -> User: "入力を要求"
|
|
89
|
-
User -> Setup-Wizard: "回答を提供"
|
|
90
|
-
Setup-Wizard -> Config-File: "作成"
|
|
91
|
-
Config-File -> Generation-Process: "使用"
|
|
92
|
-
Setup-Wizard -> Generation-Process: "4. 続行"
|
|
93
|
-
|
|
94
|
-
Config-Check -> Generation-Process: "3b. はい"
|
|
95
|
-
|
|
96
|
-
Source-Code -> Generation-Process.Analyze: "入力"
|
|
97
|
-
Generation-Process.Analyze -> Generation-Process.Plan
|
|
98
|
-
Generation-Process.Plan -> Generation-Process.Generate
|
|
99
|
-
Generation-Process.Generate -> Output-Directory: "5. ドキュメントの書き込み"
|
|
100
|
-
|
|
101
|
-
Output-Directory -> User: "6. ドキュメントのレビュー"
|
|
74
|
+
User -> AIGNE-CLI.config-check: "'aigne doc generate'"
|
|
75
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.interactive-setup: "[いいえ] 2. セットアップの開始"
|
|
76
|
+
AIGNE-CLI.interactive-setup -> AIGNE-CLI.generation-process: "設定ファイルの作成"
|
|
77
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.generation-process: "[はい]"
|
|
78
|
+
AIGNE-CLI.generation-process -> AIGNE-CLI.output: "4. ドキュメントの書き込み"
|
|
102
79
|
```
|
|
103
80
|
|
|
104
81
|
## コマンドオプション
|
|
105
82
|
|
|
106
|
-
デフォルトの `generate`
|
|
83
|
+
デフォルトの `generate` コマンドは、ほとんどのユースケースで十分です。しかし、その動作を変更するためのいくつかのオプションが利用可能で、完全な再生成を強制したり、ドキュメント構造を洗練させたりするのに役立ちます。
|
|
107
84
|
|
|
108
|
-
| オプション
|
|
109
|
-
|
|
110
|
-
| `--forceRegenerate` |
|
|
111
|
-
| `--feedback`
|
|
112
|
-
| `--model`
|
|
85
|
+
| オプション | 説明 | 例 |
|
|
86
|
+
| :------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------- |
|
|
87
|
+
| `--forceRegenerate` | 既存のドキュメントをすべて削除し、最初から再生成します。ソースコードや設定に大幅な変更を加えた後に使用してください。 | `aigne doc generate --forceRegenerate` |
|
|
88
|
+
| `--feedback` | セクションの追加、削除、再編成など、ドキュメント全体の構造を洗練させるための大まかなフィードバックを提供します。 | `aigne doc generate --feedback "APIリファレンスを追加"` |
|
|
89
|
+
| `--model` | コンテンツ生成に使用するAIGNE Hubの特定の大規模言語モデルを指定し、異なるモデルを切り替えることができます。 | `aigne doc generate --model openai:gpt-4o` |
|
|
113
90
|
|
|
114
91
|
## 次のステップ
|
|
115
92
|
|
|
116
|
-
|
|
93
|
+
最初のドキュメントを生成した後も、プロジェクトは進化し続けます。ドキュメントをコードと同期させるためには、更新を行う必要があります。次のセクションでは、新しい要件やコードの変更に基づいて、対象を絞った変更を行い、特定のファイルを再生成する方法について説明します。
|
|
117
94
|
|
|
118
|
-
<x-card data-title="更新と改良" data-icon="lucide:file-edit" data-href="/features/update-and-refine">
|
|
119
|
-
コードが変更されたときにドキュメントを更新する方法や、フィードバックを使用して特定の改善を行う方法を学びます。
|
|
120
|
-
</x-card>
|
|
95
|
+
<x-card data-title="更新と改良" data-icon="lucide:file-edit" data-href="/features/update-and-refine">コードが変更された際のドキュメントの更新方法や、フィードバックを用いた特定の改善方法について学びます。</x-card>
|
|
@@ -14,24 +14,24 @@ aigne doc generate
|
|
|
14
14
|
|
|
15
15
|
If you are running this command for the first time in a project, DocSmith will detect that no configuration exists. It will then automatically launch an interactive setup wizard to guide you through the required setup steps. This process ensures a valid configuration is in place before generation begins.
|
|
16
16
|
|
|
17
|
-

|
|
18
18
|
|
|
19
19
|
You will be prompted to answer a series of questions to define key aspects of your documentation, including:
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
* Document generation rules and style
|
|
22
|
+
* The target audience
|
|
23
|
+
* Primary language and any additional translation languages
|
|
24
|
+
* Source code input and documentation output paths
|
|
25
25
|
|
|
26
|
-

|
|
27
27
|
|
|
28
28
|
After the configuration is complete, DocSmith proceeds with the documentation generation.
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
32
|
Upon successful completion, the newly created documentation will be available in the output directory specified during setup.
|
|
33
33
|
|
|
34
|
-

|
|
35
35
|
|
|
36
36
|
## The Generation Process
|
|
37
37
|
|
|
@@ -46,75 +46,50 @@ User: {
|
|
|
46
46
|
|
|
47
47
|
AIGNE-CLI: {
|
|
48
48
|
label: "AIGNE CLI"
|
|
49
|
-
}
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
50
|
+
config-check: {
|
|
51
|
+
label: "Config file exists?"
|
|
52
|
+
shape: diamond
|
|
53
|
+
}
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
55
|
+
interactive-setup: {
|
|
56
|
+
label: "Interactive Setup Wizard"
|
|
57
|
+
}
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
grid-columns: 1
|
|
59
|
+
generation-process: {
|
|
60
|
+
label: "3. Generation Process"
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
62
|
+
analyze-code: "Analyze Code"
|
|
63
|
+
plan-structure: "Plan Structure"
|
|
64
|
+
generate-content: "Generate Content"
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
shape: cylinder
|
|
72
|
-
}
|
|
66
|
+
analyze-code -> plan-structure -> generate-content
|
|
67
|
+
}
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
output: {
|
|
70
|
+
label: "Output Directory"
|
|
71
|
+
}
|
|
77
72
|
}
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
User -> AIGNE-CLI: "1. aigne doc generate"
|
|
85
|
-
AIGNE-CLI -> Config-Check: "2. Check for config"
|
|
86
|
-
|
|
87
|
-
Config-Check -> Setup-Wizard: "3a. No"
|
|
88
|
-
Setup-Wizard -> User: "Prompt for input"
|
|
89
|
-
User -> Setup-Wizard: "Provide answers"
|
|
90
|
-
Setup-Wizard -> Config-File: "Creates"
|
|
91
|
-
Config-File -> Generation-Process: "Uses"
|
|
92
|
-
Setup-Wizard -> Generation-Process: "4. Proceed"
|
|
93
|
-
|
|
94
|
-
Config-Check -> Generation-Process: "3b. Yes"
|
|
95
|
-
|
|
96
|
-
Source-Code -> Generation-Process.Analyze: "Input"
|
|
97
|
-
Generation-Process.Analyze -> Generation-Process.Plan
|
|
98
|
-
Generation-Process.Plan -> Generation-Process.Generate
|
|
99
|
-
Generation-Process.Generate -> Output-Directory: "5. Write documentation"
|
|
100
|
-
|
|
101
|
-
Output-Directory -> User: "6. Review documentation"
|
|
74
|
+
User -> AIGNE-CLI.config-check: "'aigne doc generate'"
|
|
75
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.interactive-setup: "[No] 2. Launch setup"
|
|
76
|
+
AIGNE-CLI.interactive-setup -> AIGNE-CLI.generation-process: "Create config file"
|
|
77
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.generation-process: "[Yes]"
|
|
78
|
+
AIGNE-CLI.generation-process -> AIGNE-CLI.output: "4. Write documentation"
|
|
102
79
|
```
|
|
103
80
|
|
|
104
81
|
## Command Options
|
|
105
82
|
|
|
106
83
|
The default `generate` command is sufficient for most use cases. However, several options are available to modify its behavior, which can be useful for forcing a full regeneration or refining the documentation structure.
|
|
107
84
|
|
|
108
|
-
| Option | Description
|
|
109
|
-
|
|
110
|
-
| `--forceRegenerate` | Deletes all existing documents and regenerates them from scratch. Use this after making significant changes to your source code or configuration. | `aigne doc generate --forceRegenerate`
|
|
111
|
-
| `--feedback` | Provides high-level feedback to refine the overall documentation structure, such as adding, removing, or reorganizing sections.
|
|
112
|
-
| `--model` | Specifies a particular Large Language Model from AIGNE Hub to use for content generation
|
|
85
|
+
| Option | Description | Example |
|
|
86
|
+
| :------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------- |
|
|
87
|
+
| `--forceRegenerate` | Deletes all existing documents and regenerates them from scratch. Use this after making significant changes to your source code or configuration. | `aigne doc generate --forceRegenerate` |
|
|
88
|
+
| `--feedback` | Provides high-level feedback to refine the overall documentation structure, such as adding, removing, or reorganizing sections. | `aigne doc generate --feedback "Add an API Reference"` |
|
|
89
|
+
| `--model` | Specifies a particular Large Language Model from AIGNE Hub to use for content generation, allowing you to switch between different models. | `aigne doc generate --model openai:gpt-4o` |
|
|
113
90
|
|
|
114
91
|
## What's Next?
|
|
115
92
|
|
|
116
93
|
After generating the initial documentation, your project will continue to evolve. To keep your documents synchronized with your code, you will need to perform updates. The next section explains how to make targeted changes and regenerate specific files based on new requirements or code modifications.
|
|
117
94
|
|
|
118
|
-
<x-card data-title="Update and Refine" data-icon="lucide:file-edit" data-href="/features/update-and-refine">
|
|
119
|
-
Learn how to update documents when your code changes or make specific improvements using feedback.
|
|
120
|
-
</x-card>
|
|
95
|
+
<x-card data-title="Update and Refine" data-icon="lucide:file-edit" data-href="/features/update-and-refine">Learn how to update documents when your code changes or make specific improvements using feedback.</x-card>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 產生文件
|
|
2
2
|
|
|
3
|
-
`aigne doc generate`
|
|
3
|
+
`aigne doc generate` 指令是從原始程式碼建立完整文件集的主要功能。此指令會啟動一個流程,分析您的程式碼庫、規劃邏輯性的文件結構,然後為每個部分產生內容。這是從初始狀態建立文件的標準方法。
|
|
4
4
|
|
|
5
5
|
## 首次產生
|
|
6
6
|
|
|
@@ -12,26 +12,26 @@ aigne doc generate
|
|
|
12
12
|
|
|
13
13
|
### 自動設定
|
|
14
14
|
|
|
15
|
-
如果您是首次在專案中執行此指令,DocSmith
|
|
15
|
+
如果您是首次在專案中執行此指令,DocSmith 將偵測到沒有任何設定存在。然後,它會自動啟動一個互動式設定精靈,引導您完成所需的設定步驟。此過程可確保在開始產生文件之前,有一個有效的設定。
|
|
16
16
|
|
|
17
|
-

|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
系統會提示您回答一系列問題,以定義文件的關鍵面向,包括:
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
* 文件產生規則與風格
|
|
22
|
+
* 目標受眾
|
|
23
|
+
* 主要語言及任何其他翻譯語言
|
|
24
|
+
* 原始程式碼輸入與文件輸出路徑
|
|
25
25
|
|
|
26
|
-

|
|
27
27
|
|
|
28
28
|
設定完成後,DocSmith 會繼續進行文件產生。
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
成功完成後,新建立的文件將可在設定時指定的輸出目錄中找到。
|
|
33
33
|
|
|
34
|
-

|
|
35
35
|
|
|
36
36
|
## 產生流程
|
|
37
37
|
|
|
@@ -46,75 +46,50 @@ User: {
|
|
|
46
46
|
|
|
47
47
|
AIGNE-CLI: {
|
|
48
48
|
label: "AIGNE CLI"
|
|
49
|
-
}
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
50
|
+
config-check: {
|
|
51
|
+
label: "設定檔是否存在?"
|
|
52
|
+
shape: diamond
|
|
53
|
+
}
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
55
|
+
interactive-setup: {
|
|
56
|
+
label: "互動式設定精靈"
|
|
57
|
+
}
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
grid-columns: 1
|
|
59
|
+
generation-process: {
|
|
60
|
+
label: "3. 產生流程"
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
62
|
+
analyze-code: "分析程式碼"
|
|
63
|
+
plan-structure: "規劃結構"
|
|
64
|
+
generate-content: "產生內容"
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
shape: cylinder
|
|
72
|
-
}
|
|
66
|
+
analyze-code -> plan-structure -> generate-content
|
|
67
|
+
}
|
|
73
68
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
output: {
|
|
70
|
+
label: "輸出目錄"
|
|
71
|
+
}
|
|
77
72
|
}
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
User -> AIGNE-CLI: "1. aigne doc generate"
|
|
85
|
-
AIGNE-CLI -> Config-Check: "2. 檢查設定檔"
|
|
86
|
-
|
|
87
|
-
Config-Check -> Setup-Wizard: "3a. 否"
|
|
88
|
-
Setup-Wizard -> User: "提示輸入"
|
|
89
|
-
User -> Setup-Wizard: "提供答案"
|
|
90
|
-
Setup-Wizard -> Config-File: "建立"
|
|
91
|
-
Config-File -> Generation-Process: "使用"
|
|
92
|
-
Setup-Wizard -> Generation-Process: "4. 繼續"
|
|
93
|
-
|
|
94
|
-
Config-Check -> Generation-Process: "3b. 是"
|
|
95
|
-
|
|
96
|
-
Source-Code -> Generation-Process.Analyze: "輸入"
|
|
97
|
-
Generation-Process.Analyze -> Generation-Process.Plan
|
|
98
|
-
Generation-Process.Plan -> Generation-Process.Generate
|
|
99
|
-
Generation-Process.Generate -> Output-Directory: "5. 寫入文件"
|
|
100
|
-
|
|
101
|
-
Output-Directory -> User: "6. 檢閱文件"
|
|
74
|
+
User -> AIGNE-CLI.config-check: "'aigne doc generate'"
|
|
75
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.interactive-setup: "[否] 2. 啟動設定"
|
|
76
|
+
AIGNE-CLI.interactive-setup -> AIGNE-CLI.generation-process: "建立設定檔"
|
|
77
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.generation-process: "[是]"
|
|
78
|
+
AIGNE-CLI.generation-process -> AIGNE-CLI.output: "4. 寫入文件"
|
|
102
79
|
```
|
|
103
80
|
|
|
104
81
|
## 指令選項
|
|
105
82
|
|
|
106
|
-
預設的 `generate`
|
|
83
|
+
預設的 `generate` 指令足以應付大多數使用情境。然而,有幾個選項可用於修改其行為,這對於強制完整重新產生或完善文件結構非常有用。
|
|
107
84
|
|
|
108
|
-
| 選項
|
|
109
|
-
|
|
110
|
-
| `--forceRegenerate` |
|
|
111
|
-
| `--feedback`
|
|
112
|
-
| `--model`
|
|
85
|
+
| 選項 | 描述 | 範例 |
|
|
86
|
+
| :------------------ | :----------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------- |
|
|
87
|
+
| `--forceRegenerate` | 刪除所有現有文件並從頭開始重新產生。在對原始程式碼或設定進行重大變更後使用此選項。 | `aigne doc generate --forceRegenerate` |
|
|
88
|
+
| `--feedback` | 提供高層次的回饋以完善整體文件結構,例如新增、移除或重組章節。 | `aigne doc generate --feedback "Add an API Reference"` |
|
|
89
|
+
| `--model` | 指定從 AIGNE Hub 使用特定的大型語言模型來產生內容,讓您可以在不同模型之間切換。 | `aigne doc generate --model openai:gpt-4o` |
|
|
113
90
|
|
|
114
91
|
## 下一步是什麼?
|
|
115
92
|
|
|
116
|
-
|
|
93
|
+
產生初始文件後,您的專案將會持續演進。為了讓您的文件與程式碼保持同步,您需要執行更新。下一節將說明如何根據新的需求或程式碼修改進行針對性變更並重新產生特定檔案。
|
|
117
94
|
|
|
118
|
-
<x-card data-title="
|
|
119
|
-
了解當您的程式碼變更時如何更新文件,或使用回饋進行特定改進。
|
|
120
|
-
</x-card>
|
|
95
|
+
<x-card data-title="更新與完善" data-icon="lucide:file-edit" data-href="/features/update-and-refine">學習如何在程式碼變更時更新文件,或使用回饋進行特定改進。</x-card>
|
|
@@ -12,110 +12,84 @@ aigne doc generate
|
|
|
12
12
|
|
|
13
13
|
### 自动配置
|
|
14
14
|
|
|
15
|
-
如果您是首次在项目中运行此命令,DocSmith
|
|
15
|
+
如果您是首次在项目中运行此命令,DocSmith 将检测到尚不存在任何配置。随后,它将自动启动一个交互式设置向导,引导您完成所需的设置步骤。此过程可确保在生成开始前已准备好有效的配置。
|
|
16
16
|
|
|
17
|
-

|
|
18
18
|
|
|
19
19
|
系统将提示您回答一系列问题,以定义文档的关键方面,包括:
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
* 文档生成规则和风格
|
|
22
|
+
* 目标受众
|
|
23
|
+
* 主要语言及任何其他翻译语言
|
|
24
|
+
* 源代码输入和文档输出路径
|
|
25
25
|
|
|
26
|
-

|
|
27
27
|
|
|
28
|
-
配置完成后,DocSmith
|
|
28
|
+
配置完成后,DocSmith 将继续进行文档生成。
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
32
|
成功完成后,新创建的文档将位于设置期间指定的输出目录中。
|
|
33
33
|
|
|
34
|
-

|
|
35
35
|
|
|
36
36
|
## 生成过程
|
|
37
37
|
|
|
38
|
-
`generate`
|
|
38
|
+
`generate` 命令执行一个自动化的多步骤工作流。该过程概述如下:
|
|
39
39
|
|
|
40
40
|
```d2
|
|
41
41
|
direction: down
|
|
42
42
|
|
|
43
43
|
User: {
|
|
44
44
|
shape: c4-person
|
|
45
|
-
label: "用户"
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
AIGNE-CLI: {
|
|
49
48
|
label: "AIGNE CLI"
|
|
50
|
-
}
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
50
|
+
config-check: {
|
|
51
|
+
label: "配置文件是否存在?"
|
|
52
|
+
shape: diamond
|
|
53
|
+
}
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
55
|
+
interactive-setup: {
|
|
56
|
+
label: "交互式设置向导"
|
|
57
|
+
}
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
grid-columns: 1
|
|
59
|
+
generation-process: {
|
|
60
|
+
label: "3. 生成过程"
|
|
64
61
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
62
|
+
analyze-code: "分析代码"
|
|
63
|
+
plan-structure: "规划结构"
|
|
64
|
+
generate-content: "生成内容"
|
|
69
65
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
shape: cylinder
|
|
73
|
-
}
|
|
66
|
+
analyze-code -> plan-structure -> generate-content
|
|
67
|
+
}
|
|
74
68
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
output: {
|
|
70
|
+
label: "输出目录"
|
|
71
|
+
}
|
|
78
72
|
}
|
|
79
73
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
User -> AIGNE-CLI: "1. aigne doc generate"
|
|
86
|
-
AIGNE-CLI -> Config-Check: "2. 检查配置"
|
|
87
|
-
|
|
88
|
-
Config-Check -> Setup-Wizard: "3a. 否"
|
|
89
|
-
Setup-Wizard -> User: "提示输入"
|
|
90
|
-
User -> Setup-Wizard: "提供回答"
|
|
91
|
-
Setup-Wizard -> Config-File: "创建"
|
|
92
|
-
Config-File -> Generation-Process: "使用"
|
|
93
|
-
Setup-Wizard -> Generation-Process: "4. 继续"
|
|
94
|
-
|
|
95
|
-
Config-Check -> Generation-Process: "3b. 是"
|
|
96
|
-
|
|
97
|
-
Source-Code -> Generation-Process.Analyze: "输入"
|
|
98
|
-
Generation-Process.Analyze -> Generation-Process.Plan
|
|
99
|
-
Generation-Process.Plan -> Generation-Process.Generate
|
|
100
|
-
Generation-Process.Generate -> Output-Directory: "5. 写入文档"
|
|
101
|
-
|
|
102
|
-
Output-Directory -> User: "6. 审阅文档"
|
|
74
|
+
User -> AIGNE-CLI.config-check: "'aigne doc generate'"
|
|
75
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.interactive-setup: "[否] 2. 启动设置"
|
|
76
|
+
AIGNE-CLI.interactive-setup -> AIGNE-CLI.generation-process: "创建配置文件"
|
|
77
|
+
AIGNE-CLI.config-check -> AIGNE-CLI.generation-process: "[是]"
|
|
78
|
+
AIGNE-CLI.generation-process -> AIGNE-CLI.output: "4. 编写文档"
|
|
103
79
|
```
|
|
104
80
|
|
|
105
81
|
## 命令选项
|
|
106
82
|
|
|
107
|
-
默认的 `generate`
|
|
83
|
+
默认的 `generate` 命令足以满足大多数使用场景。但是,有几个选项可用于修改其行为,这对于强制完全重新生成或优化文档结构非常有用。
|
|
108
84
|
|
|
109
|
-
| 选项 |
|
|
110
|
-
|
|
111
|
-
| `--forceRegenerate` | 删除所有现有文档并从头开始重新生成。在对源代码或配置进行重大更改后使用此选项。
|
|
112
|
-
| `--feedback` | 提供高层反馈以优化整体文档结构,例如添加、删除或重组部分。
|
|
113
|
-
| `--model` | 指定 AIGNE Hub
|
|
85
|
+
| 选项 | 描述 | 示例 |
|
|
86
|
+
| :------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------- |
|
|
87
|
+
| `--forceRegenerate` | 删除所有现有文档并从头开始重新生成。在对源代码或配置进行重大更改后使用此选项。 | `aigne doc generate --forceRegenerate` |
|
|
88
|
+
| `--feedback` | 提供高层反馈以优化整体文档结构,例如添加、删除或重组部分。 | `aigne doc generate --feedback "添加 API 参考"` |
|
|
89
|
+
| `--model` | 指定 AIGNE Hub 中的特定大型语言模型用于内容生成,允许您在不同模型之间切换。 | `aigne doc generate --model openai:gpt-4o` |
|
|
114
90
|
|
|
115
91
|
## 接下来做什么?
|
|
116
92
|
|
|
117
|
-
|
|
93
|
+
生成初始文档后,您的项目将继续发展。为了使您的文档与代码保持同步,您需要执行更新。下一节将解释如何根据新需求或代码修改进行有针对性的更改并重新生成特定文件。
|
|
118
94
|
|
|
119
|
-
<x-card data-title="更新和优化" data-icon="lucide:file-edit" data-href="/features/update-and-refine">
|
|
120
|
-
了解当代码更改时如何更新文档,或使用反馈进行特定改进。
|
|
121
|
-
</x-card>
|
|
95
|
+
<x-card data-title="更新和优化" data-icon="lucide:file-edit" data-href="/features/update-and-refine">了解如何在代码更改时更新文档,或使用反馈进行特定改进。</x-card>
|