@aigne/doc-smith 0.8.12-beta.6 → 0.8.12-beta.8
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 +1 -1
- package/.aigne/doc-smith/history.yaml +37 -0
- package/.aigne/doc-smith/media-description.yaml +91 -0
- package/.aigne/doc-smith/preferences.yml +12 -0
- package/.aigne/doc-smith/upload-cache.yaml +36 -69
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +24 -0
- package/agents/clear/choose-contents.mjs +14 -1
- package/agents/clear/clear-media-description.mjs +129 -0
- package/agents/clear/index.yaml +3 -1
- package/agents/evaluate/code-snippet.mjs +28 -24
- package/agents/evaluate/document-structure.yaml +0 -4
- package/agents/evaluate/document.yaml +1 -5
- package/agents/generate/index.yaml +1 -0
- package/agents/generate/update-document-structure.yaml +9 -3
- package/agents/history/view.mjs +5 -2
- package/agents/init/index.mjs +10 -0
- package/agents/media/batch-generate-media-description.yaml +44 -0
- package/agents/media/generate-media-description.yaml +47 -0
- package/agents/media/load-media-description.mjs +238 -0
- package/agents/update/generate-document.yaml +10 -4
- package/agents/update/index.yaml +1 -0
- package/agents/update/update-document-detail.yaml +9 -3
- package/agents/update/user-review-document.mjs +2 -1
- package/agents/utils/load-sources.mjs +103 -53
- package/aigne.yaml +6 -0
- package/assets/report-template/report.html +34 -34
- package/docs/configuration-initial-setup.md +74 -55
- package/docs/configuration.ja.md +59 -86
- package/docs/configuration.md +59 -86
- package/docs/configuration.zh-TW.md +59 -86
- package/docs/configuration.zh.md +59 -86
- package/docs/getting-started.ja.md +43 -24
- package/docs/getting-started.md +29 -10
- package/docs/getting-started.zh-TW.md +42 -23
- package/docs/getting-started.zh.md +39 -20
- package/docs/guides-cleaning-up.ja.md +16 -15
- package/docs/guides-cleaning-up.md +19 -17
- package/docs/guides-cleaning-up.zh-TW.md +16 -15
- package/docs/guides-cleaning-up.zh.md +12 -11
- package/docs/guides-evaluating-documents.md +70 -29
- package/docs/guides-generating-documentation.ja.md +34 -32
- package/docs/guides-generating-documentation.md +59 -119
- package/docs/guides-generating-documentation.zh-TW.md +34 -32
- package/docs/guides-generating-documentation.zh.md +30 -28
- package/docs/guides-interactive-chat.md +34 -26
- package/docs/guides-managing-history.ja.md +17 -20
- package/docs/guides-managing-history.md +19 -17
- package/docs/guides-managing-history.zh-TW.md +18 -21
- package/docs/guides-managing-history.zh.md +13 -16
- package/docs/guides-publishing-your-docs.md +40 -35
- package/docs/guides-translating-documentation.ja.md +17 -17
- package/docs/guides-translating-documentation.md +39 -34
- package/docs/guides-translating-documentation.zh-TW.md +21 -21
- package/docs/guides-translating-documentation.zh.md +18 -18
- package/docs/guides-updating-documentation.ja.md +35 -35
- package/docs/guides-updating-documentation.md +11 -9
- package/docs/guides-updating-documentation.zh-TW.md +27 -27
- package/docs/guides-updating-documentation.zh.md +26 -26
- package/docs/overview.ja.md +13 -13
- package/docs/overview.md +2 -2
- package/docs/overview.zh-TW.md +19 -19
- package/docs/overview.zh.md +16 -16
- package/docs/release-notes.md +60 -27
- package/package.json +2 -1
- package/prompts/common/afs/afs-tools-usage.md +5 -0
- package/prompts/common/afs/use-afs-instruction.md +1 -0
- package/prompts/detail/generate/system-prompt.md +0 -13
- package/prompts/detail/generate/user-prompt.md +7 -0
- package/prompts/detail/update/system-prompt.md +1 -2
- package/prompts/detail/update/user-prompt.md +7 -0
- package/prompts/evaluate/document-structure.md +6 -7
- package/prompts/evaluate/document.md +16 -25
- package/prompts/media/media-description/system-prompt.md +35 -0
- package/prompts/media/media-description/user-prompt.md +8 -0
- package/prompts/structure/generate/system-prompt.md +0 -19
- package/prompts/structure/generate/user-prompt.md +22 -1
- package/prompts/structure/update/system-prompt.md +0 -17
- package/prompts/structure/update/user-prompt.md +24 -0
- package/tests/agents/history/view.test.mjs +97 -0
- package/tests/utils/history-utils.test.mjs +125 -97
- package/utils/constants/index.mjs +0 -107
- package/utils/file-utils.mjs +42 -1
- package/utils/history-utils.mjs +3 -3
- package/agents/update/fs-tools/glob.mjs +0 -184
- package/agents/update/fs-tools/grep.mjs +0 -317
- package/agents/update/fs-tools/read-file.mjs +0 -309
- package/media.md +0 -19
- package/tests/agents/update/fs-tools/glob.test.mjs +0 -438
- package/tests/agents/update/fs-tools/grep.test.mjs +0 -279
- package/tests/agents/update/fs-tools/read-file.test.mjs +0 -549
|
@@ -1,66 +1,107 @@
|
|
|
1
1
|
# Evaluating Documents
|
|
2
2
|
|
|
3
|
-
The `evaluate` command provides a systematic
|
|
3
|
+
The `evaluate` command provides a systematic method to assess the quality and completeness of your generated documentation. It analyzes both the overall document structure and the content of individual files against the criteria defined during project setup. The process concludes by generating a detailed report, which helps identify areas for improvement and ensures the documentation aligns with its intended purpose and audience.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## The Evaluation Process
|
|
6
6
|
|
|
7
|
-
The evaluation
|
|
7
|
+
The evaluation command executes a two-stage analysis to provide a comprehensive assessment of your documentation.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
```d2
|
|
10
|
+
direction: down
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
start: {
|
|
13
|
+
label: "Run Command\naignite evaluate"
|
|
14
|
+
shape: oval
|
|
15
|
+
}
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
structure-eval: {
|
|
18
|
+
label: "Stage 1: Evaluate\nDocument Structure"
|
|
19
|
+
shape: rectangle
|
|
20
|
+
}
|
|
15
21
|
|
|
16
|
-
|
|
22
|
+
content-eval: {
|
|
23
|
+
label: "Stage 2: Evaluate\nDocument Content"
|
|
24
|
+
shape: rectangle
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
report-gen: {
|
|
28
|
+
label: "Generate Report"
|
|
29
|
+
shape: rectangle
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
output: {
|
|
33
|
+
label: "Output HTML &\nJSON Report Files"
|
|
34
|
+
shape: oval
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
start -> structure-eval: "Analyzes overall organization"
|
|
38
|
+
structure-eval -> content-eval: "Analyzes each file individually"
|
|
39
|
+
content-eval -> report-gen: "Aggregates all findings"
|
|
40
|
+
report-gen -> output: "Saves report to disk"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
1. **Structure Evaluation**: The tool first examines the documentation's high-level organization, analogous to a table of contents. It verifies whether the structure is logical and complete based on the specified documentation goals, target audience, and content depth.
|
|
44
|
+
2. **Content Evaluation**: Following the structural analysis, the tool inspects the content of each document. It scores each file against several quality dimensions, including readability, coherence, and factual accuracy. It also validates the correctness and formatting of included code snippets.
|
|
45
|
+
|
|
46
|
+
The findings from both stages are compiled into an HTML report that presents high-level scores and specific, actionable feedback.
|
|
47
|
+
|
|
48
|
+
## How to Run an Evaluation
|
|
49
|
+
|
|
50
|
+
To initiate the evaluation process, execute the `evaluate` command from your project's root directory.
|
|
51
|
+
|
|
52
|
+
### Execute the Command
|
|
53
|
+
|
|
54
|
+
Open your terminal and run the following command:
|
|
17
55
|
|
|
18
56
|
```bash
|
|
19
57
|
aignite evaluate
|
|
20
58
|
```
|
|
21
59
|
|
|
22
|
-
The
|
|
60
|
+
The tool will display its progress as it analyzes the documentation.
|
|
61
|
+
|
|
62
|
+
### Review the Output
|
|
63
|
+
|
|
64
|
+
Upon completion, a confirmation message will appear in the terminal, specifying the location of the generated report files.
|
|
23
65
|
|
|
24
66
|
```text
|
|
25
67
|
✔ Generate evaluation report
|
|
26
68
|
Evaluation report generated successfully.
|
|
27
|
-
- JSON Report: .aigc/evaluate/
|
|
28
|
-
- HTML Report: .aigc/evaluate/
|
|
69
|
+
- JSON Report: .aigc/evaluate/20240520114500/integrity-report.json
|
|
70
|
+
- HTML Report: .aigc/evaluate/20240520114500/report.html
|
|
29
71
|
```
|
|
30
72
|
|
|
31
|
-
|
|
73
|
+
Open the `report.html` file in a web browser to view the detailed analysis.
|
|
32
74
|
|
|
33
|
-
## Understanding the Report
|
|
75
|
+
## Understanding the Evaluation Report
|
|
34
76
|
|
|
35
|
-
The
|
|
77
|
+
The report is organized into sections that correspond to the stages of the evaluation process, providing a clear breakdown of the analysis.
|
|
36
78
|
|
|
37
|
-
### Structure Evaluation
|
|
79
|
+
### Structure Evaluation Details
|
|
38
80
|
|
|
39
|
-
This section
|
|
81
|
+
This section presents feedback on the overall architecture of your documentation. It measures how effectively the document hierarchy aligns with the project's configuration.
|
|
40
82
|
|
|
41
83
|
| Dimension | Description |
|
|
42
84
|
| :--- | :--- |
|
|
43
|
-
| **Purpose Coverage** | Assesses if the document structure
|
|
44
|
-
| **Audience Coverage** | Determines if the structure is
|
|
45
|
-
| **Depth Coverage** | Checks if the level of detail
|
|
85
|
+
| **Purpose Coverage** | Assesses if the document structure adequately supports the primary goals selected (e.g., "Get started quickly"). |
|
|
86
|
+
| **Audience Coverage** | Determines if the structure is organized in a way that is suitable for the defined target audience (e.g., "non-technical users"). |
|
|
87
|
+
| **Depth Coverage** | Checks if the level of detail implied by the structure matches the selected content depth (e.g., "covers all parameters"). |
|
|
46
88
|
|
|
47
|
-
### Document Content Evaluation
|
|
89
|
+
### Document Content Evaluation Details
|
|
48
90
|
|
|
49
|
-
This section provides a
|
|
91
|
+
This section provides a file-by-file breakdown of content quality. Each document is scored based on a set of standardized criteria.
|
|
50
92
|
|
|
51
93
|
| Dimension | Description |
|
|
52
94
|
| :--- | :--- |
|
|
53
|
-
| **Readability** | Measures
|
|
95
|
+
| **Readability** | Measures the ease with which the text can be read and understood. |
|
|
54
96
|
| **Coherence** | Evaluates the logical flow and organization of information within the document. |
|
|
55
97
|
| **Content Quality** | Assesses the accuracy, relevance, and clarity of the information presented. |
|
|
56
|
-
| **Consistency** | Checks for uniform terminology, formatting, and style
|
|
57
|
-
| **Purpose Alignment** | Determines how well the content
|
|
58
|
-
| **Audience Alignment** | Assesses if the language and examples are
|
|
59
|
-
| **Knowledge Level Alignment** | Checks if the content complexity matches the defined reader knowledge level. |
|
|
60
|
-
| **Navigability** | Evaluates the effectiveness of internal links and structural elements that help users find information. |
|
|
98
|
+
| **Consistency** | Checks for uniform terminology, formatting, and style throughout the document. |
|
|
99
|
+
| **Purpose Alignment** | Determines how well the content fulfills the specified documentation goals. |
|
|
100
|
+
| **Audience Alignment** | Assesses if the language, tone, and examples are appropriate for the target audience. |
|
|
101
|
+
| **Knowledge Level Alignment** | Checks if the content's complexity matches the defined reader knowledge level. |
|
|
61
102
|
|
|
62
103
|
## Summary
|
|
63
104
|
|
|
64
|
-
Using the `evaluate` command is
|
|
105
|
+
Using the `evaluate` command is an essential step for maintaining accurate and effective documentation. It provides objective metrics and specific feedback, enabling a methodical approach to refining your content. After reviewing the evaluation report, you can make targeted improvements to enhance documentation quality.
|
|
65
106
|
|
|
66
|
-
For
|
|
107
|
+
For guidance on modifying your documents based on this feedback, refer to the [Updating Documentation](./guides-updating-documentation.md) guide.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# ドキュメントの生成
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
このガイドでは、プロジェクトのソースファイルから完全なドキュメント一式を作成するための体系的な手順を説明します。このプロセスは `aigne doc generate` コマンドを使用して開始します。このコマンドはコードベースを分析し、論理的な構造を提案し、各ドキュメントのコンテンツを書き込みます。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
このコマンドは、ドキュメントを最初に作成するための主要なツールです。作成済みのドキュメントを修正する場合は、[ドキュメントの更新](./guides-updating-documentation.md)ガイドを参照してください。
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### 生成ワークフロー
|
|
8
8
|
|
|
9
|
-
`generate`
|
|
9
|
+
`generate` コマンドは、ドキュメントを構築するための一連の自動化されたステップを実行します。このプロセスは対話形式で設計されており、コンテンツが書き込まれる前に、提案された構造を確認・承認できます。
|
|
10
10
|
|
|
11
11
|
```d2
|
|
12
12
|
direction: down
|
|
@@ -22,12 +22,12 @@ run_command: {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
check_config: {
|
|
25
|
-
label: "
|
|
25
|
+
label: "設定ファイルは存在するか?"
|
|
26
26
|
shape: diamond
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
interactive_setup: {
|
|
30
|
-
label: "
|
|
30
|
+
label: "対話型セットアップをガイド"
|
|
31
31
|
shape: rectangle
|
|
32
32
|
tooltip: ".aigne/doc-smith/config.yaml が見つからない場合、対話型セットアップがトリガーされます。"
|
|
33
33
|
}
|
|
@@ -43,14 +43,14 @@ review_structure: {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
user_approve: {
|
|
46
|
-
label: "
|
|
46
|
+
label: "構造を承認するか?"
|
|
47
47
|
shape: diamond
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
provide_feedback: {
|
|
51
|
-
label: "
|
|
51
|
+
label: "構造を洗練させるためのフィードバックを提供"
|
|
52
52
|
shape: rectangle
|
|
53
|
-
tooltip: "
|
|
53
|
+
tooltip: "ユーザーはセクションの名前変更、追加、削除などの変更を要求できます。"
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
generate_content: {
|
|
@@ -88,61 +88,63 @@ generate_content -> end
|
|
|
88
88
|
|
|
89
89
|
ドキュメントを生成するには、ターミナルでプロジェクトのルートディレクトリに移動し、以下の手順に従ってください。
|
|
90
90
|
|
|
91
|
-
### 1.
|
|
91
|
+
### 1. 生成コマンドの実行
|
|
92
92
|
|
|
93
|
-
`generate`
|
|
93
|
+
`generate` コマンドを実行してプロセスを開始します。ツールはプロジェクトのファイルと構造の分析から始めます。
|
|
94
94
|
|
|
95
95
|
```bash 基本的な生成コマンド
|
|
96
96
|
aigne doc generate
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
簡潔にするために、エイリアスの `gen` や `g` を使用することもできます。
|
|
100
100
|
|
|
101
101
|
### 2. ドキュメント構造の確認
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
この計画を確認するよう求められます。
|
|
103
|
+
分析が完了すると、ツールは提案されたドキュメント構造を表示し、確認を求めます。
|
|
106
104
|
|
|
107
105
|
```
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
はい、構造を最適化します
|
|
106
|
+
ドキュメント構造を最適化しますか?
|
|
107
|
+
❯ いいえ、問題ありません
|
|
108
|
+
はい、構造を最適化します(例:「はじめに」を「クイックスタート」に名称変更、「APIリファレンス」を「設定」の前に移動するなど)
|
|
112
109
|
```
|
|
113
110
|
|
|
114
|
-
-
|
|
115
|
-
- **はい、構造を最適化します**:
|
|
111
|
+
- **いいえ、問題ありません**: このオプションを選択すると、提案された構造を承認し、直接コンテンツ生成に進みます。
|
|
112
|
+
- **はい、構造を最適化します**: このオプションを選択すると、プランを修正できます。ツールは対話ループでフィードバックを求めます。次のようなプレーンテキストで指示を与えることができます。
|
|
113
|
+
- `「トラブルシューティング」という新しいドキュメントを追加`
|
|
114
|
+
- `「レガシー機能」ドキュメントを削除`
|
|
115
|
+
- `「インストール」を構造の最上部に移動`
|
|
116
|
+
|
|
117
|
+
フィードバックのたびに、AIが構造を修正し、再度確認できます。フィードバックを入力せずにEnterキーを押すと、ループを終了して最終的な構造を承認します。
|
|
116
118
|
|
|
117
119
|
### 3. コンテンツの生成
|
|
118
120
|
|
|
119
|
-
ドキュメント構造が承認されると、DocSmith
|
|
121
|
+
ドキュメント構造が承認されると、DocSmithはプラン内の各ドキュメントの詳細なコンテンツの生成を開始します。このプロセスは自動的に実行され、所要時間はプロジェクトの規模と複雑さによって異なります。
|
|
120
122
|
|
|
121
123
|
完了すると、生成されたファイルは設定で指定された出力ディレクトリ(例:`./docs`)に保存されます。
|
|
122
124
|
|
|
123
|
-
##
|
|
125
|
+
## コマンドパラメータ
|
|
124
126
|
|
|
125
127
|
`generate` コマンドは、その動作を制御するためのいくつかのオプションパラメータを受け入れます。
|
|
126
128
|
|
|
127
|
-
| パラメータ
|
|
128
|
-
|
|
129
|
-
| `--forceRegenerate` |
|
|
130
|
-
| `--feedback`
|
|
131
|
-
| `--glossary`
|
|
129
|
+
| パラメータ | 説明 | 例 |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| `--forceRegenerate` | 既存の構造やコンテンツをすべて無視して、すべてのドキュメントを最初から再構築します。完全にリセットしたい場合に便利です。 | `aigne doc generate --forceRegenerate` |
|
|
132
|
+
| `--feedback` | 対話型の確認が始まる前に、構造生成フェーズでAIをガイドするための初期のテキストベースの指示を提供します。 | `aigne doc generate --feedback "Add more API examples"` |
|
|
133
|
+
| `--glossary` | 用語集ファイル(例:`glossary.md`)を指定して、ドキュメント全体で一貫した用語の使用を保証します。 | `aigne doc generate --glossary @/path/to/glossary.md` |
|
|
132
134
|
|
|
133
|
-
###
|
|
135
|
+
### 例:完全な再構築の強制
|
|
134
136
|
|
|
135
137
|
以前に生成されたすべてのドキュメントを破棄し、コードの現在の状態に基づいて新しいセットを作成したい場合は、`--forceRegenerate` フラグを使用します。
|
|
136
138
|
|
|
137
|
-
```bash
|
|
139
|
+
```bash 再構築の強制
|
|
138
140
|
aigne doc generate --forceRegenerate
|
|
139
141
|
```
|
|
140
142
|
|
|
141
143
|
## まとめ
|
|
142
144
|
|
|
143
|
-
`generate`
|
|
145
|
+
`generate` コマンドは、初期プロジェクトドキュメントを作成するプロセス全体を統括します。自動化されたコード分析と対話型の確認プロセスを組み合わせることで、構造化された関連性の高いドキュメント一式を生成します。
|
|
144
146
|
|
|
145
|
-
|
|
147
|
+
ドキュメントが生成されたら、次のような操作ができます。
|
|
146
148
|
|
|
147
149
|
- [ドキュメントの更新](./guides-updating-documentation.md): 特定のドキュメントに変更を加える。
|
|
148
150
|
- [ドキュメントの翻訳](./guides-translating-documentation.md): コンテンツを他の言語に翻訳する。
|
|
@@ -1,149 +1,89 @@
|
|
|
1
1
|
# Generating Documentation
|
|
2
2
|
|
|
3
|
-
This guide provides a
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
### The Generation Workflow
|
|
8
|
-
|
|
9
|
-
The `generate` command executes a sequence of automated steps to build your documentation. The process is designed to be interactive, allowing you to review and approve the proposed structure before content is written.
|
|
10
|
-
|
|
11
|
-
```d2
|
|
12
|
-
direction: down
|
|
13
|
-
|
|
14
|
-
start: {
|
|
15
|
-
label: "Start"
|
|
16
|
-
shape: oval
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
run_command: {
|
|
20
|
-
label: "Run 'aigne doc generate'"
|
|
21
|
-
shape: rectangle
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
check_config: {
|
|
25
|
-
label: "Configuration file exists?"
|
|
26
|
-
shape: diamond
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interactive_setup: {
|
|
30
|
-
label: "Guide through interactive setup"
|
|
31
|
-
shape: rectangle
|
|
32
|
-
tooltip: "If .aigne/doc-smith/config.yaml is not found, an interactive setup is triggered."
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
propose_structure: {
|
|
36
|
-
label: "Analyze project and propose document structure"
|
|
37
|
-
shape: rectangle
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
review_structure: {
|
|
41
|
-
label: "User reviews the proposed structure"
|
|
42
|
-
shape: rectangle
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
user_approve: {
|
|
46
|
-
label: "Approve structure?"
|
|
47
|
-
shape: diamond
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
provide_feedback: {
|
|
51
|
-
label: "Provide feedback to refine structure"
|
|
52
|
-
shape: rectangle
|
|
53
|
-
tooltip: "User can request changes like renaming, adding, or removing sections."
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
generate_content: {
|
|
57
|
-
label: "Generate content for all documents"
|
|
58
|
-
shape: rectangle
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
end: {
|
|
62
|
-
label: "End"
|
|
63
|
-
shape: oval
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
start -> run_command
|
|
67
|
-
run_command -> check_config
|
|
68
|
-
check_config -> interactive_setup: {
|
|
69
|
-
label: "No"
|
|
70
|
-
}
|
|
71
|
-
interactive_setup -> propose_structure
|
|
72
|
-
check_config -> propose_structure: {
|
|
73
|
-
label: "Yes"
|
|
74
|
-
}
|
|
75
|
-
propose_structure -> review_structure
|
|
76
|
-
review_structure -> user_approve
|
|
77
|
-
user_approve -> provide_feedback: {
|
|
78
|
-
label: "No"
|
|
79
|
-
}
|
|
80
|
-
provide_feedback -> review_structure
|
|
81
|
-
user_approve -> generate_content: {
|
|
82
|
-
label: "Yes"
|
|
83
|
-
}
|
|
84
|
-
generate_content -> end
|
|
85
|
-
```
|
|
3
|
+
This guide provides a step-by-step process for creating a new set of documentation for your project using the `generate` command. This is the primary command used to transform your source files into a structured set of documents from start to finish.
|
|
4
|
+
|
|
5
|
+
The generation process is designed to be systematic and interactive, ensuring the final output meets your project's specific needs.
|
|
86
6
|
|
|
87
|
-
##
|
|
7
|
+
## The Generation Process
|
|
88
8
|
|
|
89
|
-
|
|
9
|
+
When you run `aigne doc generate`, the tool follows a methodical process to create your documentation. Here is a breakdown of each step.
|
|
90
10
|
|
|
91
|
-
### 1
|
|
11
|
+
### Step 1: Initiate Generation
|
|
92
12
|
|
|
93
|
-
|
|
13
|
+
To begin, navigate to your project's root directory in your terminal and execute the core command.
|
|
94
14
|
|
|
95
|
-
```bash
|
|
15
|
+
```bash title="Terminal" icon=lucide:terminal
|
|
96
16
|
aigne doc generate
|
|
97
17
|
```
|
|
98
18
|
|
|
99
|
-
|
|
19
|
+
This single command initiates the entire documentation creation workflow. If it's your first time running the command, you will be guided through an interactive setup process.
|
|
100
20
|
|
|
101
|
-
|
|
21
|
+

|
|
102
22
|
|
|
103
|
-
|
|
23
|
+
### Step 2: Code Analysis and Structure Planning
|
|
104
24
|
|
|
105
|
-
|
|
25
|
+
First, DocSmith analyzes your source code to understand its structure, components, and relationships. Based on this analysis, it proposes an initial documentation structure. This plan organizes topics into a logical hierarchy, which may include sections like "Getting Started," "Guides," and "API Reference," tailored to your project's content.
|
|
106
26
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
27
|
+
### Step 3: Interactive Structure Review
|
|
28
|
+
|
|
29
|
+
After the initial structure is planned, you will be prompted to review it in the terminal. This is a critical step that allows you to refine the organization of your documents before the content is written.
|
|
30
|
+
|
|
31
|
+
You can either approve the structure as is or provide feedback in plain language to make changes.
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
Examples of feedback you can provide:
|
|
36
|
+
|
|
37
|
+
* Rename a section (e.g., change "Getting Started" to "Quick Start").
|
|
38
|
+
* Add a new document for "Troubleshooting."
|
|
39
|
+
* Remove a document that is not needed.
|
|
40
|
+
* Reorder sections to place "API Reference" before "Configuration."
|
|
113
41
|
|
|
114
|
-
|
|
115
|
-
- **Yes, optimize the structure**: Select this option if you wish to modify the plan. You will be able to provide feedback in plain text, such as "Rename 'API' to 'API Reference'" or "Add a new section for 'Deployment'." The AI will revise the structure based on your feedback, and you can review it again. This cycle can be repeated until the structure meets your requirements.
|
|
42
|
+
The tool will apply your feedback and present the updated structure for another review. You can repeat this process until the structure aligns perfectly with your requirements.
|
|
116
43
|
|
|
117
|
-
###
|
|
44
|
+
### Step 4: Content Creation
|
|
118
45
|
|
|
119
|
-
Once the
|
|
46
|
+
Once you approve the final structure, DocSmith proceeds to generate the detailed content for each document. It reads the relevant source files and writes clear explanations, code examples, and descriptions for every planned section. This process is executed for all documents in the approved plan.
|
|
120
47
|
|
|
121
|
-
|
|
48
|
+
### Step 5: Completion
|
|
122
49
|
|
|
123
|
-
|
|
50
|
+
When the process is complete, you will see a confirmation message indicating that the documentation has been generated successfully. The output files will be located in the directory specified in your configuration (the default is `./docs`).
|
|
124
51
|
|
|
125
|
-
|
|
52
|
+

|
|
126
53
|
|
|
127
|
-
|
|
128
|
-
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
|
129
|
-
| `--forceRegenerate` | Rebuilds all documentation from scratch, ignoring any existing structure or content. This is useful for starting over with a clean slate. | `aigne doc generate --forceRegenerate` |
|
|
130
|
-
| `--feedback` | Provides initial instructions to guide the AI during the structure generation phase. | `aigne doc generate --feedback "Add more API examples and a troubleshooting section"` |
|
|
131
|
-
| `--glossary` | Specifies a glossary file (`.md`) to ensure consistent use of terminology throughout the documentation. | `aigne doc generate --glossary @/path/to/glossary.md` |
|
|
54
|
+
## Command Options
|
|
132
55
|
|
|
133
|
-
|
|
56
|
+
You can modify the behavior of the `generate` command by using optional flags. These flags provide more control over the generation process.
|
|
134
57
|
|
|
135
|
-
|
|
58
|
+
| Option | Description |
|
|
59
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
60
|
+
| `--forceRegenerate` | Re-creates all documentation from scratch, ignoring any existing files. This is useful if you have made significant changes to your source code or want a completely fresh build. |
|
|
61
|
+
| `--glossary <path>` | Specifies a glossary file (e.g., `--glossary @glossary.md`). This ensures that technical terms are defined and used consistently across all generated documents. |
|
|
136
62
|
|
|
137
|
-
|
|
63
|
+
### Example Usage
|
|
64
|
+
|
|
65
|
+
Here are a few examples demonstrating how to use the command with its options.
|
|
66
|
+
|
|
67
|
+
**Standard Generation**
|
|
68
|
+
This is the most common use case for creating your initial set of documents.
|
|
69
|
+
```bash title="Terminal" icon=lucide:terminal
|
|
70
|
+
aigne doc generate
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Forced Regeneration**
|
|
74
|
+
Use this command when you need to discard all existing documents and rebuild them entirely.
|
|
75
|
+
```bash title="Terminal" icon=lucide:terminal
|
|
138
76
|
aigne doc generate --forceRegenerate
|
|
139
77
|
```
|
|
140
78
|
|
|
141
|
-
|
|
79
|
+
**Using a Glossary**
|
|
80
|
+
To ensure consistent terminology, provide a path to your glossary file.
|
|
81
|
+
```bash title="Terminal" icon=lucide:terminal
|
|
82
|
+
aigne doc generate --glossary @./glossary.md
|
|
83
|
+
```
|
|
142
84
|
|
|
143
|
-
|
|
85
|
+
## Summary
|
|
144
86
|
|
|
145
|
-
|
|
87
|
+
You have now learned the complete process for generating documentation from your project's source files. This workflow involves initiating the command, interactively reviewing the proposed structure, and allowing the tool to write the content.
|
|
146
88
|
|
|
147
|
-
|
|
148
|
-
- [Translate Documentation](./guides-translating-documentation.md): Translate your content into other languages.
|
|
149
|
-
- [Publishing Your Docs](./guides-publishing-your-docs.md): Make your documentation available online.
|
|
89
|
+
After generating your documents, your next steps might be to [update specific documents](./guides-updating-documentation.md) with new information or [publish your documentation](./guides-publishing-your-docs.md) to make it accessible to your audience.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# 產生文件
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
本指南提供了一套系統化程序,可從您的專案原始檔案建立一套完整的文件。此程序透過 `aigne doc generate` 指令啟動,該指令會分析您的程式碼庫、提出邏輯結構,然後為每份文件撰寫內容。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
此指令是初次建立文件的主要工具。若要在文件建立後進行修改,請參閱 [更新文件](./guides-updating-documentation.md) 指南。
|
|
6
6
|
|
|
7
7
|
### 產生工作流程
|
|
8
8
|
|
|
9
|
-
`generate`
|
|
9
|
+
`generate` 指令會執行一系列自動化步驟來建置您的文件。此程序設計為互動式,讓您能在內容撰寫前審閱並批准建議的結構。
|
|
10
10
|
|
|
11
11
|
```d2
|
|
12
12
|
direction: down
|
|
@@ -38,12 +38,12 @@ propose_structure: {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
review_structure: {
|
|
41
|
-
label: "
|
|
41
|
+
label: "使用者審閱建議的結構"
|
|
42
42
|
shape: rectangle
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
user_approve: {
|
|
46
|
-
label: "
|
|
46
|
+
label: "批准結構?"
|
|
47
47
|
shape: diamond
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -54,7 +54,7 @@ provide_feedback: {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
generate_content: {
|
|
57
|
-
label: "
|
|
57
|
+
label: "為所有文件生成內容"
|
|
58
58
|
shape: rectangle
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -86,53 +86,55 @@ generate_content -> end
|
|
|
86
86
|
|
|
87
87
|
## 逐步流程
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
若要產生您的文件,請在終端機中導覽至您專案的根目錄,並依照下列步驟操作。
|
|
90
90
|
|
|
91
|
-
### 1. 執行 Generate
|
|
91
|
+
### 1. 執行 Generate 指令
|
|
92
92
|
|
|
93
|
-
執行 `generate`
|
|
93
|
+
執行 `generate` 指令以開始此程序。工具將首先分析您專案的檔案與結構。
|
|
94
94
|
|
|
95
|
-
```bash
|
|
95
|
+
```bash 基本產生指令
|
|
96
96
|
aigne doc generate
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
為求簡潔,您也可以使用別名 `gen` 或 `g`。
|
|
100
100
|
|
|
101
|
-
### 2.
|
|
101
|
+
### 2. 審閱文件結構
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
系統會提示您審查此計畫:
|
|
103
|
+
分析完成後,工具將顯示建議的文件結構,並提示您進行審閱:
|
|
106
104
|
|
|
107
105
|
```
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
是,最佳化結構
|
|
106
|
+
Would you like to optimize the documentation structure?
|
|
107
|
+
❯ No, looks good
|
|
108
|
+
Yes, optimize the structure (e.g. rename 'Getting Started' to 'Quick Start', move 'API Reference' before 'Configuration')
|
|
112
109
|
```
|
|
113
110
|
|
|
114
|
-
-
|
|
115
|
-
-
|
|
111
|
+
- **不,看起來不錯**:選擇此選項可批准建議的結構,並直接進入內容產生階段。
|
|
112
|
+
- **是的,最佳化結構**:選擇此選項可修改計畫。工具接著會以互動式循環徵詢您的回饋。您可以用純文字提供指令,例如:
|
|
113
|
+
- `新增一份名為「疑難排解」的文件`
|
|
114
|
+
- `移除「舊版功能」文件`
|
|
115
|
+
- `將「安裝」移至結構頂部`
|
|
116
|
+
|
|
117
|
+
在每次回饋後,AI 將會修訂結構,您可以再次審閱。若要結束循環並批准最終結構,直接按下 Enter 鍵,不輸入任何回饋即可。
|
|
116
118
|
|
|
117
119
|
### 3. 內容產生
|
|
118
120
|
|
|
119
|
-
|
|
121
|
+
文件結構一經批准,DocSmith 將開始為計畫中的每份文件產生詳細內容。此過程會自動執行,其持續時間取決於您專案的規模與複雜度。
|
|
120
122
|
|
|
121
123
|
完成後,產生的檔案將儲存至您設定中指定的輸出目錄(例如 `./docs`)。
|
|
122
124
|
|
|
123
|
-
##
|
|
125
|
+
## 指令參數
|
|
124
126
|
|
|
125
|
-
`generate`
|
|
127
|
+
`generate` 指令接受數個選用參數以控制其行為。
|
|
126
128
|
|
|
127
129
|
| 參數 | 說明 | 範例 |
|
|
128
|
-
|
|
129
|
-
| `--forceRegenerate` |
|
|
130
|
-
| `--feedback` |
|
|
131
|
-
| `--glossary` |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| `--forceRegenerate` | 從頭開始重建所有文件,忽略任何現有的結構或內容。當您想要完全重置時,此選項非常有用。 | `aigne doc generate --forceRegenerate` |
|
|
132
|
+
| `--feedback` | 在互動式審閱開始前,提供初始的文字指令,以在結構產生階段指導 AI。 | `aigne doc generate --feedback "新增更多 API 範例"` |
|
|
133
|
+
| `--glossary` | 指定一個詞彙表檔案(例如 glossary.md),以確保在整個文件中術語使用的一致性。 | `aigne doc generate --glossary @/path/to/glossary.md` |
|
|
132
134
|
|
|
133
|
-
###
|
|
135
|
+
### 範例:強制完整重建
|
|
134
136
|
|
|
135
|
-
|
|
137
|
+
如果您想捨棄所有先前產生的文件,並根據您程式碼的當前狀態建立一套新的文件,請使用 `--forceRegenerate` 旗標。
|
|
136
138
|
|
|
137
139
|
```bash 強制重新產生
|
|
138
140
|
aigne doc generate --forceRegenerate
|
|
@@ -140,10 +142,10 @@ aigne doc generate --forceRegenerate
|
|
|
140
142
|
|
|
141
143
|
## 總結
|
|
142
144
|
|
|
143
|
-
`generate`
|
|
145
|
+
`generate` 指令統籌了建立您初始專案文件的整個過程。它結合了自動化程式碼分析與互動式審閱流程,以產出一套結構化且相關的文件。
|
|
144
146
|
|
|
145
147
|
文件產生後,您可能會想:
|
|
146
148
|
|
|
147
149
|
- [更新文件](./guides-updating-documentation.md):對特定文件進行變更。
|
|
148
150
|
- [翻譯文件](./guides-translating-documentation.md):將您的內容翻譯成其他語言。
|
|
149
|
-
- [
|
|
151
|
+
- [發布您的文件](./guides-publishing-your-docs.md):將您的文件發布上線。
|