@aigne/doc-smith 0.8.12-beta.3 → 0.8.12-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/.aigne/doc-smith/config.yaml +9 -6
  2. package/.aigne/doc-smith/output/structure-plan.json +123 -109
  3. package/.aigne/doc-smith/upload-cache.yaml +48 -0
  4. package/.github/workflows/publish-docs.yml +4 -7
  5. package/.release-please-manifest.json +1 -1
  6. package/CHANGELOG.md +13 -0
  7. package/agents/clear/choose-contents.mjs +22 -5
  8. package/agents/clear/clear-auth-tokens.mjs +2 -4
  9. package/agents/clear/clear-deployment-config.mjs +49 -0
  10. package/agents/clear/clear-document-config.mjs +2 -5
  11. package/agents/clear/clear-document-structure.mjs +2 -6
  12. package/agents/clear/clear-generated-docs.mjs +0 -1
  13. package/agents/generate/check-need-generate-structure.mjs +15 -60
  14. package/agents/generate/document-structure-tools/generate-sub-structure.mjs +131 -0
  15. package/agents/generate/generate-structure-without-tools.yaml +65 -0
  16. package/agents/generate/generate-structure.yaml +7 -1
  17. package/agents/generate/index.yaml +0 -3
  18. package/agents/generate/update-document-structure.yaml +3 -0
  19. package/agents/generate/user-review-document-structure.mjs +7 -5
  20. package/agents/init/index.mjs +15 -15
  21. package/agents/publish/publish-docs.mjs +130 -111
  22. package/agents/translate/index.yaml +1 -1
  23. package/agents/update/batch-generate-document.yaml +1 -1
  24. package/agents/update/batch-update-document.yaml +1 -1
  25. package/agents/update/check-document.mjs +3 -19
  26. package/agents/update/user-review-document.mjs +4 -3
  27. package/agents/utils/load-sources.mjs +54 -151
  28. package/agents/utils/transform-detail-datasources.mjs +14 -18
  29. package/aigne.yaml +2 -0
  30. package/biome.json +1 -1
  31. package/docs/_sidebar.md +13 -15
  32. package/docs/configuration-initial-setup.ja.md +179 -0
  33. package/docs/configuration-initial-setup.md +179 -0
  34. package/docs/configuration-initial-setup.zh-TW.md +179 -0
  35. package/docs/configuration-initial-setup.zh.md +179 -0
  36. package/docs/configuration-managing-preferences.ja.md +100 -0
  37. package/docs/configuration-managing-preferences.md +100 -0
  38. package/docs/configuration-managing-preferences.zh-TW.md +100 -0
  39. package/docs/configuration-managing-preferences.zh.md +100 -0
  40. package/docs/configuration.ja.md +68 -184
  41. package/docs/configuration.md +62 -178
  42. package/docs/configuration.zh-TW.md +70 -186
  43. package/docs/configuration.zh.md +67 -183
  44. package/docs/getting-started.ja.md +46 -78
  45. package/docs/getting-started.md +46 -78
  46. package/docs/getting-started.zh-TW.md +47 -79
  47. package/docs/getting-started.zh.md +47 -79
  48. package/docs/guides-cleaning-up.ja.md +50 -0
  49. package/docs/guides-cleaning-up.md +50 -0
  50. package/docs/guides-cleaning-up.zh-TW.md +50 -0
  51. package/docs/guides-cleaning-up.zh.md +50 -0
  52. package/docs/guides-evaluating-documents.ja.md +66 -0
  53. package/docs/guides-evaluating-documents.md +66 -0
  54. package/docs/guides-evaluating-documents.zh-TW.md +66 -0
  55. package/docs/guides-evaluating-documents.zh.md +66 -0
  56. package/docs/guides-generating-documentation.ja.md +149 -0
  57. package/docs/guides-generating-documentation.md +149 -0
  58. package/docs/guides-generating-documentation.zh-TW.md +149 -0
  59. package/docs/guides-generating-documentation.zh.md +149 -0
  60. package/docs/guides-interactive-chat.ja.md +85 -0
  61. package/docs/guides-interactive-chat.md +85 -0
  62. package/docs/guides-interactive-chat.zh-TW.md +85 -0
  63. package/docs/guides-interactive-chat.zh.md +85 -0
  64. package/docs/guides-managing-history.ja.md +51 -0
  65. package/docs/guides-managing-history.md +51 -0
  66. package/docs/guides-managing-history.zh-TW.md +51 -0
  67. package/docs/guides-managing-history.zh.md +51 -0
  68. package/docs/guides-publishing-your-docs.ja.md +78 -0
  69. package/docs/guides-publishing-your-docs.md +78 -0
  70. package/docs/guides-publishing-your-docs.zh-TW.md +78 -0
  71. package/docs/guides-publishing-your-docs.zh.md +78 -0
  72. package/docs/guides-translating-documentation.ja.md +95 -0
  73. package/docs/guides-translating-documentation.md +95 -0
  74. package/docs/guides-translating-documentation.zh-TW.md +95 -0
  75. package/docs/guides-translating-documentation.zh.md +95 -0
  76. package/docs/guides-updating-documentation.ja.md +77 -0
  77. package/docs/guides-updating-documentation.md +77 -0
  78. package/docs/guides-updating-documentation.zh-TW.md +77 -0
  79. package/docs/guides-updating-documentation.zh.md +77 -0
  80. package/docs/guides.ja.md +32 -0
  81. package/docs/guides.md +32 -0
  82. package/docs/guides.zh-TW.md +32 -0
  83. package/docs/guides.zh.md +32 -0
  84. package/docs/overview.ja.md +39 -60
  85. package/docs/overview.md +39 -60
  86. package/docs/overview.zh-TW.md +39 -60
  87. package/docs/overview.zh.md +39 -60
  88. package/docs/release-notes.ja.md +255 -0
  89. package/docs/release-notes.md +255 -0
  90. package/docs/release-notes.zh-TW.md +255 -0
  91. package/docs/release-notes.zh.md +255 -0
  92. package/package.json +4 -2
  93. package/prompts/common/document/content-rules-core.md +1 -0
  94. package/prompts/common/document-structure/document-structure-rules.md +8 -9
  95. package/prompts/common/document-structure/output-constraints.md +1 -1
  96. package/prompts/structure/document-rules.md +8 -2
  97. package/prompts/structure/generate/system-prompt.md +27 -2
  98. package/prompts/structure/generate/user-prompt.md +18 -0
  99. package/prompts/structure/update/system-prompt.md +12 -0
  100. package/prompts/structure/update/user-prompt.md +3 -0
  101. package/tests/agents/clear/choose-contents.test.mjs +8 -4
  102. package/tests/agents/generate/check-need-generate-structure.test.mjs +53 -63
  103. package/tests/agents/generate/document-structure-tools/generate-sub-structure.test.mjs +277 -0
  104. package/tests/agents/init/init.test.mjs +18 -18
  105. package/tests/agents/publish/publish-docs.test.mjs +79 -0
  106. package/tests/agents/update/check-document.test.mjs +7 -67
  107. package/tests/agents/utils/load-sources.test.mjs +90 -90
  108. package/tests/agents/utils/transform-detail-datasources.test.mjs +153 -196
  109. package/tests/utils/file-utils.test.mjs +309 -1
  110. package/utils/auth-utils.mjs +9 -3
  111. package/utils/constants/index.mjs +3 -1
  112. package/utils/file-utils.mjs +315 -0
  113. package/utils/utils.mjs +89 -50
  114. package/docs/advanced-how-it-works.ja.md +0 -101
  115. package/docs/advanced-how-it-works.md +0 -101
  116. package/docs/advanced-how-it-works.zh-TW.md +0 -101
  117. package/docs/advanced-how-it-works.zh.md +0 -101
  118. package/docs/advanced-quality-assurance.ja.md +0 -92
  119. package/docs/advanced-quality-assurance.md +0 -92
  120. package/docs/advanced-quality-assurance.zh-TW.md +0 -92
  121. package/docs/advanced-quality-assurance.zh.md +0 -92
  122. package/docs/advanced.ja.md +0 -20
  123. package/docs/advanced.md +0 -20
  124. package/docs/advanced.zh-TW.md +0 -20
  125. package/docs/advanced.zh.md +0 -20
  126. package/docs/changelog.ja.md +0 -486
  127. package/docs/changelog.md +0 -486
  128. package/docs/changelog.zh-TW.md +0 -486
  129. package/docs/changelog.zh.md +0 -486
  130. package/docs/cli-reference.ja.md +0 -311
  131. package/docs/cli-reference.md +0 -311
  132. package/docs/cli-reference.zh-TW.md +0 -311
  133. package/docs/cli-reference.zh.md +0 -311
  134. package/docs/configuration-interactive-setup.ja.md +0 -138
  135. package/docs/configuration-interactive-setup.md +0 -138
  136. package/docs/configuration-interactive-setup.zh-TW.md +0 -138
  137. package/docs/configuration-interactive-setup.zh.md +0 -138
  138. package/docs/configuration-language-support.ja.md +0 -64
  139. package/docs/configuration-language-support.md +0 -64
  140. package/docs/configuration-language-support.zh-TW.md +0 -64
  141. package/docs/configuration-language-support.zh.md +0 -64
  142. package/docs/configuration-llm-setup.ja.md +0 -56
  143. package/docs/configuration-llm-setup.md +0 -56
  144. package/docs/configuration-llm-setup.zh-TW.md +0 -56
  145. package/docs/configuration-llm-setup.zh.md +0 -56
  146. package/docs/configuration-preferences.ja.md +0 -144
  147. package/docs/configuration-preferences.md +0 -144
  148. package/docs/configuration-preferences.zh-TW.md +0 -144
  149. package/docs/configuration-preferences.zh.md +0 -144
  150. package/docs/features-generate-documentation.ja.md +0 -95
  151. package/docs/features-generate-documentation.md +0 -95
  152. package/docs/features-generate-documentation.zh-TW.md +0 -95
  153. package/docs/features-generate-documentation.zh.md +0 -95
  154. package/docs/features-publish-your-docs.ja.md +0 -130
  155. package/docs/features-publish-your-docs.md +0 -130
  156. package/docs/features-publish-your-docs.zh-TW.md +0 -130
  157. package/docs/features-publish-your-docs.zh.md +0 -130
  158. package/docs/features-translate-documentation.ja.md +0 -90
  159. package/docs/features-translate-documentation.md +0 -90
  160. package/docs/features-translate-documentation.zh-TW.md +0 -90
  161. package/docs/features-translate-documentation.zh.md +0 -90
  162. package/docs/features-update-and-refine.ja.md +0 -142
  163. package/docs/features-update-and-refine.md +0 -142
  164. package/docs/features-update-and-refine.zh-TW.md +0 -143
  165. package/docs/features-update-and-refine.zh.md +0 -142
  166. package/docs/features.ja.md +0 -62
  167. package/docs/features.md +0 -62
  168. package/docs/features.zh-TW.md +0 -62
  169. package/docs/features.zh.md +0 -62
