@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.
Files changed (91) hide show
  1. package/.aigne/doc-smith/config.yaml +1 -1
  2. package/.aigne/doc-smith/history.yaml +37 -0
  3. package/.aigne/doc-smith/media-description.yaml +91 -0
  4. package/.aigne/doc-smith/preferences.yml +12 -0
  5. package/.aigne/doc-smith/upload-cache.yaml +36 -69
  6. package/.release-please-manifest.json +1 -1
  7. package/CHANGELOG.md +24 -0
  8. package/agents/clear/choose-contents.mjs +14 -1
  9. package/agents/clear/clear-media-description.mjs +129 -0
  10. package/agents/clear/index.yaml +3 -1
  11. package/agents/evaluate/code-snippet.mjs +28 -24
  12. package/agents/evaluate/document-structure.yaml +0 -4
  13. package/agents/evaluate/document.yaml +1 -5
  14. package/agents/generate/index.yaml +1 -0
  15. package/agents/generate/update-document-structure.yaml +9 -3
  16. package/agents/history/view.mjs +5 -2
  17. package/agents/init/index.mjs +10 -0
  18. package/agents/media/batch-generate-media-description.yaml +44 -0
  19. package/agents/media/generate-media-description.yaml +47 -0
  20. package/agents/media/load-media-description.mjs +238 -0
  21. package/agents/update/generate-document.yaml +10 -4
  22. package/agents/update/index.yaml +1 -0
  23. package/agents/update/update-document-detail.yaml +9 -3
  24. package/agents/update/user-review-document.mjs +2 -1
  25. package/agents/utils/load-sources.mjs +103 -53
  26. package/aigne.yaml +6 -0
  27. package/assets/report-template/report.html +34 -34
  28. package/docs/configuration-initial-setup.md +74 -55
  29. package/docs/configuration.ja.md +59 -86
  30. package/docs/configuration.md +59 -86
  31. package/docs/configuration.zh-TW.md +59 -86
  32. package/docs/configuration.zh.md +59 -86
  33. package/docs/getting-started.ja.md +43 -24
  34. package/docs/getting-started.md +29 -10
  35. package/docs/getting-started.zh-TW.md +42 -23
  36. package/docs/getting-started.zh.md +39 -20
  37. package/docs/guides-cleaning-up.ja.md +16 -15
  38. package/docs/guides-cleaning-up.md +19 -17
  39. package/docs/guides-cleaning-up.zh-TW.md +16 -15
  40. package/docs/guides-cleaning-up.zh.md +12 -11
  41. package/docs/guides-evaluating-documents.md +70 -29
  42. package/docs/guides-generating-documentation.ja.md +34 -32
  43. package/docs/guides-generating-documentation.md +59 -119
  44. package/docs/guides-generating-documentation.zh-TW.md +34 -32
  45. package/docs/guides-generating-documentation.zh.md +30 -28
  46. package/docs/guides-interactive-chat.md +34 -26
  47. package/docs/guides-managing-history.ja.md +17 -20
  48. package/docs/guides-managing-history.md +19 -17
  49. package/docs/guides-managing-history.zh-TW.md +18 -21
  50. package/docs/guides-managing-history.zh.md +13 -16
  51. package/docs/guides-publishing-your-docs.md +40 -35
  52. package/docs/guides-translating-documentation.ja.md +17 -17
  53. package/docs/guides-translating-documentation.md +39 -34
  54. package/docs/guides-translating-documentation.zh-TW.md +21 -21
  55. package/docs/guides-translating-documentation.zh.md +18 -18
  56. package/docs/guides-updating-documentation.ja.md +35 -35
  57. package/docs/guides-updating-documentation.md +11 -9
  58. package/docs/guides-updating-documentation.zh-TW.md +27 -27
  59. package/docs/guides-updating-documentation.zh.md +26 -26
  60. package/docs/overview.ja.md +13 -13
  61. package/docs/overview.md +2 -2
  62. package/docs/overview.zh-TW.md +19 -19
  63. package/docs/overview.zh.md +16 -16
  64. package/docs/release-notes.md +60 -27
  65. package/package.json +2 -1
  66. package/prompts/common/afs/afs-tools-usage.md +5 -0
  67. package/prompts/common/afs/use-afs-instruction.md +1 -0
  68. package/prompts/detail/generate/system-prompt.md +0 -13
  69. package/prompts/detail/generate/user-prompt.md +7 -0
  70. package/prompts/detail/update/system-prompt.md +1 -2
  71. package/prompts/detail/update/user-prompt.md +7 -0
  72. package/prompts/evaluate/document-structure.md +6 -7
  73. package/prompts/evaluate/document.md +16 -25
  74. package/prompts/media/media-description/system-prompt.md +35 -0
  75. package/prompts/media/media-description/user-prompt.md +8 -0
  76. package/prompts/structure/generate/system-prompt.md +0 -19
  77. package/prompts/structure/generate/user-prompt.md +22 -1
  78. package/prompts/structure/update/system-prompt.md +0 -17
  79. package/prompts/structure/update/user-prompt.md +24 -0
  80. package/tests/agents/history/view.test.mjs +97 -0
  81. package/tests/utils/history-utils.test.mjs +125 -97
  82. package/utils/constants/index.mjs +0 -107
  83. package/utils/file-utils.mjs +42 -1
  84. package/utils/history-utils.mjs +3 -3
  85. package/agents/update/fs-tools/glob.mjs +0 -184
  86. package/agents/update/fs-tools/grep.mjs +0 -317
  87. package/agents/update/fs-tools/read-file.mjs +0 -309
  88. package/media.md +0 -19
  89. package/tests/agents/update/fs-tools/glob.test.mjs +0 -438
  90. package/tests/agents/update/fs-tools/grep.test.mjs +0 -279
  91. 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 process to assess the quality and alignment of your generated documentation. It analyzes both the overall structure and the content of individual documents against the goals you defined during the initial setup. This process results in a detailed report, helping you identify areas for improvement and ensure the documentation effectively serves its intended purpose and audience.
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
- ## How It Works
5
+ ## The Evaluation Process
6
6
 
