@aigne/doc-smith 0.8.11-beta.5 → 0.8.11-beta.7

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 (159) hide show
  1. package/.aigne/doc-smith/config.yaml +3 -1
  2. package/.aigne/doc-smith/output/structure-plan.json +2 -2
  3. package/.aigne/doc-smith/preferences.yml +28 -20
  4. package/.aigne/doc-smith/upload-cache.yaml +702 -0
  5. package/.release-please-manifest.json +1 -1
  6. package/CHANGELOG.md +22 -2
  7. package/README.md +2 -2
  8. package/agents/clear/choose-contents.mjs +2 -2
  9. package/agents/clear/clear-document-structure.mjs +8 -8
  10. package/agents/clear/index.yaml +1 -1
  11. package/agents/evaluate/document-structure.yaml +1 -1
  12. package/agents/generate/check-document-structure.yaml +3 -3
  13. package/agents/generate/check-need-generate-structure.mjs +8 -8
  14. package/agents/generate/document-structure-tools/add-document.mjs +38 -13
  15. package/agents/generate/document-structure-tools/delete-document.mjs +37 -14
  16. package/agents/generate/document-structure-tools/move-document.mjs +46 -19
  17. package/agents/generate/document-structure-tools/update-document.mjs +39 -12
  18. package/agents/generate/generate-structure.yaml +1 -1
  19. package/agents/generate/update-document-structure.yaml +3 -9
  20. package/agents/generate/user-review-document-structure.mjs +15 -14
  21. package/agents/translate/translate-document.yaml +1 -9
  22. package/agents/update/batch-generate-document.yaml +1 -1
  23. package/agents/update/check-document.mjs +2 -2
  24. package/agents/update/check-update-is-single.mjs +2 -1
  25. package/agents/update/document-tools/update-document-content.mjs +24 -14
  26. package/agents/update/fs-tools/glob.mjs +184 -0
  27. package/agents/update/fs-tools/grep.mjs +317 -0
  28. package/agents/update/fs-tools/read-file.mjs +307 -0
  29. package/agents/update/generate-document.yaml +4 -7
  30. package/agents/update/update-document-detail.yaml +6 -10
  31. package/agents/update/user-review-document.mjs +13 -13
  32. package/agents/utils/check-feedback-refiner.mjs +1 -1
  33. package/agents/utils/choose-docs.mjs +1 -1
  34. package/agents/utils/load-document-all-content.mjs +3 -3
  35. package/agents/utils/load-sources.mjs +1 -1
  36. package/agents/utils/save-docs.mjs +7 -28
  37. package/aigne.yaml +2 -2
  38. package/assets/screenshots/doc-complete-setup.png +0 -0
  39. package/assets/screenshots/doc-generate-docs.png +0 -0
  40. package/assets/screenshots/doc-generate.png +0 -0
  41. package/assets/screenshots/doc-generated-successfully.png +0 -0
  42. package/assets/screenshots/doc-publish.png +0 -0
  43. package/assets/screenshots/doc-regenerate.png +0 -0
  44. package/assets/screenshots/doc-translate-langs.png +0 -0
  45. package/assets/screenshots/doc-translate.png +0 -0
  46. package/assets/screenshots/doc-update.png +0 -0
  47. package/docs/_sidebar.md +1 -1
  48. package/docs/advanced-how-it-works.ja.md +31 -31
  49. package/docs/advanced-how-it-works.md +10 -10
  50. package/docs/advanced-how-it-works.zh-TW.md +24 -24
  51. package/docs/advanced-how-it-works.zh.md +20 -20
  52. package/docs/advanced-quality-assurance.ja.md +57 -61
  53. package/docs/advanced-quality-assurance.md +57 -61
  54. package/docs/advanced-quality-assurance.zh-TW.md +57 -61
  55. package/docs/advanced-quality-assurance.zh.md +57 -61
  56. package/docs/advanced.ja.md +8 -4
  57. package/docs/advanced.md +7 -3
  58. package/docs/advanced.zh-TW.md +9 -5
  59. package/docs/advanced.zh.md +9 -5
  60. package/docs/changelog.ja.md +206 -29
  61. package/docs/changelog.md +177 -0
  62. package/docs/changelog.zh-TW.md +229 -52
  63. package/docs/changelog.zh.md +204 -27
  64. package/docs/cli-reference.ja.md +181 -80
  65. package/docs/cli-reference.md +168 -67
  66. package/docs/cli-reference.zh-TW.md +177 -76
  67. package/docs/cli-reference.zh.md +172 -71
  68. package/docs/configuration-interactive-setup.ja.md +45 -42
  69. package/docs/configuration-interactive-setup.md +9 -6
  70. package/docs/configuration-interactive-setup.zh-TW.md +26 -23
  71. package/docs/configuration-interactive-setup.zh.md +25 -22
  72. package/docs/configuration-language-support.ja.md +33 -63
  73. package/docs/configuration-language-support.md +32 -62
  74. package/docs/configuration-language-support.zh-TW.md +35 -65
  75. package/docs/configuration-language-support.zh.md +32 -62
  76. package/docs/configuration-llm-setup.ja.md +25 -23
  77. package/docs/configuration-llm-setup.md +20 -18
  78. package/docs/configuration-llm-setup.zh-TW.md +21 -19
  79. package/docs/configuration-llm-setup.zh.md +20 -18
  80. package/docs/configuration-preferences.ja.md +67 -52
  81. package/docs/configuration-preferences.md +55 -40
  82. package/docs/configuration-preferences.zh-TW.md +69 -54
  83. package/docs/configuration-preferences.zh.md +68 -53
  84. package/docs/configuration.ja.md +98 -58
  85. package/docs/configuration.md +42 -2
  86. package/docs/configuration.zh-TW.md +86 -46
  87. package/docs/configuration.zh.md +76 -36
  88. package/docs/features-generate-documentation.ja.md +49 -55
  89. package/docs/features-generate-documentation.md +49 -55
  90. package/docs/features-generate-documentation.zh-TW.md +54 -60
  91. package/docs/features-generate-documentation.zh.md +48 -54
  92. package/docs/features-publish-your-docs.ja.md +68 -45
  93. package/docs/features-publish-your-docs.md +65 -42
  94. package/docs/features-publish-your-docs.zh-TW.md +74 -51
  95. package/docs/features-publish-your-docs.zh.md +67 -44
  96. package/docs/features-translate-documentation.ja.md +46 -35
  97. package/docs/features-translate-documentation.md +39 -28
  98. package/docs/features-translate-documentation.zh-TW.md +45 -34
  99. package/docs/features-translate-documentation.zh.md +39 -28
  100. package/docs/features-update-and-refine.ja.md +75 -71
  101. package/docs/features-update-and-refine.md +67 -63
  102. package/docs/features-update-and-refine.zh-TW.md +72 -67
  103. package/docs/features-update-and-refine.zh.md +71 -67
  104. package/docs/features.ja.md +29 -19
  105. package/docs/features.md +25 -15
  106. package/docs/features.zh-TW.md +28 -18
  107. package/docs/features.zh.md +31 -21
  108. package/docs/getting-started.ja.md +43 -46
  109. package/docs/getting-started.md +36 -39
  110. package/docs/getting-started.zh-TW.md +41 -44
  111. package/docs/getting-started.zh.md +39 -42
  112. package/docs/overview.ja.md +63 -11
  113. package/docs/overview.md +62 -10
  114. package/docs/overview.zh-TW.md +67 -15
  115. package/docs/overview.zh.md +62 -10
  116. package/docs-mcp/analyze-docs-relevance.yaml +6 -6
  117. package/docs-mcp/docs-search.yaml +1 -1
  118. package/media.md +9 -9
  119. package/package.json +2 -2
  120. package/prompts/common/document-structure/conflict-resolution-guidance.md +3 -3
  121. package/prompts/common/document-structure/document-structure-rules.md +2 -2
  122. package/prompts/detail/custom/custom-components.md +304 -188
  123. package/prompts/detail/document-rules.md +5 -5
  124. package/prompts/detail/generate-document.md +21 -8
  125. package/prompts/detail/update-document.md +8 -12
  126. package/prompts/evaluate/document-structure.md +6 -6
  127. package/prompts/structure/check-document-structure.md +10 -10
  128. package/prompts/structure/document-rules.md +2 -2
  129. package/prompts/structure/generate-structure-system.md +3 -3
  130. package/prompts/structure/structure-example.md +1 -1
  131. package/prompts/structure/structure-getting-started.md +1 -1
  132. package/prompts/structure/update-document-structure.md +18 -14
  133. package/prompts/utils/feedback-refiner.md +3 -3
  134. package/tests/agents/clear/choose-contents.test.mjs +1 -1
  135. package/tests/agents/clear/clear-document-structure.test.mjs +36 -30
  136. package/tests/agents/evaluate/generate-report.test.mjs +1 -1
  137. package/tests/agents/generate/check-need-generate-structure.test.mjs +1 -1
  138. package/tests/agents/generate/document-structure-tools/add-document.test.mjs +2 -2
  139. package/tests/agents/generate/document-structure-tools/delete-document.test.mjs +4 -4
  140. package/tests/agents/generate/document-structure-tools/move-document.test.mjs +12 -12
  141. package/tests/agents/generate/document-structure-tools/update-document.test.mjs +3 -3
  142. package/tests/agents/generate/user-review-document-structure.test.mjs +36 -13
  143. package/tests/agents/update/check-document.test.mjs +1 -1
  144. package/tests/agents/update/document-tools/update-document-content.test.mjs +115 -112
  145. package/tests/agents/update/fs-tools/glob.test.mjs +438 -0
  146. package/tests/agents/update/fs-tools/grep.test.mjs +279 -0
  147. package/tests/agents/update/fs-tools/read-file.test.mjs +553 -0
  148. package/tests/agents/update/user-review-document.test.mjs +48 -27
  149. package/tests/agents/utils/format-document-structure.test.mjs +5 -5
  150. package/tests/agents/utils/load-sources.test.mjs +4 -4
  151. package/tests/agents/utils/save-docs.test.mjs +1 -1
  152. package/tests/utils/conflict-detector.test.mjs +1 -1
  153. package/tests/utils/docs-finder-utils.test.mjs +8 -8
  154. package/types/document-schema.mjs +5 -6
  155. package/types/document-structure-schema.mjs +25 -13
  156. package/utils/conflict-detector.mjs +1 -1
  157. package/utils/constants/index.mjs +4 -4
  158. package/utils/docs-finder-utils.mjs +11 -11
  159. package/utils/markdown-checker.mjs +1 -1