@@ -0,0 +1,149 @@
1
+ # ドキュメントの生成
2
+
3
+ このガイドでは、プロジェクトのソースファイルからドキュメント一式を作成するための体系的な手順を説明します。このプロセスは `aigne doc generate` コマンドを使用して開始されます。このコマンドはコードベースを分析し、論理的な構造を提案し、各ドキュメントのコンテンツを作成します。
4
+
5
+ このコマンドは、ドキュメントを最初に作成するための主要なツールです。作成後のドキュメントの修正については、[ドキュメントの更新](./guides-updating-documentation.md)ガイドを参照してください。
6
+
7
+ ### 生成のワークフロー
8
+
9
+ `generate` コマンドは、ドキュメントを構築するための一連の自動化されたステップを実行します。このプロセスは対話形式で設計されており、コンテンツが書き込まれる前に提案された構造を確認し、承認することができます。
10
+
11
+ ```d2
12
+ direction: down
13
+
14
+ start: {
15
+ label: "開始"
16
+ shape: oval
17
+ }
18
+
19
+ run_command: {
20
+ label: "'aigne doc generate' を実行"
21
+ shape: rectangle
22
+ }
23
+
24
+ check_config: {
25
+ label: "設定ファイルが存在するか?"
26
+ shape: diamond
27
+ }
28
+
29
+ interactive_setup: {
30
+ label: "対話型セットアップのガイド"
31
+ shape: rectangle
32
+ tooltip: ".aigne/doc-smith/config.yaml が見つからない場合、対話型セットアップがトリガーされます。"
33
+ }
34
+
35
+ propose_structure: {
36
+ label: "プロジェクトを分析し、ドキュメント構造を提案"
37
+ shape: rectangle
38
+ }
39
+
40
+ review_structure: {
41
+ label: "ユーザーが提案された構造を確認"
42
+ shape: rectangle
43
+ }
44
+
45
+ user_approve: {
46
+ label: "構造を承認しますか?"
47
+ shape: diamond
48
+ }
49
+
50
+ provide_feedback: {
51
+ label: "構造を改善するためのフィードバックを提供"
52
+ shape: rectangle
53
+ tooltip: "ユーザーは、セクションの名前の変更、追加、削除などの変更を要求できます。"
54
+ }
55
+
56
+ generate_content: {
57
+ label: "すべてのドキュメントのコンテンツを生成"
58
+ shape: rectangle
59
+ }
60
+
61
+ end: {
62
+ label: "終了"
63
+ shape: oval
64
+ }
65
+
66
+ start -> run_command
67
+ run_command -> check_config
68
+ check_config -> interactive_setup: {
69
+ label: "いいえ"
70
+ }
71
+ interactive_setup -> propose_structure
72
+ check_config -> propose_structure: {
73
+ label: "はい"
74
+ }
75
+ propose_structure -> review_structure
76
+ review_structure -> user_approve
77
+ user_approve -> provide_feedback: {
78
+ label: "いいえ"
79
+ }
80
+ provide_feedback -> review_structure
81
+ user_approve -> generate_content: {
82
+ label: "はい"
83
+ }
84
+ generate_content -> end
85
+ ```
86
+
87
+ ## ステップバイステップのプロセス
88
+
89
+ ドキュメントを生成するには、ターミナルでプロジェクトのルートディレクトリに移動し、以下の手順に従ってください。
90
+
91
+ ### 1. Generate コマンドの実行
92
+
93
+ `generate` コマンドを実行してプロセスを開始します。ツールはプロジェクトのファイルと構造の分析から開始します。
94
+
95
+ ```bash 基本的な生成コマンド
96
+ aigne doc generate
97
+ ```
98
+
99
+ 簡潔にするために、エイリアス `gen` または `g` を使用することもできます。
100
+
101
+ ### 2. ドキュメント構造の確認
102
+
103
+ 分析が完了すると、ツールは提案されたドキュメント構造を提示します。この構造は、作成されるドキュメントの階層的な計画です。
104
+
105
+ この計画を確認するよう求められます。
106
+
107
+ ```
108
+ ドキュメントの構造を最適化しますか?
109
+ タイトルを編集したり、セクションを再編成したりできます。
110
+ ❯ 問題ありません - 現在の構造で続行します
111
+ はい、構造を最適化します
112
+ ```
113
+
114
+ - **問題ありません - 現在の構造で続行します**: このオプションを選択すると、提案された構造を承認し、直接コンテンツ生成に進みます。
115
+ - **はい、構造を最適化します**: このオプションは、計画を修正したい場合に選択します。プレーンテキストで、「'API' を 'API リファレンス' に変更」や「'デプロイ' のための新しいセクションを追加」などのフィードバックを提供できます。AI はあなたのフィードバックに基づいて構造を修正し、再度確認することができます。このサイクルは、構造があなたの要件を満たすまで繰り返すことができます。
116
+
117
+ ### 3. コンテンツの生成
118
+
119
+ ドキュメント構造が承認されると、DocSmith は計画内の各ドキュメントの詳細なコンテンツの生成を開始します。このプロセスは自動的に実行され、その所要時間はプロジェクトの規模と複雑さによって異なります。
120
+
121
+ 完了すると、生成されたファイルは設定で指定された出力ディレクトリ(例:`./docs`)に保存されます。
122
+
123
+ ## コマンドのパラメータ
124
+
125
+ `generate` コマンドは、その動作を制御するためのいくつかのオプションパラメータを受け入れます。
126
+
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` |
132
+
133
+ ### 例:完全な再構築を強制する
134
+
135
+ 以前に生成されたすべてのドキュメントを破棄し、コードの現在の状態に基づいて新しいセットを作成したい場合は、`--forceRegenerate` フラグを使用します。
136
+
137
+ ```bash 再生成の強制
138
+ aigne doc generate --forceRegenerate
139
+ ```
140
+
141
+ ## まとめ
142
+
143
+ `generate` コマンドは、初期プロジェクトドキュメントを作成するプロセス全体を統括します。自動化されたコード分析と対話的なレビュープロセスを組み合わせることで、構造化された関連性の高いドキュメント一式を生成します。
144
+
145
+ ドキュメントが生成された後、次のことを行うことができます。
146
+
147
+ - [ドキュメントの更新](./guides-updating-documentation.md): 特定のドキュメントに変更を加える。
148
+ - [ドキュメントの翻訳](./guides-translating-documentation.md): コンテンツを他の言語に翻訳する。
149
+ - [ドキュメントの公開](./guides-publishing-your-docs.md): ドキュメントをオンラインで利用可能にする。
@@ -0,0 +1,149 @@
1
+ # Generating Documentation
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
+ ```
86
+
87
+ ## Step-by-Step Process
88
+
89
+ To generate your documentation, navigate to the root directory of your project in your terminal and follow these steps.
90
+
91
+ ### 1. Run the Generate Command
92
+
93
+ Execute the `generate` command to begin the process. The tool will start by analyzing your project's files and structure.
94
+
95
+ ```bash Basic Generation Command
96
+ aigne doc generate
97
+ ```
98
+
99
+ You can also use the aliases `gen` or `g` for brevity.
100
+
101
+ ### 2. Review the Documentation Structure
102
+
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.
104
+
105
+ You will be prompted to review this plan:
106
+
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
+ ```
113
+
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.
116
+
117
+ ### 3. Content Generation
118
+
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.
120
+
121
+ Upon completion, the generated files will be saved to the output directory specified in your configuration (e.g., `./docs`).
122
+
123
+ ## Command Parameters
124
+
125
+ The `generate` command accepts several optional parameters to control its behavior.
126
+
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` |
132
+
133
+ ### Example: Forcing a Complete Rebuild
134
+
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.
136
+
137
+ ```bash Forcing Regeneration
138
+ aigne doc generate --forceRegenerate
139
+ ```
140
+
141
+ ## Summary
142
+
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.
144
+
145
+ After your documents are generated, you may want to:
146
+
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.
@@ -0,0 +1,149 @@
1
+ # 產生文件
2
+
3
+ 本指南提供了一套系統化程序,說明如何從專案的原始檔案建立完整文件。此流程使用 `aigne doc generate` 命令啟動,該命令會分析您的程式碼庫、提出邏輯結構,然後為每份文件撰寫內容。
4
+
5
+ 此命令是初次建立您文件的主要工具。若要在文件建立後進行修改,請參閱 [更新文件](./guides-updating-documentation.md) 指南。
6
+
7
+ ### 產生工作流程
8
+
9
+ `generate` 命令會執行一系列自動化步驟來建立您的文件。此過程設計為互動式,讓您能在內容寫入前,審查並核准建議的結構。
10
+
11
+ ```d2
12
+ direction: down
13
+
14
+ start: {
15
+ label: "開始"
16
+ shape: oval
17
+ }
18
+
19
+ run_command: {
20
+ label: "執行 'aigne doc generate'"
21
+ shape: rectangle
22
+ }
23
+
24
+ check_config: {
25
+ label: "設定檔是否存在?"
26
+ shape: diamond
27
+ }
28
+
29
+ interactive_setup: {
30
+ label: "引導進行互動式設定"
31
+ shape: rectangle
32
+ tooltip: "若找不到 .aigne/doc-smith/config.yaml,將觸發互動式設定。"
33
+ }
34
+
35
+ propose_structure: {
36
+ label: "分析專案並提出文件結構"
37
+ shape: rectangle
38
+ }
39
+
40
+ review_structure: {
41
+ label: "使用者審查建議的結構"
42
+ shape: rectangle
43
+ }
44
+
45
+ user_approve: {
46
+ label: "核准結構?"
47
+ shape: diamond
48
+ }
49
+
50
+ provide_feedback: {
51
+ label: "提供回饋以完善結構"
52
+ shape: rectangle
53
+ tooltip: "使用者可以要求變更,例如重新命名、新增或移除章節。"
54
+ }
55
+
56
+ generate_content: {
57
+ label: "為所有文件產生內容"
58
+ shape: rectangle
59
+ }
60
+
61
+ end: {
62
+ label: "結束"
63
+ shape: oval
64
+ }
65
+
66
+ start -> run_command
67
+ run_command -> check_config
68
+ check_config -> interactive_setup: {
69
+ label: "否"
70
+ }
71
+ interactive_setup -> propose_structure
72
+ check_config -> propose_structure: {
73
+ label: "是"
74
+ }
75
+ propose_structure -> review_structure
76
+ review_structure -> user_approve
77
+ user_approve -> provide_feedback: {
78
+ label: "否"
79
+ }
80
+ provide_feedback -> review_structure
81
+ user_approve -> generate_content: {
82
+ label: "是"
83
+ }
84
+ generate_content -> end
85
+ ```
86
+
87
+ ## 逐步流程
88
+
89
+ 若要產生您的文件,請在您的終端機中導覽至專案的根目錄,並遵循以下步驟。
90
+
91
+ ### 1. 執行 Generate 命令
92
+
93
+ 執行 `generate` 命令以開始此流程。該工具將首先分析您專案的檔案和結構。
94
+
95
+ ```bash 基本產生命令
96
+ aigne doc generate
97
+ ```
98
+
99
+ 您也可以使用別名 `gen` 或 `g` 以求簡潔。
100
+
101
+ ### 2. 審查文件結構
102
+
103
+ 分析完成後,該工具將呈現一個建議的文件結構。此結構是將要建立的各份文件的一個階層式規劃。
104
+
105
+ 系統會提示您審查此計畫:
106
+
107
+ ```
108
+ 您想最佳化文件結構嗎?
109
+ 您可以編輯標題、重組章節。
110
+ ❯ 看起來不錯 - 繼續使用目前結構
111
+ 是,最佳化結構
112
+ ```
113
+
114
+ - **看起來不錯 - 繼續使用目前結構**:選擇此選項以核准建議的結構,並直接進入內容產生階段。
115
+ - **是,最佳化結構**:如果您希望修改計畫,請選擇此選項。您將能夠以純文字形式提供回饋,例如「將『API』重新命名為『API 參考』」或「新增一個『部署』的章節」。AI 將根據您的回饋修訂結構,您可以再次審查。此循環可以重複進行,直到結構符合您的要求。
116
+
117
+ ### 3. 內容產生
118
+
119
+ 文件結構一經核准,DocSmith 將開始為計畫中的每份文件產生詳細內容。此過程會自動執行,其持續時間取決於您專案的規模與複雜度。
120
+
121
+ 完成後,產生的檔案將儲存至您設定中指定的輸出目錄(例如 `./docs`)。
122
+
123
+ ## 命令參數
124
+
125
+ `generate` 命令接受數個可選參數來控制其行為。
126
+
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` |
132
+
133
+ ### 範例:強制完全重建
134
+
135
+ 如果您想捨棄所有先前產生的文件,並根據您程式碼的目前狀態建立一套新的文件,請使用 `--forceRegenerate` 旗標。
136
+
137
+ ```bash 強制重新產生
138
+ aigne doc generate --forceRegenerate
139
+ ```
140
+
141
+ ## 總結
142
+
143
+ `generate` 命令統籌了建立您初始專案文件的整個流程。它結合了自動化程式碼分析與互動式審查流程,以產出一套結構化且相關的文件。
144
+
145
+ 文件產生後,您可能會想:
146
+
147
+ - [更新文件](./guides-updating-documentation.md):對特定文件進行變更。
148
+ - [翻譯文件](./guides-translating-documentation.md):將您的內容翻譯成其他語言。
149
+ - [發佈您的文件](./guides-publishing-your-docs.md):將您的文件發佈到網路上。
@@ -0,0 +1,149 @@
1
+ # 生成文档
2
+
3
+ 本指南提供了一个系统化的流程,用于从您项目的源文件创建一套完整的文档。该过程通过 `aigne doc generate` 命令启动,该命令会分析您的代码库,提出一个逻辑结构,然后为每个文档编写内容。
4
+
5
+ 该命令是初次创建文档的主要工具。如需在文档创建后进行修改,请参阅[更新文档](./guides-updating-documentation.md)指南。
6
+
7
+ ### 生成工作流
8
+
9
+ `generate` 命令执行一系列自动化步骤来构建您的文档。该过程设计为交互式,允许您在内容写入前审查和批准建议的结构。
10
+
11
+ ```d2
12
+ direction: down
13
+
14
+ start: {
15
+ label: "开始"
16
+ shape: oval
17
+ }
18
+
19
+ run_command: {
20
+ label: "运行 'aigne doc generate'"
21
+ shape: rectangle
22
+ }
23
+
24
+ check_config: {
25
+ label: "配置文件是否存在?"
26
+ shape: diamond
27
+ }
28
+
29
+ interactive_setup: {
30
+ label: "引导进行交互式设置"
31
+ shape: rectangle
32
+ tooltip: "如果未找到 .aigne/doc-smith/config.yaml,将触发交互式设置。"
33
+ }
34
+
35
+ propose_structure: {
36
+ label: "分析项目并提出文档结构"
37
+ shape: rectangle
38
+ }
39
+
40
+ review_structure: {
41
+ label: "用户审查建议的结构"
42
+ shape: rectangle
43
+ }
44
+
45
+ user_approve: {
46
+ label: "批准结构?"
47
+ shape: diamond
48
+ }
49
+
50
+ provide_feedback: {
51
+ label: "提供反馈以优化结构"
52
+ shape: rectangle
53
+ tooltip: "用户可以请求更改,例如重命名、添加或删除部分。"
54
+ }
55
+
56
+ generate_content: {
57
+ label: "为所有文档生成内容"
58
+ shape: rectangle
59
+ }
60
+
61
+ end: {
62
+ label: "结束"
63
+ shape: oval
64
+ }
65
+
66
+ start -> run_command
67
+ run_command -> check_config
68
+ check_config -> interactive_setup: {
69
+ label: "否"
70
+ }
71
+ interactive_setup -> propose_structure
72
+ check_config -> propose_structure: {
73
+ label: "是"
74
+ }
75
+ propose_structure -> review_structure
76
+ review_structure -> user_approve
77
+ user_approve -> provide_feedback: {
78
+ label: "否"
79
+ }
80
+ provide_feedback -> review_structure
81
+ user_approve -> generate_content: {
82
+ label: "是"
83
+ }
84
+ generate_content -> end
85
+ ```
86
+
87
+ ## 分步流程
88
+
89
+ 要生成您的文档,请在终端中导航到项目的根目录,并按照以下步骤操作。
90
+
91
+ ### 1. 运行生成命令
92
+
93
+ 执行 `generate` 命令以开始该过程。该工具将首先分析您项目的文件和结构。
94
+
95
+ ```bash 基础生成命令
96
+ aigne doc generate
97
+ ```
98
+
99
+ 为简洁起见,您也可以使用别名 `gen` 或 `g`。
100
+
101
+ ### 2. 审查文档结构
102
+
103
+ 分析完成后,该工具将呈现一个建议的文档结构。该结构是即将创建的文档的层级计划。
104
+
105
+ 系统将提示您审查此计划:
106
+
107
+ ```
108
+ 您想优化文档结构吗?
109
+ 您可以编辑标题、重组章节。
110
+ ❯ 看起来不错 - 继续使用当前结构
111
+ 是的,优化结构
112
+ ```
113
+
114
+ - **看起来不错 - 继续使用当前结构**:选择此选项以批准建议的结构,并直接进入内容生成阶段。
115
+ - **是的,优化结构**:如果您希望修改计划,请选择此选项。您将能够以纯文本形式提供反馈,例如“将‘API’重命名为‘API 参考’”或“为‘部署’添加一个新章节”。AI 将根据您的反馈修订结构,您可以再次审查。此循环可以重复,直到结构满足您的要求。
116
+
117
+ ### 3. 内容生成
118
+
119
+ 一旦文档结构获得批准,DocSmith 将开始为计划中的每个文档生成详细内容。此过程自动运行,其持续时间取决于项目的规模和复杂性。
120
+
121
+ 完成后,生成的文件将保存到您在配置中指定的输出目录(例如 `./docs`)。
122
+
123
+ ## 命令参数
124
+
125
+ `generate` 命令接受几个可选参数来控制其行为。
126
+
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` |
132
+
133
+ ### 示例:强制完全重建
134
+
135
+ 如果您想丢弃所有先前生成的文档,并根据代码的当前状态创建一套新的文档,请使用 `--forceRegenerate` 标志。
136
+
137
+ ```bash 强制重新生成
138
+ aigne doc generate --forceRegenerate
139
+ ```
140
+
141
+ ## 总结
142
+
143
+ `generate` 命令协调了创建初始项目文档的整个过程。它将自动代码分析与交互式审查过程相结合,以生成一套结构化且相关的文档。
144
+
145
+ 文档生成后,您可能希望:
146
+
147
+ - [更新文档](./guides-updating-documentation.md):对特定文档进行更改。
148
+ - [翻译文档](./guides-translating-documentation.md):将您的内容翻译成其他语言。
149
+ - [发布您的文档](./guides-publishing-your-docs.md):将您的文档在线发布。
@@ -0,0 +1,85 @@
1
+ # 対話型チャット
2
+
3
+ 対話型チャットアシスタントは、ドキュメントの生成、修正、管理を行うための会話形式のインターフェースを提供します。個々のコマンドを実行する代わりに、何をしたいかを説明するだけで、アシスタントがプロセスを案内し、適切なツールを呼び出してタスクを完了します。
4
+
5
+ このアプローチは、裏側で実行されるコマンドを自動的に処理することで、ドキュメント作成のワークフローを簡素化します。このツールを使用するほとんどのインタラクションにおいて、この方法が推奨されます。
6
+
7
+ ## チャットアシスタントの開始
8
+
9
+ 対話型セッションを開始するには、ターミナルから `chat` コマンドを実行します。
10
+
11
+ ```bash
12
+ aigndoc chat
13
+ ```
14
+
15
+ これによりアシスタントが起動し、リクエストの入力を開始できます。
16
+
17
+ ## 主な機能
18
+
19
+ チャットアシスタントは、ドキュメント作成のライフサイクル全体を処理するように設計されています。その主な機能は以下の通りです。
20
+
21
+ <x-cards data-columns="2">
22
+ <x-card data-title="ドキュメントの生成" data-icon="lucide:file-plus-2">
23
+ プロジェクトのソースファイルを分析して、完全なドキュメント構造と初期コンテンツを作成します。
24
+ </x-card>
25
+ <x-card data-title="改良と更新" data-icon="lucide:edit">
26
+ フィードバックやソースコードの変更に基づいて、特定のセクションまたはドキュメント全体を再生成します。
27
+ </x-card>
28
+ <x-card data-title="コンテンツの翻訳" data-icon="lucide:languages">
29
+ 既存のドキュメントを多言語に翻訳し、より多くの読者に届けます。
30
+ </x-card>
31
+ <x-card data-title="公開と管理" data-icon="lucide:upload-cloud">
32
+ ドキュメントの公開とチームベースのワークフローの管理を支援します。
33
+ </x-card>
34
+ </x-cards>
35
+
36
+ ## 利用可能なコマンド
37
+
38
+ チャット内では、目標を平易な言葉で述べたり(例:「入門ガイドを更新して」)、特定のコマンドを呼び出したりすることができます。アシスタントは、その専門的なスキルに対応する以下のコアコマンドを理解します。
39
+
40
+ | Command | Description |
41
+ | :--- | :--- |
42
+ | `generate` | ソースファイルから新しいドキュメント構造を作成するプロセスを開始します。 |
43
+ | `update` | コードの変更やユーザーのフィードバックに基づいて、既存のドキュメントを修正します。 |
44
+ | `translate` | ドキュメントを1つ以上の対応言語に翻訳します。 |
45
+ | `publish` | ドキュメントを公開し、オンラインでアクセスできるようにします。 |
46
+ | `init` | プロジェクトの初期設定ファイルの作成をガイドします。 |
47
+ | `clear` | 生成されたファイル、設定、キャッシュデータを削除します。 |
48
+ | `prefs` | ドキュメント生成のために保存された設定を管理します。 |
49
+ | `evaluate` | 生成されたドキュメントの品質と完全性を評価します。 |
50
+ | `history` | ドキュメントに加えられた更新の履歴を表示します。 |
51
+ | `exit` | 対話型チャットセッションを終了します。 |
52
+
53
+ ## 対話例
54
+
55
+ 以下は、対話型アシスタントがどのように機能するかを示す会話のサンプルです。
56
+
57
+ ```text
58
+ あなた:
59
+ > こんにちは、新しいプロジェクトのドキュメントを作成したいです。
60
+
61
+ AI アシスタント:
62
+ もちろんです。まず、プロジェクトの構造を分析する必要があります。ソースコードディレクトリへのパスを教えていただけますか?
63
+
64
+ あなた:
65
+ > ./src
66
+
67
+ AI アシスタント:
68
+ ありがとうございます。./src 内のファイルを分析し、ドキュメント構造を提案します。これには少し時間がかかる場合があります...
69
+ ...
70
+ プロジェクトの分析が完了し、提案する構造を作成しました。コンテンツの生成に進む前に、ご確認いただけますか? (yes/no)
71
+
72
+ あなた:
73
+ > yes
74
+
75
+ AI アシスタント:
76
+ (レビュー用に提案されたドキュメント構造を表示)
77
+ ...
78
+ 上記の構造をご確認ください。どの部分でも追加、削除、修正を依頼できます。
79
+ ```
80
+
81
+ ## まとめ
82
+
83
+ 対話型チャットアシスタントは、ガイド付きの会話形式でドキュメントを管理するための強力なツールです。必要な手順やコマンドを自動で処理することで、複雑なタスクを効率化します。
84
+
85
+ 特定のワークフローに関するより詳細なウォークスルーについては、[ドキュメントの生成](./guides-generating-documentation.md) ガイドを参照してください。