7
- The evaluation process operates in two primary stages. First, it assesses the high-level document structure, and second, it analyzes the content of each individual document.
7
+ The evaluation command executes a two-stage analysis to provide a comprehensive assessment of your documentation.
8
8
 
9
- 1. **Structure Evaluation**: The tool examines your documentation's overall organization (like a table of contents). It verifies whether the structure is logical and complete based on the documentation goals, target audience, and content depth you selected.
10
- 2. **Content Evaluation**: After analyzing the structure, the tool inspects each document's content. It scores the document against several quality dimensions, including readability, coherence, and accuracy. It also checks for the correct implementation of code examples.
9
+ ```d2
10
+ direction: down
11
11
 
12
- Upon completion, the tool compiles the findings into a user-friendly HTML report, providing both high-level scores and detailed, actionable feedback.
12
+ start: {
13
+ label: "Run Command\naignite evaluate"
14
+ shape: oval
15
+ }
13
16
 
14
- ## Running the Evaluation
17
+ structure-eval: {
18
+ label: "Stage 1: Evaluate\nDocument Structure"
19
+ shape: rectangle
20
+ }
15
21
 
16
- To initiate the evaluation process, execute the following command in your terminal:
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 command will display progress as it analyzes your documentation. Once finished, it will provide a message indicating the location of the generated report files.
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/20231027103000/integrity-report.json
28
- - HTML Report: .aigc/evaluate/20231027103000/report.html
69
+ - JSON Report: .aigc/evaluate/20240520114500/integrity-report.json
70
+ - HTML Report: .aigc/evaluate/20240520114500/report.html
29
71
  ```
30
72
 