@@ -1,96 +1,92 @@
1
1
  # 品質保証
2
2
 
3
- 生成されるすべてのドキュメントが機能的、明確、かつプロフェッショナルであることを保証するため、DocSmithには自動品質保証プロセスが組み込まれています。このプロセスは、公開前にMarkdownコンテンツに対して一連のチェックを実行し、リンク切れから不正な形式の図まで、一般的な問題を検出して報告します。
3
+ 生成されるすべてのドキュメントが高い品質、一貫性、正確性の基準を満たすように、DocSmithには包括的で自動化された品質保証パイプラインが含まれています。これらの組み込みチェックは自動的に実行され、公開前に一般的なフォーマットエラー、リンク切れ、構造的な問題を特定してフラグを立てます。このプロセスにより、最終的な出力がプロフェッショナルで信頼性が高く、ユーザーがナビゲートしやすいものになることが保証されます。
4
4
 
5
- この自動化されたパイプラインは、コンテンツの構造、リンク、メディア、構文を検証し、一貫した品質基準を維持します。
6
-
7
- ```d2
5
+ ```d2 品質保証パイプライン icon=lucide:shield-check
8
6
  direction: down
9
7
 
10
- Input-Markdown-Content: {
11
- label: "入力: Markdownコンテンツ"
8
+ Documentation-Content: {
9
+ label: "ドキュメントコンテンツ"
12
10
  shape: rectangle
13
11
  }
14
12
 
15
- QA-Pipeline: {
16
- label: "QAパイプライン"
13
+ Quality-Assurance-Pipeline: {
14
+ label: "品質保証パイプライン"
17
15
  shape: rectangle
18
- grid-columns: 1
16
+ grid-columns: 3
19
17
  grid-gap: 50
20
18
 
21
- Structural-Checks: {
22
- label: "構造チェック"
19
+ Markdown-Validation: {
20
+ label: "1. Markdownとコンテンツの検証\n(remark-lintベース)"
23
21
  shape: rectangle
24
- grid-columns: 2
25
- Completeness: "コンテンツが切り捨てられていないことを保証"
26
- Code-Blocks: "ブロックの構文とインデントを検証"
22
+
23
+ Check-1: "有効なMarkdown構文"
24
+ Check-2: "見出しの整合性"
25
+ Check-3: "テーブルのフォーマット"
26
+ Check-4: "コードブロックの整合性"
27
+ Check-5: "コンテンツの完全性"
27
28
  }
28
29
 
29
- Content-Validation: {
30
- label: "コンテンツ検証"
30
+ Link-Asset-Validation: {
31
+ label: "2. リンクとアセットの整合性"
31
32
  shape: rectangle
32
- grid-columns: 2
33
- Link-Integrity: "内部リンクを検証"
34
- Image-Paths: "ローカル画像の存在を確認"
35
- Table-Formatting: "列数が一致するか確認"
33
+
34
+ Check-6: "リンク切れの検出"
35
+ Check-7: "ローカル画像の検証"
36
36
  }
37
37
 
38
- Syntax-Validation: {
39
- label: "構文検証"
38
+ D2-Diagram-Validation: {
39
+ label: "3. D2ダイアグラムの検証"
40
40
  shape: rectangle
41
- grid-columns: 2
42
- D2-Diagrams: "D2構文を検証"
43
- Markdown-Linting: "スタイルルールを強制"
41
+
42
+ Check-8: "D2構文チェック"
44
43
  }
45
44
  }
46
45
 
47
- Output-Validated-Content-or-Error-Report: {
48
- label: "出力: 検証済みコンテンツまたはエラーレポート"
49
- shape: rectangle
46
+ Validation-Result: {
47
+ label: "すべてのチェックに合格?"
48
+ shape: diamond
50
49
  }
51
50
 
52
- Input-Markdown-Content -> QA-Pipeline
53
- QA-Pipeline -> Output-Validated-Content-or-Error-Report
54
- ```
55
-
56
- ### 主要な検証領域
57
-
58
- DocSmithの品質保証プロセスは、ドキュメントの完全性を保証するため、いくつかの主要な領域をカバーしています。
59
-
60
- #### コンテンツの構造と完全性
61
-
62
- DocSmithは、コンテンツの構造的完全性を保証するために、いくつかのチェックを実行します:
51
+ Published-Documentation: {
52
+ label: "公開済みドキュメント"
53
+ shape: rectangle
54
+ style.fill: "#d4edda"
55
+ }
63
56
 
64
- - **不完全なコードブロック**: ` ``` ` で開始されて閉じられていないコードブロックを検出します。
65
- - **改行の欠落**: 1行に表示されるコンテンツを特定します。これは改行が欠落している可能性を示します。
66
- - **コンテンツの末尾**: コンテンツが適切な句読点(例:`.`, `)`, `|`, `>`)で終わっていることを確認し、出力が切り捨てられるのを防ぎます。
67
- - **コードブロックのインデント**: コードブロックのインデントの不整合を分析します。コード行のインデントが開始の ` ``` ` マーカーよりも少ない場合、レンダリングの問題を引き起こす可能性があります。このチェックは、正しいコードの表示を維持するのに役立ちます。
57
+ Error-Report: {
58
+ label: "エラーレポート"
59
+ shape: rectangle
60
+ style.fill: "#f8d7da"
61
+ }
68
62
 
69
- #### リンクとメディアの整合性
63
+ Documentation-Content -> Quality-Assurance-Pipeline: "入力"
64
+ Quality-Assurance-Pipeline -> Validation-Result: "検証"
65
+ Validation-Result -> Published-Documentation: "はい"
66
+ Validation-Result -> Error-Report: "いいえ"
67
+ ```
70
68
 
71
- - **リンクの整合性**: ドキュメント内のすべての相対リンクは、ドキュメント構造計画と照らし合わせて検証され、リンク切れを防ぎます。これにより、すべての内部ナビゲーションが期待どおりに機能することが保証されます。チェッカーは外部リンク(`http://` または `https://` で始まる)および `mailto:` リンクを無視します。
69
+ ## Markdownとコンテンツ構造の検証
72
70
 
73
- - **画像の検証**: 画像の破損を避けるため、チェッカーはドキュメントで参照されているローカル画像ファイルがファイルシステムに存在することを確認します。相対パスと絶対パスの両方を解決して、ファイルの存在を確認します。外部リンクのURLやデータURLはチェックされません。
71
+ 品質保証の基盤は、コアとなるMarkdownが整形され、構造的に健全であることを保証することです。DocSmithは`remark-lint`をベースにした高度なリンターを採用しており、一般的な構造上の問題を検出するためのカスタムチェックで補完されています。
74
72
 
75
- #### 図の構文検証
73
+ 主な構造およびフォーマットのチェックには、次のものが含まれます。
76
74
 
77
- - **D2図**: DocSmithは、コードをSVG画像にコンパイルしようとすることでD2図の構文を検証します。このプロセスにより、構文エラーが図の破損につながる前に捕捉されます。
75
+ * **有効なMarkdown構文**:標準のMarkdownおよびGFM(GitHub Flavored Markdown)仕様への準拠。
76
+ * **見出しの整合性**:同一ドキュメント内の重複した見出し、不適切な見出しのインデント、複数のトップレベル見出し(H1)の使用などの問題を検出します。
77
+ * **テーブルのフォーマット**:テーブル構造が正しいことを検証します。特に、ヘッダー、区切り線、およびデータ行の列数の不一致をチェックします。
78
+ * **コードブロックの整合性**:すべてのコードブロックが ``` で適切に開始および終了していることを保証します。また、レンダリングに影響を与える可能性のある、コードブロック内の一貫性のないインデントもチェックします。
79
+ * **コンテンツの完全性**:生成されたコンテンツが適切な句読点で終わっていることを確認し、コンテンツが切り捨てられていないことを保証する検証ステップです。
78
80
 
79
- #### フォーマットとスタイルの強制
81
+ ## リンクとアセットの整合性
80
82
 
81
- - **テーブルのフォーマット**: ヘッダー、区切り線、データ行の間で列数が一致しないテーブルを検査します。このチェックにより、一般的なテーブルのレンダリング失敗を防ぎます。
83
+ リンク切れや画像が見つからないことは、ユーザーエクスペリエンスを低下させます。DocSmithは、すべてのローカルリソースを検証するためのチェックを実行します。
82
84
 
83
- - **Markdownリンティング**: 組み込みのリンターが一貫したMarkdown構造を強制します。主要なルールには以下が含まれます:
85
+ * **リンク切れの検出**:システムはすべての相対Markdownリンクをスキャンし、ターゲットパスがプロジェクトのドキュメント構造で定義された有効なドキュメントに対応していることを検証します。このチェックにより、ユーザーがドキュメントをナビゲートする際に「404 Not Found」エラーに遭遇するのを防ぎます。`http://`または`https://`で始まる外部リンクはチェックされません。
86
+ * **ローカル画像の検証**:`![]()`を介して含まれるすべてのローカル画像について、バリデーターは参照されている画像ファイルが指定されたパスに存在することを確認します。これにより、最終的な出力に壊れた画像が表示されないようにします。
84
87
 
85
- | ルールID | 説明 |
86
- |---|---|
87
- | `no-duplicate-headings` | 同じセクション内で同じ内容の複数の見出しを防ぎます。 |
88
- | `no-undefined-references` | すべてのリンクと画像の参照が定義されていることを保証します。 |
89
- | `no-unused-definitions` | 使用されていないリンクや画像の定義にフラグを立てます。 |
90
- | `no-heading-content-indent` | 見出しの内容の前にインデントを許可しません。 |
91
- | `no-multiple-toplevel-headings` | ドキュメントごとにトップレベルの見出し(H1)を1つだけ許可します。 |
92
- | `code-block-style` | コードブロックに一貫したスタイル(例:バッククォートの使用)を強制します。 |
88
+ ## D2ダイアグラムの検証
93
89
 
94
- これらのチェックを自動化することで、DocSmithはドキュメントの一貫した基準を維持し、最終的な出力が正確でナビゲート可能であることを保証します。
90
+ すべてのダイアグラムが正しくレンダリングされることを保証するため、DocSmithはすべてのD2ダイアグラムの構文を検証します。
95
91
 
96
- 全体的なアーキテクチャについて詳しく知るには、[仕組み](./advanced-how-it-works.md)のセクションを参照してください。
92
+ `d2`とマークされた各コードブロックは、厳密な構文チェッカーによって処理されます。構文エラーが見つかった場合、生成プロセスは説明的なエラーメッセージとともに停止されます。これにより、壊れた、または不適切にレンダリングされた視覚的なダイアグラムを含むドキュメントの公開を防ぎます。
@@ -1,96 +1,92 @@
1
1
  # Quality Assurance
2
2
 
3
- To ensure all generated documentation is functional, clear, and professional, DocSmith incorporates an automated quality assurance process. This process executes a series of checks on the Markdown content to detect and report common issues, from broken links to malformed diagrams, before publication.
3
+ To ensure that all generated documentation meets a high standard of quality, consistency, and accuracy, DocSmith includes a comprehensive, automated quality assurance pipeline. These built-in checks run automatically to identify and flag common formatting errors, broken links, and structural issues before publication. This process guarantees that the final output is professional, reliable, and easy for users to navigate.
4
4
 
5
- This automated pipeline validates content structure, links, media, and syntax to maintain a consistent standard of quality.
6
-
7
- ```d2
5
+ ```d2 Quality Assurance Pipeline icon=lucide:shield-check
8
6
  direction: down
9
7
 
10
- Input-Markdown-Content: {
11
- label: "Input: Markdown Content"
8
+ Documentation-Content: {
9
+ label: "Documentation Content"
12
10
  shape: rectangle
13
11
  }
14
12
 
15
- QA-Pipeline: {
16
- label: "QA Pipeline"
13
+ Quality-Assurance-Pipeline: {
14
+ label: "Quality Assurance Pipeline"
17
15
  shape: rectangle
18
- grid-columns: 1
16
+ grid-columns: 3
19
17
  grid-gap: 50
20
18
 
21
- Structural-Checks: {
22
- label: "Structural Checks"
19
+ Markdown-Validation: {
20
+ label: "1. Markdown & Content Validation\n(remark-lint based)"
23
21
  shape: rectangle
24
- grid-columns: 2
25
- Completeness: "Ensures content is not truncated"
26
- Code-Blocks: "Validates block syntax & indentation"
22
+
23
+ Check-1: "Valid Markdown Syntax"
24
+ Check-2: "Heading Integrity"
25
+ Check-3: "Table Formatting"
26
+ Check-4: "Code Block Integrity"
27
+ Check-5: "Content Completeness"
27
28
  }
28
29
 
29
- Content-Validation: {
30
- label: "Content Validation"
30
+ Link-Asset-Validation: {
31
+ label: "2. Link & Asset Integrity"
31
32
  shape: rectangle
32
- grid-columns: 2
33
- Link-Integrity: "Verifies internal links"
34
- Image-Paths: "Checks local image existence"
35
- Table-Formatting: "Matches column counts"
33
+
34
+ Check-6: "Dead Link Detection"
35
+ Check-7: "Local Image Validation"
36
36
  }
37
37
 
38
- Syntax-Validation: {
39
- label: "Syntax Validation"
38
+ D2-Diagram-Validation: {
39
+ label: "3. D2 Diagram Validation"
40
40
  shape: rectangle
41
- grid-columns: 2
42
- D2-Diagrams: "Validates D2 syntax"
43
- Markdown-Linting: "Enforces style rules"
41
+
42
+ Check-8: "D2 Syntax Check"
44
43
  }
45
44
  }
46
45
 
47
- Output-Validated-Content-or-Error-Report: {
48
- label: "Output: Validated Content or Error Report"
49
- shape: rectangle
46
+ Validation-Result: {
47
+ label: "All Checks Pass?"
48
+ shape: diamond
50
49
  }
51
50
 
52
- Input-Markdown-Content -> QA-Pipeline
53
- QA-Pipeline -> Output-Validated-Content-or-Error-Report
54
- ```
55
-
56
- ### Core Validation Areas
57
-
58
- DocSmith's quality assurance process covers several key areas to ensure document integrity.
59
-
60
- #### Content Structure & Completeness
61
-
62
- DocSmith performs several checks to ensure the structural integrity of the content:
51
+ Published-Documentation: {
52
+ label: "Published Documentation"
53
+ shape: rectangle
54
+ style.fill: "#d4edda"
55
+ }
63
56
 
64
- - **Incomplete Code Blocks**: Detects code blocks that are opened with ` ``` ` but never closed.
65
- - **Missing Line Breaks**: Identifies content that appears on a single line, which may indicate missing newlines.
66
- - **Content Endings**: Verifies that the content ends with appropriate punctuation (e.g., `.`, `)`, `|`, `>`) to prevent truncated output.
67
- - **Code Block Indentation**: Analyzes code blocks for inconsistent indentation. If a line of code has less indentation than the opening ` ``` ` marker, it can cause rendering problems. This check helps maintain correct code presentation.
57
+ Error-Report: {
58
+ label: "Error Report"
59
+ shape: rectangle
60
+ style.fill: "#f8d7da"
61
+ }
68
62
 
69
- #### Link and Media Integrity
63
+ Documentation-Content -> Quality-Assurance-Pipeline: "Input"
64
+ Quality-Assurance-Pipeline -> Validation-Result: "Validation"
65
+ Validation-Result -> Published-Documentation: "Yes"
66
+ Validation-Result -> Error-Report: "No"
67
+ ```
70
68
 
71
- - **Link Integrity**: All relative links within the documentation are validated against the document structure plan to prevent dead links. This ensures that all internal navigation works as expected. The checker ignores external links (starting with `http://` or `https://`) and `mailto:` links.
69
+ ## Markdown and Content Structure Validation
72
70
 
73
- - **Image Validation**: To avoid broken images, the checker verifies that any local image file referenced in the documentation exists on the file system. It resolves both relative and absolute paths to confirm the file is present. External image URLs and data URLs are not checked.
71
+ The foundation of quality assurance is ensuring the core Markdown is well-formed and structurally sound. DocSmith employs a sophisticated linter based on `remark-lint`, supplemented with custom checks to catch common structural problems.
74
72
 
75
- #### Diagram Syntax Validation
73
+ Key structural and formatting checks include:
76
74
 
77
- - **D2 Diagrams**: DocSmith validates D2 diagram syntax by attempting to compile the code into an SVG image. This process catches any syntax errors before they can result in a broken graphic.
75
+ * **Valid Markdown Syntax**: Adherence to standard Markdown and GFM (GitHub Flavored Markdown) specifications.
76
+ * **Heading Integrity**: Detects issues such as duplicate headings within the same document, incorrect heading indentation, and the use of more than one top-level heading (H1).
77
+ * **Table Formatting**: Verifies that table structures are correct, specifically checking for mismatches between the number of columns in the header, the separator line, and the data rows.
78
+ * **Code Block Integrity**: Ensures that all code blocks are properly opened and closed with ```. It also checks for inconsistent indentation within a code block, which can affect rendering.
79
+ * **Content Completeness**: A verification step to ensure that generated content does not appear truncated by checking that it ends with appropriate punctuation.
78
80
 
79
- #### Formatting and Style Enforcement
81
+ ## Link and Asset Integrity
80
82
 
81
- - **Table Formatting**: Tables are inspected for mismatched column counts between the header, the separator line, and the data rows. This check prevents common table rendering failures.
83
+ Broken links and missing images degrade the user experience. DocSmith performs checks to validate all local resources.
82
84
 
83
- - **Markdown Linting**: A built-in linter enforces a consistent Markdown structure. Key rules include:
85
+ * **Dead Link Detection**: The system scans all relative Markdown links and verifies that the target path corresponds to a valid document defined in the project's documentation structure. This check prevents users from encountering "404 Not Found" errors when navigating the documentation. External links beginning with `http://` or `https://` are not checked.
86
+ * **Local Image Validation**: For all local images included via `![]()`, the validator confirms that the referenced image file exists at the specified path. This ensures that no broken images appear in the final output.
84
87
 
85
- | Rule ID | Description |
86
- |---|---|
87
- | `no-duplicate-headings` | Prevents multiple headings with the same content in the same section. |
88
- | `no-undefined-references` | Ensures all link and image references are defined. |
89
- | `no-unused-definitions` | Flags link or image definitions that are not used. |
90
- | `no-heading-content-indent` | Disallows indentation before heading content. |
91
- | `no-multiple-toplevel-headings` | Allows only one top-level heading (H1) per document. |
92
- | `code-block-style` | Enforces a consistent style for code blocks (e.g., using backticks). |
88
+ ## D2 Diagram Validation
93
89
 
94
- By automating these checks, DocSmith maintains a consistent standard for documentation, ensuring the final output is accurate and navigable.
90
+ To guarantee that all diagrams are rendered correctly, DocSmith validates the syntax of every D2 diagram.
95
91
 
96
- To learn more about the overall architecture, see the [How It Works](./advanced-how-it-works.md) section.
92
+ Each code block marked with `d2` is processed through a strict syntax checker. If any syntax errors are found, the generation process is halted with a descriptive error message. This prevents the publication of documents containing broken or improperly rendered visual diagrams.
@@ -1,96 +1,92 @@
1
1
  # 品質保證
2
2
 
3
- 為確保所有生成的文檔功能正常、清晰且專業,DocSmith 整合了一個自動化的品質保證流程。此流程會在發布前對 Markdown 內容執行一系列檢查,以偵測並報告從斷開的連結到格式錯誤的圖表等常見問題。
3
+ 為確保所有產生的文件都符合高品質、一致性和準確性的標準,DocSmith 內建了一個全面、自動化的品質保證流程。這些內建的檢查會在發布前自動運行,以識別並標記常見的格式錯誤、失效連結和結構性問題。此過程確保最終的輸出成品具備專業性、可靠性,並讓使用者易於瀏覽。
4
4
 
5
- 這個自動化管道會驗證內容結構、連結、媒體和語法,以維持一致的品質標準。
6
-
7
- ```d2
5
+ ```d2 品質保證流程 icon=lucide:shield-check
8
6
  direction: down
9
7
 
10
- Input-Markdown-Content: {
11
- label: "輸入:Markdown 內容"
8
+ Documentation-Content: {
9
+ label: "文件內容"
12
10
  shape: rectangle
13
11
  }
14
12
 
15
- QA-Pipeline: {
16
- label: "QA 管道"
13
+ Quality-Assurance-Pipeline: {
14
+ label: "品質保證流程"
17
15
  shape: rectangle
18
- grid-columns: 1
16
+ grid-columns: 3
19
17
  grid-gap: 50
20
18
 
21
- Structural-Checks: {
22
- label: "結構檢查"
19
+ Markdown-Validation: {
20
+ label: "1. Markdown 與內容驗證\n(基於 remark-lint)"
23
21
  shape: rectangle
24
- grid-columns: 2
25
- Completeness: "確保內容未被截斷"
26
- Code-Blocks: "驗證區塊語法與縮排"
22
+
23
+ Check-1: "有效的 Markdown 語法"
24
+ Check-2: "標題完整性"
25
+ Check-3: "表格格式"
26
+ Check-4: "程式碼區塊完整性"
27
+ Check-5: "內容完整性"
27
28
  }
28
29
 
29
- Content-Validation: {
30
- label: "內容驗證"
30
+ Link-Asset-Validation: {
31
+ label: "2. 連結與資源完整性"
31
32
  shape: rectangle
32
- grid-columns: 2
33
- Link-Integrity: "驗證內部連結"
34
- Image-Paths: "檢查本地圖片是否存在"
35
- Table-Formatting: "匹配欄位數量"
33
+
34
+ Check-6: "失效連結偵測"
35
+ Check-7: "本地圖片驗證"
36
36
  }
37
37
 
38
- Syntax-Validation: {
39
- label: "語法驗證"
38
+ D2-Diagram-Validation: {
39
+ label: "3. D2 圖表驗證"
40
40
  shape: rectangle
41
- grid-columns: 2
42
- D2-Diagrams: "驗證 D2 語法"
43
- Markdown-Linting: "強制執行樣式規則"
41
+
42
+ Check-8: "D2 語法檢查"
44
43
  }
45
44
  }
46
45
 
47
- Output-Validated-Content-or-Error-Report: {
48
- label: "輸出:已驗證的內容或錯誤報告"
49
- shape: rectangle
46
+ Validation-Result: {
47
+ label: "所有檢查是否通過?"
48
+ shape: diamond
50
49
  }
51
50
 
52
- Input-Markdown-Content -> QA-Pipeline
53
- QA-Pipeline -> Output-Validated-Content-or-Error-Report
54
- ```
55
-
56
- ### 核心驗證領域
57
-
58
- DocSmith 的品質保證流程涵蓋了幾個關鍵領域,以確保文檔的完整性。
59
-
60
- #### 內容結構與完整性
61
-
62
- DocSmith 執行多項檢查,以確保內容的結構完整性:
51
+ Published-Documentation: {
52
+ label: "已發布的文件"
53
+ shape: rectangle
54
+ style.fill: "#d4edda"
55
+ }
63
56
 
64
- - **不完整的程式碼區塊**:偵測以 ` ``` ` 開啟但未關閉的程式碼區塊。
65
- - **缺少換行符**:識別出現在單一行上的內容,這可能表示缺少換行符。
66
- - **內容結尾**:驗證內容是否以適當的標點符號(例如 `.`、`)`、`|`、`>`)結尾,以防止輸出被截斷。
67
- - **程式碼區塊縮排**:分析程式碼區塊中不一致的縮排。如果某一行程式碼的縮排少於開頭的 ` ``` ` 標記,可能會導致渲染問題。此檢查有助於維持正確的程式碼呈現。
57
+ Error-Report: {
58
+ label: "錯誤報告"
59
+ shape: rectangle
60
+ style.fill: "#f8d7da"
61
+ }
68
62
 
69
- #### 連結與媒體完整性
63
+ Documentation-Content -> Quality-Assurance-Pipeline: "輸入"
64
+ Quality-Assurance-Pipeline -> Validation-Result: "驗證"
65
+ Validation-Result -> Published-Documentation: "是"
66
+ Validation-Result -> Error-Report: "否"
67
+ ```
70
68
 
71
- - **連結完整性**:文檔中的所有相對連結都會根據文檔結構計畫進行驗證,以防止出現無效連結。這確保了所有內部導覽都能如預期般運作。檢查器會忽略外部連結(以 `http://` 或 `https://` 開頭)和 `mailto:` 連結。
69
+ ## Markdown 與內容結構驗證
72
70
 
73
- - **圖片驗證**:為避免圖片損壞,檢查器會驗證文檔中引用的任何本地圖片檔案是否存在於檔案系統中。它會解析相對和絕對路徑,以確認檔案存在。外部圖片 URL 和資料 URL 不會被檢查。
71
+ 品質保證的基礎是確保核心 Markdown 格式正確且結構健全。DocSmith 採用一個基於 `remark-lint` 的精密 linter,並輔以自訂檢查來捕捉常見的結構性問題。
74
72
 
75
- #### 圖表語法驗證
73
+ 主要的結構和格式檢查包括:
76
74
 
77
- - **D2 圖表**:DocSmith 透過嘗試將程式碼編譯成 SVG 圖片來驗證 D2 圖表語法。此過程能在語法錯誤導致圖形損壞前捕捉到它們。
75
+ * **有效的 Markdown 語法**:遵循標準 Markdown GFM (GitHub Flavored Markdown) 規範。
76
+ * **標題完整性**:偵測同一文件內的重複標題、不正確的標題縮排,以及使用超過一個頂層標題 (H1) 等問題。
77
+ * **表格格式**:驗證表格結構是否正確,特別是檢查標頭、分隔線和資料列之間的欄位數量是否不匹配。
78
+ * **程式碼區塊完整性**:確保所有程式碼區塊都以 ``` 正確地開啟和關閉。它還會檢查程式碼區塊內可能影響渲染結果的不一致縮排。
79
+ * **內容完整性**:一個驗證步驟,透過檢查產生的內容是否以適當的標點符號結尾,來確保內容不會看似被截斷。
78
80
 
79
- #### 格式化與樣式強制執行
81
+ ## 連結與資源完整性
80
82
 
81
- - **表格格式化**:檢查表格的標頭、分隔線和資料行之間的欄位數量是否不匹配。此檢查可防止常見的表格渲染失敗。
83
+ 失效連結和遺失的圖片會降低使用者體驗。DocSmith 會執行檢查以驗證所有本地資源。
82
84
 
83
- - **Markdown 語法檢查**:內建的 linter 強制執行一致的 Markdown 結構。主要規則包括:
85
+ * **失效連結偵測**:系統會掃描所有相對 Markdown 連結,並驗證目標路徑是否對應到專案文件結構中定義的有效文件。此檢查可防止使用者在瀏覽文件時遇到「404 Not Found」錯誤。以 `http://` 或 `https://` 開頭的外部連結則不會被檢查。
86
+ * **本地圖片驗證**:對於所有透過 `![]()` 包含的本地圖片,驗證器會確認所引用的圖片檔案是否存在於指定路徑。這能確保最終的輸出成品中不會出現破損的圖片。
84
87
 
85
- | Rule ID | Description |
86
- |---|---|
87
- | `no-duplicate-headings` | 防止在同一部分中出現內容相同的多個標題。 |
88
- | `no-undefined-references` | 確保所有連結和圖片引用都已定義。 |
89
- | `no-unused-definitions` | 標記未使用的連結或圖片定義。 |
90
- | `no-heading-content-indent` | 不允許在標題內容前縮排。 |
91
- | `no-multiple-toplevel-headings` | 每個文件只允許一個頂層標題 (H1)。 |
92
- | `code-block-style` | 強制執行一致的程式碼區塊樣式(例如,使用反引號)。 |
88
+ ## D2 圖表驗證
93
89
 
94
- 透過自動化這些檢查,DocSmith 維護了文檔的一致標準,確保最終輸出準確且易於導覽。
90
+ 為保證所有圖表都能正確渲染,DocSmith 會驗證每個 D2 圖表的語法。
95
91
 
96
- 若要了解更多關於整體架構的資訊,請參閱 [運作方式](./advanced-how-it-works.md) 部分。
92
+ 每個標記為 `d2` 的程式碼區塊都會經過嚴格的語法檢查器處理。若發現任何語法錯誤,產生過程將會被中止,並顯示一則描述性的錯誤訊息。這可以防止發布含有破損或渲染不當的視覺圖表的文件。
@@ -1,96 +1,92 @@
1
1
  # 质量保证
2
2
 
3
- 为确保所有生成的文档功能正常、清晰且专业,DocSmith 引入了自动化的质量保证流程。该流程在发布前对 Markdown 内容执行一系列检查,以检测和报告常见问题,从损坏的链接到格式错误的图表。
3
+ 为确保所有生成的文档都符合高质量、一致性和准确性的标准,DocSmith 包含一个全面的自动化质量保证流程。这些内置检查会自动运行,以在发布前识别并标记常见的格式错误、断开的链接和结构性问题。此过程保证最终输出专业、可靠且易于用户浏览。
4
4
 
5
- 这个自动化管道会验证内容结构、链接、媒体和语法,以保持一致的质量标准。
6
-
7
- ```d2
5
+ ```d2 质量保证流程 icon=lucide:shield-check
8
6
  direction: down
9
7
 
10
- Input-Markdown-Content: {
11
- label: "输入:Markdown 内容"
8
+ Documentation-Content: {
9
+ label: "文档内容"
12
10
  shape: rectangle
13
11
  }
14
12
 
15
- QA-Pipeline: {
16
- label: "质量保证管道"
13
+ Quality-Assurance-Pipeline: {
14
+ label: "质量保证流程"
17
15
  shape: rectangle
18
- grid-columns: 1
16
+ grid-columns: 3
19
17
  grid-gap: 50
20
18
 
21
- Structural-Checks: {
22
- label: "结构检查"
19
+ Markdown-Validation: {
20
+ label: "1. Markdown 和内容验证\n(基于 remark-lint)"
23
21
  shape: rectangle
24
- grid-columns: 2
25
- Completeness: "确保内容不被截断"
26
- Code-Blocks: "验证块语法和缩进"
22
+
23
+ Check-1: "有效的 Markdown 语法"
24
+ Check-2: "标题完整性"
25
+ Check-3: "表格格式"
26
+ Check-4: "代码块完整性"
27
+ Check-5: "内容完整性"
27
28
  }
28
29
 
29
- Content-Validation: {
30
- label: "内容验证"
30
+ Link-Asset-Validation: {
31
+ label: "2. 链接和资产完整性"
31
32
  shape: rectangle
32
- grid-columns: 2
33
- Link-Integrity: "验证内部链接"
34
- Image-Paths: "检查本地图片是否存在"
35
- Table-Formatting: "匹配列数"
33
+
34
+ Check-6: "死链检测"
35
+ Check-7: "本地图片验证"
36
36
  }
37
37
 
38
- Syntax-Validation: {
39
- label: "语法验证"
38
+ D2-Diagram-Validation: {
39
+ label: "3. D2 图表验证"
40
40
  shape: rectangle
41
- grid-columns: 2
42
- D2-Diagrams: "验证 D2 语法"
43
- Markdown-Linting: "强制执行样式规则"
41
+
42
+ Check-8: "D2 语法检查"
44
43
  }
45
44
  }
46
45
 
47
- Output-Validated-Content-or-Error-Report: {
48
- label: "输出:已验证内容或错误报告"
49
- shape: rectangle
46
+ Validation-Result: {
47
+ label: "所有检查是否通过?"
48
+ shape: diamond
50
49
  }
51
50
 
52
- Input-Markdown-Content -> QA-Pipeline
53
- QA-Pipeline -> Output-Validated-Content-or-Error-Report
54
- ```
55
-
56
- ### 核心验证领域
57
-
58
- DocSmith 的质量保证流程涵盖了几个关键领域,以确保文档的完整性。
59
-
60
- #### 内容结构与完整性
61
-
62
- DocSmith 执行多项检查以确保内容的结构完整性:
51
+ Published-Documentation: {
52
+ label: "已发布的文档"
53
+ shape: rectangle
54
+ style.fill: "#d4edda"
55
+ }
63
56
 
64
- - **不完整的代码块**:检测以 ` ``` ` 开始但未关闭的代码块。
65
- - **缺少换行符**:识别出现在单行上的内容,这可能表示缺少换行符。
66
- - **内容结尾**:验证内容是否以适当的标点符号(例如 `.`、`)`、`|`、`>`)结尾,以防止输出被截断。
67
- - **代码块缩进**:分析代码块中不一致的缩进。如果某行代码的缩进小于起始的 ` ``` ` 标记,可能会导致渲染问题。此检查有助于保持正确的代码呈现。
57
+ Error-Report: {
58
+ label: "错误报告"
59
+ shape: rectangle
60
+ style.fill: "#f8d7da"
61
+ }
68
62
 
69
- #### 链接与媒体完整性
63
+ Documentation-Content -> Quality-Assurance-Pipeline: "输入"
64
+ Quality-Assurance-Pipeline -> Validation-Result: "验证"
65
+ Validation-Result -> Published-Documentation: "是"
66
+ Validation-Result -> Error-Report: "否"
67
+ ```
70
68
 
71
- - **链接完整性**:文档中的所有相对链接都会根据文档结构计划进行验证,以防止出现死链接。这确保了所有内部导航都能正常工作。检查器会忽略外部链接(以 `http://` 或 `https://` 开头)和 `mailto:` 链接。
69
+ ## Markdown 和内容结构验证
72
70
 
73
- - **图片验证**:为避免图片损坏,检查器会验证文档中引用的任何本地图片文件是否存在于文件系统中。它会解析相对路径和绝对路径以确认文件存在。外部图片 URL 和数据 URL 不会被检查。
71
+ 质量保证的基础是确保核心 Markdown 格式良好且结构合理。DocSmith 采用基于 `remark-lint` 的精密 linter,并辅以自定义检查来捕获常见的结构性问题。
74
72
 
75
- #### 图表语法验证
73
+ 关键的结构和格式检查包括:
76
74
 
77
- - **D2 图表**:DocSmith 通过尝试将代码编译成 SVG 图片来验证 D2 图表语法。这个过程可以在语法错误导致图形损坏之前捕获它们。
75
+ * **有效的 Markdown 语法**:遵循标准 Markdown GFM(GitHub Flavored Markdown)规范。
76
+ * **标题完整性**:检测同一文档中重复的标题、不正确的标题缩进以及使用多个顶级标题(H1)等问题。
77
+ * **表格格式**:验证表格结构是否正确,特别是检查表头、分隔行和数据行之间的列数是否不匹配。
78
+ * **代码块完整性**:确保所有代码块都使用 ``` 正确地开始和结束。它还会检查代码块内不一致的缩进,这可能会影响渲染。
79
+ * **内容完整性**:一个验证步骤,通过检查生成的内容是否以适当的标点符号结尾,来确保内容没有被截断。
78
80
 
79
- #### 格式与样式强制执行
81
+ ## 链接和资产完整性
80
82
 
81
- - **表格格式化**:检查表格的表头、分隔线和数据行之间的列数是否不匹配。此检查可防止常见的表格渲染失败。
83
+ 断开的链接和缺失的图片会降低用户体验。DocSmith 会执行检查以验证所有本地资源。
82
84
 
83
- - **Markdown 语法检查**:内置的 linter 会强制执行一致的 Markdown 结构。关键规则包括:
85
+ * **死链检测**:系统会扫描所有相对 Markdown 链接,并验证目标路径是否对应于项目文档结构中定义的有效文档。此检查可防止用户在浏览文档时遇到“404 Not Found”错误。以 `http://` 或 `https://` 开头的外部链接不会被检查。
86
+ * **本地图片验证**:对于所有通过 `![]()` 包含的本地图片,验证器会确认引用的图片文件是否存在于指定路径。这可以确保最终输出中不会出现损坏的图片。
84
87
 
85
- | Rule ID | Description |
86
- |---|---|
87
- | `no-duplicate-headings` | 防止在同一部分中出现内容相同的多个标题。 |
88
- | `no-undefined-references` | 确保所有链接和图片引用都已定义。 |
89
- | `no-unused-definitions` | 标记未被使用的链接或图片定义。 |
90
- | `no-heading-content-indent` | 禁止在标题内容前缩进。 |
91
- | `no-multiple-toplevel-headings` | 每个文档只允许一个顶级标题 (H1)。 |
92
- | `code-block-style` | 强制代码块使用一致的样式(例如,使用反引号)。 |
88
+ ## D2 图表验证
93
89
 
94
- 通过自动化这些检查,DocSmith 为文档维护了一致的标准,确保最终输出准确且易于导航。
90
+ 为保证所有图表都能正确渲染,DocSmith 会验证每个 D2 图表的语法。
95
91
 
96
- 要了解有关整体架构的更多信息,请参阅[工作原理](./advanced-how-it-works.md)部分。
92
+ 每个标记为 `d2` 的代码块都会经过严格的语法检查器处理。如果发现任何语法错误,生成过程将停止并显示描述性错误消息。这可以防止发布包含损坏或渲染不当的可视图表的文档。