31
- You can open the `report.html` file in your web browser to view the detailed analysis.
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 evaluation report is organized into two main sections, reflecting the two stages of the analysis process.
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 provides feedback on the overall architecture of your documentation. It measures how well the generated document hierarchy aligns with your specified configuration.
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 effectively supports the primary goals you selected (e.g., "Get started quickly"). |
44
- | **Audience Coverage** | Determines if the structure is appropriate for your defined target audience (e.g., "non-technical users"). |
45
- | **Depth Coverage** | Checks if the level of detail in the structure matches your selected content depth (e.g., "covers all parameters"). |
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 document-by-document breakdown of content quality. Each document is scored based on a set of standardized criteria.
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 how easy the text is to read and comprehend. |
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 across the document. |
57
- | **Purpose Alignment** | Determines how well the content meets the specified documentation goals. |
58
- | **Audience Alignment** | Assesses if the language and examples are suitable for the target audience. |
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 a crucial step in maintaining accurate and effective documentation. It provides concrete metrics and specific feedback, allowing you to refine your content methodically. After reviewing the evaluation report, you can proceed to make targeted improvements.
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 the next steps on modifying your documents based on this feedback, please see the guide on [Updating Documentation](./guides-updating-documentation.md).
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
- このガイドでは、プロジェクトのソースファイルからドキュメント一式を作成するための体系的な手順を説明します。このプロセスは `aigne doc generate` コマンドを使用して開始されます。このコマンドはコードベースを分析し、論理的な構造を提案し、各ドキュメントのコンテンツを作成します。
3
+ このガイドでは、プロジェクトのソースファイルから完全なドキュメント一式を作成するための体系的な手順を説明します。このプロセスは `aigne doc generate` コマンドを使用して開始します。このコマンドはコードベースを分析し、論理的な構造を提案し、各ドキュメントのコンテンツを書き込みます。
4
4
 
5
- このコマンドは、ドキュメントを最初に作成するための主要なツールです。作成後のドキュメントの修正については、[ドキュメントの更新](./guides-updating-documentation.md)ガイドを参照してください。
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. Generate コマンドの実行
91
+ ### 1. 生成コマンドの実行
92
92
 
93
- `generate` コマンドを実行してプロセスを開始します。ツールはプロジェクトのファイルと構造の分析から開始します。
93
+ `generate` コマンドを実行してプロセスを開始します。ツールはプロジェクトのファイルと構造の分析から始めます。
94
94
 
95
95
  ```bash 基本的な生成コマンド
96
96
  aigne doc generate
97
97
  ```
98
98
 
99
- 簡潔にするために、エイリアス `gen` または `g` を使用することもできます。
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
- - **はい、構造を最適化します**: このオプションは、計画を修正したい場合に選択します。プレーンテキストで、「'API' を 'API リファレンス' に変更」や「'デプロイ' のための新しいセクションを追加」などのフィードバックを提供できます。AI はあなたのフィードバックに基づいて構造を修正し、再度確認することができます。このサイクルは、構造があなたの要件を満たすまで繰り返すことができます。
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` | 既存の構造やコンテンツをすべて無視して、すべてのドキュメントをゼロから再構築します。これは、白紙の状態からやり直す場合に便利です。 | `aigne doc generate --forceRegenerate` |
130
- | `--feedback` | 構造生成フェーズで AI をガイドするための初期指示を提供します。 | `aigne doc generate --feedback "API の例を増やし、トラブルシューティングのセクションを追加してください"` |
131
- | `--glossary` | ドキュメント全体で一貫した用語の使用を保証するために、用語集ファイル(`.md`)を指定します。 | `aigne doc generate --glossary @/path/to/glossary.md` |
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 systematic procedure for creating a complete set of documentation from your project's source files. The process is initiated using the `aigne doc generate` command, which analyzes your codebase, proposes a logical structure, and then writes the content for each document.
4
-
5
- This command is the primary tool for the initial creation of your documentation. For modifying documents after they have been created, refer to the [Updating Documentation](./guides-updating-documentation.md) guide.
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
- ## Step-by-Step Process
7
+ ## The Generation Process
88
8
 
89
- To generate your documentation, navigate to the root directory of your project in your terminal and follow these steps.
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. Run the Generate Command
11
+ ### Step 1: Initiate Generation
92
12
 
93
- Execute the `generate` command to begin the process. The tool will start by analyzing your project's files and structure.
13
+ To begin, navigate to your project's root directory in your terminal and execute the core command.
94
14
 
95
- ```bash Basic Generation Command
15
+ ```bash title="Terminal" icon=lucide:terminal
96
16
  aigne doc generate
97
17
  ```
98
18
 
99
- You can also use the aliases `gen` or `g` for brevity.
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
- ### 2. Review the Documentation Structure
21
+ ![Generate Documentation Dialog](https://docsmith.aigne.io/image-bin/uploads/d409b85c2c7760778c18251e06d997d9.png)
102
22
 
103
- After the analysis is complete, the tool will present a proposed documentation structure. This structure is a hierarchical plan of the documents that will be created.
23
+ ### Step 2: Code Analysis and Structure Planning
104
24
 
105
- You will be prompted to review this plan:
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
- Would you like to optimize the documentation structure?
109
- You can edit titles, reorganize sections.
110
- ❯ Looks good - proceed with current structure
111
- Yes, optimize the structure
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
+ ![Reviewing the Documentation Structure](https://docsmith.aigne.io/image-bin/uploads/c530510525d8041c304d9c0258169904.png)
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
- - **Looks good - proceed with current structure**: Select this option to approve the proposed structure and proceed directly to content generation.
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
- ### 3. Content Generation
44
+ ### Step 4: Content Creation
118
45
 
119
- Once the documentation structure is approved, DocSmith will begin generating the detailed content for each document in the plan. This process runs automatically, and its duration depends on the size and complexity of your project.
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
- Upon completion, the generated files will be saved to the output directory specified in your configuration (e.g., `./docs`).
48
+ ### Step 5: Completion
122
49
 
123
- ## Command Parameters
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
- The `generate` command accepts several optional parameters to control its behavior.
52
+ ![Documentation Generated Successfully](https://docsmith.aigne.io/image-bin/uploads/19c72054cd662d51259e8f668571891e.png)
126
53
 
127
- | Parameter | Description | Example |
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
- ### Example: Forcing a Complete Rebuild
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
- If you want to discard all previously generated documents and create a new set based on the current state of your code, use the `--forceRegenerate` flag.
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
- ```bash Forcing Regeneration
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
- ## Summary
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
- The `generate` command orchestrates the entire process of creating your initial project documentation. It combines automated code analysis with an interactive review process to produce a structured and relevant set of documents.
85
+ ## Summary
144
86
 
145
- After your documents are generated, you may want to:
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
- - [Update Documentation](./guides-updating-documentation.md): Make changes to specific documents.
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
- 本指南提供了一套系統化程序,說明如何從專案的原始檔案建立完整文件。此流程使用 `aigne doc generate` 命令啟動,該命令會分析您的程式碼庫、提出邏輯結構,然後為每份文件撰寫內容。
3
+ 本指南提供了一套系統化程序,可從您的專案原始檔案建立一套完整的文件。此程序透過 `aigne doc generate` 指令啟動,該指令會分析您的程式碼庫、提出邏輯結構,然後為每份文件撰寫內容。
4
4
 
5
- 此命令是初次建立您文件的主要工具。若要在文件建立後進行修改,請參閱 [更新文件](./guides-updating-documentation.md) 指南。
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
- 您也可以使用別名 `gen` 或 `g` 以求簡潔。
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
- - **是,最佳化結構**:如果您希望修改計畫,請選擇此選項。您將能夠以純文字形式提供回饋,例如「將『API』重新命名為『API 參考』」或「新增一個『部署』的章節」。AI 將根據您的回饋修訂結構,您可以再次審查。此循環可以重複進行,直到結構符合您的要求。
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
- `generate` 命令接受數個可選參數來控制其行為。
127
+ `generate` 指令接受數個選用參數以控制其行為。
126
128
 
127
129
  | 參數 | 說明 | 範例 |
128
- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
129
- | `--forceRegenerate` | 從頭開始重建所有文件,忽略任何現有的結構或內容。這在您想從頭開始時很有用。 | `aigne doc generate --forceRegenerate` |
130
- | `--feedback` | 提供初始指令,以在結構產生階段指導 AI。 | `aigne doc generate --feedback "新增更多 API 範例和疑難排解章節"` |
131
- | `--glossary` | 指定一個詞彙表檔案(`.md`),以確保在整個文件中術語使用的一致性。 | `aigne doc generate --glossary @/path/to/glossary.md` |
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
- 如果您想捨棄所有先前產生的文件,並根據您程式碼的目前狀態建立一套新的文件,請使用 `--forceRegenerate` 旗標。
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
- - [發佈您的文件](./guides-publishing-your-docs.md):將您的文件發佈到網路上。
151
+ - [發布您的文件](./guides-publishing-your-docs.md):將您的文件發布上線。