hd-garden 0.13.3 → 0.14.2

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 (218) hide show
  1. package/.agents/skills/garden-compose/SKILL.md +24 -0
  2. package/.agents/skills/garden-compose/references/colors.md +11 -0
  3. package/.agents/skills/garden-compose/references/composition-patterns.md +162 -0
  4. package/.agents/skills/garden-compose/references/examples.md +55 -0
  5. package/.agents/skills/garden-compose/references/frames.md +7 -0
  6. package/.agents/skills/garden-compose/references/layout-recipes.md +84 -0
  7. package/.agents/skills/garden-compose/references/rendering-model.md +120 -0
  8. package/.agents/skills/garden-compose/references/static-play.md +19 -0
  9. package/.agents/skills/garden-compose/references/visual-selection.md +38 -0
  10. package/.agents/skills/garden-compose/references/workflow.md +27 -0
  11. package/.agents/skills/garden-compose/scripts/_cli.mjs +12 -0
  12. package/.agents/skills/garden-compose/scripts/apply.mjs +2 -0
  13. package/.agents/skills/garden-compose/scripts/check.mjs +2 -0
  14. package/.agents/skills/garden-compose/scripts/prompt.mjs +2 -0
  15. package/.agents/skills/garden-compose/scripts/scan.mjs +2 -0
  16. package/.agents/skills/garden-post-review/SKILL.md +5 -16
  17. package/Makefile +12 -3
  18. package/README.en.md +10 -5
  19. package/README.md +10 -5
  20. package/app/admin/preview/[...path]/page.tsx +4 -16
  21. package/app/api/admin/ui/blocks/route.ts +1 -1
  22. package/app/components/AdminUiPanels.tsx +6 -3
  23. package/app/components/GardenContentGuide.tsx +7 -8
  24. package/app/components/MarkdownArticle.tsx +2 -0
  25. package/app/components/UiStudio.tsx +29 -32
  26. package/app/components/garden/AuthorRich.tsx +5 -0
  27. package/app/components/garden/ComposePreview.tsx +9 -0
  28. package/app/components/garden/GardenBlock.tsx +12 -10
  29. package/app/components/garden/GardenFile.tsx +1 -1
  30. package/app/components/garden/blocks.tsx +9 -197
  31. package/app/components/garden/file-icons.tsx +1 -1
  32. package/app/components/garden/patterns.tsx +7 -65
  33. package/app/lib/rehype-garden-blocks.mjs +30 -0
  34. package/app/lib/remark-garden.mjs +0 -4
  35. package/app/lib/ui-model.ts +8 -9
  36. package/app/styles/a2.css +17 -1
  37. package/bin/garden.mjs +34 -35
  38. package/docs/handbook/ai-writing.md +19 -22
  39. package/docs/handbook/components/compose.md +16 -7
  40. package/docs/handbook/components/image.md +1 -1
  41. package/docs/handbook/components/link-card.md +2 -2
  42. package/docs/handbook/components.md +5 -213
  43. package/docs/handbook/deploy.md +11 -0
  44. package/docs/handbook/en/ai-writing.md +17 -20
  45. package/docs/handbook/en/components/compose.md +15 -6
  46. package/docs/handbook/en/components/image.md +1 -1
  47. package/docs/handbook/en/components/link-card.md +2 -2
  48. package/docs/handbook/en/components.md +7 -215
  49. package/docs/handbook/en/deploy.md +11 -0
  50. package/docs/handbook/en/index.md +29 -53
  51. package/docs/handbook/en/reference/compose.md +77 -148
  52. package/docs/handbook/en/reference.md +6 -22
  53. package/docs/handbook/en/start.md +1 -1
  54. package/docs/handbook/en/workflow.md +21 -17
  55. package/docs/handbook/en/writing.md +3 -3
  56. package/docs/handbook/index.md +26 -47
  57. package/docs/handbook/reference/compose.md +79 -148
  58. package/docs/handbook/reference.md +6 -22
  59. package/docs/handbook/start.md +1 -1
  60. package/docs/handbook/workflow.md +21 -17
  61. package/docs/handbook/writing.md +3 -3
  62. package/editors/dist/typora/main.js +324 -330
  63. package/editors/dist/typora/style.css +4299 -11
  64. package/editors/dist/vscode/garden-ui-0.14.2.vsix +0 -0
  65. package/eslint.config.mjs +3 -0
  66. package/package.json +5 -3
  67. package/public/images/compose-resources/resource-015b41eb0f32.svg +1 -0
  68. package/public/images/compose-resources/resource-ecee6b47f015.svg +1 -0
  69. package/public/images/compose-resources/resource-fd51121b5e8c.svg +1 -0
  70. package/scripts/build-content.mjs +40 -131
  71. package/scripts/build-ui-preview.mjs +7 -5
  72. package/scripts/check-post.mjs +10 -106
  73. package/scripts/check-site.mjs +80 -0
  74. package/scripts/compose-style-reference.mjs +22 -0
  75. package/scripts/editor-preview-css.mjs +14 -0
  76. package/scripts/file-preview.mjs +1 -1
  77. package/scripts/file-sizes.mjs +7 -7
  78. package/scripts/generated-cache.mjs +36 -0
  79. package/scripts/handbook-facts.mjs +10 -3
  80. package/scripts/image-sizes.mjs +6 -12
  81. package/scripts/link-assets.mjs +35 -10
  82. package/scripts/managed-skills.mjs +56 -0
  83. package/scripts/pack-editors.mjs +12 -1
  84. package/scripts/prepare-pages-output.mjs +1 -1
  85. package/scripts/site-guide.mjs +19 -0
  86. package/scripts/sync-editor-version.mjs +28 -0
  87. package/scripts/ui-cli.mjs +26 -33
  88. package/templates/garden-blocks.md +4 -180
  89. package/templates/garden-snippets.plist +2 -183
  90. package/templates/site/AGENTS.en.md +89 -0
  91. package/templates/site/AGENTS.md +72 -0
  92. package/templates/site/Makefile +12 -3
  93. package/templates/site/Makefile.en +12 -3
  94. package/templates/site/README.en.md +6 -1
  95. package/templates/site/README.md +6 -1
  96. package/templates/skills-en/garden-compose/SKILL.md +24 -0
  97. package/templates/skills-en/garden-post-review/SKILL.md +5 -16
  98. package/templates/workflows/pages.en.yml +11 -0
  99. package/templates/workflows/pages.yml +11 -0
  100. package/ui/compose/compose.css +54 -14
  101. package/ui/compose/contracts.mjs +16 -0
  102. package/ui/compose/dil.mjs +109 -48
  103. package/ui/compose/distribution.mjs +7 -0
  104. package/ui/compose/features.mjs +90 -0
  105. package/ui/compose/icons.mjs +8 -0
  106. package/ui/compose/index.mjs +2 -0
  107. package/ui/compose/inspect.mjs +11 -0
  108. package/ui/compose/markup.mjs +80 -23
  109. package/ui/compose/preview.mjs +13 -0
  110. package/ui/compose/prompt-catalog.mjs +15 -3
  111. package/ui/compose/render.mjs +46 -11
  112. package/ui/compose/scenes.mjs +10 -0
  113. package/ui/core/apply.mjs +12 -45
  114. package/ui/core/catalog.mjs +22 -32
  115. package/ui/core/cli-locale.mjs +8 -18
  116. package/ui/core/color.mjs +34 -0
  117. package/ui/core/compile.mjs +1 -8
  118. package/ui/core/demos.mjs +138 -108
  119. package/ui/core/fence.mjs +14 -70
  120. package/ui/core/fix-prompt.mjs +1 -3
  121. package/ui/core/garden-fence.mjs +3 -63
  122. package/ui/core/index.mjs +3 -5
  123. package/ui/core/parse.mjs +22 -8
  124. package/ui/core/scan.mjs +31 -43
  125. package/ui/core/starters.mjs +3 -3
  126. package/ui/core/static.mjs +36 -6
  127. package/ui/core/transform.mjs +64 -149
  128. package/ui/core/validate.mjs +20 -9
  129. package/ui/garden/article-content.mjs +98 -0
  130. package/ui/garden/catalog.mjs +21 -427
  131. package/ui/garden/check.mjs +18 -60
  132. package/ui/garden/file-block.mjs +1 -1
  133. package/ui/garden/file-paths.mjs +8 -6
  134. package/ui/garden/parse.mjs +19 -182
  135. package/ui/garden/relations.mjs +1 -1
  136. package/ui/garden/snippets.mjs +12 -153
  137. package/ui/garden/source-icon.mjs +17 -9
  138. package/ui/garden/word-count.mjs +16 -85
  139. package/ui/index.mjs +1 -5
  140. package/ui/preview/dist/garden-ui.css +4300 -11
  141. package/ui/preview/dist/garden-ui.esm.js +446 -418
  142. package/ui/preview/dist/garden-ui.iife.js +446 -418
  143. package/ui/preview/index.tsx +31 -98
  144. package/ui/preview/site-config.ts +4 -0
  145. package/ui/prompt/build.mjs +1 -4
  146. package/ui/prompt/recipes/code-walkthrough.md +17 -12
  147. package/ui/prompt/recipes/compare.md +14 -10
  148. package/ui/prompt/recipes/compose.md +3 -3
  149. package/ui/prompt/recipes/converter.md +17 -14
  150. package/ui/prompt/recipes/data-chart.md +9 -8
  151. package/ui/prompt/recipes/inspect-grid.md +9 -8
  152. package/ui/prompt/recipes/param-bench.md +17 -12
  153. package/ui/prompt/recipes/plan.md +4 -3
  154. package/ui/prompt/recipes/stepper.md +18 -16
  155. package/ui/prompt/recipes/trace.md +20 -18
  156. package/ui/prompt/rules.md +26 -133
  157. package/ui/prompt/studio.md +3 -18
  158. package/ui/react/CatalogPage.tsx +19 -21
  159. package/ui/react/recipes.ts +3 -3
  160. package/ui/react/runtime.tsx +23 -2
  161. package/ui/react/ui.css +17 -11
  162. package/vite.config.ts +16 -3
  163. package/.agents/skills/garden-interactive-chart/SKILL.md +0 -84
  164. package/.agents/skills/garden-interactive-chart/references/shell.html +0 -49
  165. package/.agents/skills/garden-interactive-chart/references/style.md +0 -61
  166. package/.agents/skills/garden-ui/SKILL.md +0 -125
  167. package/app/components/UiBlock.tsx +0 -23
  168. package/app/components/WidgetChart.tsx +0 -224
  169. package/app/lib/generated-content.ts +0 -385
  170. package/docs/handbook/components/card.md +0 -67
  171. package/docs/handbook/components/chart.md +0 -38
  172. package/docs/handbook/components/choice.md +0 -42
  173. package/docs/handbook/components/compare.md +0 -53
  174. package/docs/handbook/components/file.md +0 -29
  175. package/docs/handbook/components/html.md +0 -49
  176. package/docs/handbook/components/interactive.md +0 -48
  177. package/docs/handbook/components/list.md +0 -65
  178. package/docs/handbook/components/relations.md +0 -95
  179. package/docs/handbook/components/stat.md +0 -39
  180. package/docs/handbook/components/timeline.md +0 -37
  181. package/docs/handbook/en/components/card.md +0 -67
  182. package/docs/handbook/en/components/chart.md +0 -38
  183. package/docs/handbook/en/components/choice.md +0 -42
  184. package/docs/handbook/en/components/compare.md +0 -53
  185. package/docs/handbook/en/components/file.md +0 -29
  186. package/docs/handbook/en/components/html.md +0 -49
  187. package/docs/handbook/en/components/interactive.md +0 -44
  188. package/docs/handbook/en/components/list.md +0 -65
  189. package/docs/handbook/en/components/relations.md +0 -95
  190. package/docs/handbook/en/components/stat.md +0 -39
  191. package/docs/handbook/en/components/timeline.md +0 -37
  192. package/docs/handbook/en/reference/card.md +0 -85
  193. package/docs/handbook/en/reference/chart.md +0 -68
  194. package/docs/handbook/en/reference/choice.md +0 -69
  195. package/docs/handbook/en/reference/compare.md +0 -59
  196. package/docs/handbook/en/reference/file.md +0 -50
  197. package/docs/handbook/en/reference/html.md +0 -62
  198. package/docs/handbook/en/reference/interactive.md +0 -71
  199. package/docs/handbook/en/reference/list.md +0 -72
  200. package/docs/handbook/en/reference/relations.md +0 -113
  201. package/docs/handbook/en/reference/stat.md +0 -60
  202. package/docs/handbook/en/reference/timeline.md +0 -56
  203. package/docs/handbook/reference/card.md +0 -85
  204. package/docs/handbook/reference/chart.md +0 -68
  205. package/docs/handbook/reference/choice.md +0 -69
  206. package/docs/handbook/reference/compare.md +0 -59
  207. package/docs/handbook/reference/file.md +0 -50
  208. package/docs/handbook/reference/html.md +0 -62
  209. package/docs/handbook/reference/interactive.md +0 -71
  210. package/docs/handbook/reference/list.md +0 -72
  211. package/docs/handbook/reference/relations.md +0 -113
  212. package/docs/handbook/reference/stat.md +0 -60
  213. package/docs/handbook/reference/timeline.md +0 -56
  214. package/editors/dist/vscode/garden-ui-0.1.1.vsix +0 -0
  215. package/templates/skills-en/garden-interactive-chart/SKILL.md +0 -84
  216. package/templates/skills-en/garden-interactive-chart/references/shell.html +0 -49
  217. package/templates/skills-en/garden-interactive-chart/references/style.md +0 -61
  218. package/templates/skills-en/garden-ui/SKILL.md +0 -125
@@ -1,29 +1,13 @@
1
1
  ---
2
2
  title: Component reference
3
- navTitle: Overview
4
- description: Fields, defaults, limits, and error codes for the garden fences.
3
+ navTitle: Component reference
4
+ description: Component reference
5
5
  section: reference
6
6
  order: 0
7
7
  ---
8
8
 
9
- Each page shows the code on the left and the real rendered result on the right; on narrow screens, switch with Preview / Code. For when to use a component, see its usage page.
9
+ Use one `garden compose` fence for article layouts, rich content, semantic scenes and interactive explanations. Select components inside that entry; use ordinary Markdown when it already communicates the idea.
10
10
 
11
- Link cards, source chips, and local images have no field pages. Their usage pages are linked from [Components Overview](/garden/en/components).
12
-
13
- For every component: invalid YAML, or a top-level key the component does not support, reports `garden-yaml` on the whole block; a misspelled fence name reports `garden-name`.
14
-
15
- | Component | Use it for |
16
- | :--- | :--- |
17
- | [`card`](/garden/en/reference/card) | Summarize a paper, repository, or module in a card with metadata and numbered takeaways. |
18
- | [`stat`](/garden/en/reference/stat) | Display 2 to 4 key numbers, units, and short captions side by side. |
19
- | [`compare`](/garden/en/reference/compare) | Place two or three options side by side to contrast tradeoffs, or stack good and bad practices. |
20
- | [`timeline`](/garden/en/reference/timeline) | Order release milestones, incident steps, or build stages along a vertical sequence. |
21
- | [`chart`](/garden/en/reference/chart) | Render proportional horizontal bars with a built-in expandable data table underneath. |
22
- | [`compose`](/garden/en/reference/compose) | Draw an explanation diagram of cards, arrows, and notes. Click a step to open its note. |
23
- | [`compose icons`](/garden/en/reference/compose-icons) | Every named stroke icon: glyph + name, A–Z. |
24
- | [`html`](/garden/en/reference/html) | Run a self-contained HTML, CSS, and JavaScript demo inside a sandboxed iframe. |
25
- | [`interactive`](/garden/en/reference/interactive) | Let readers drag sliders or switches to recalculate formulas and charts in real time. |
26
- | [`file`](/garden/en/reference/file) | Attach one or more files with automatic format and size badges, download links, and inline preview. |
27
- | [`relations`](/garden/en/reference/relations) | Place 3 to 6 elements on an ellipse or around a center node and connect them with solid or dashed, one-way or two-way labeled links. |
28
- | [`list`](/garden/en/reference/list) | Pair line icons with short observations in a compact card, or add headings and multi-paragraph notes for divided steps. |
29
- | [`choice`](/garden/en/reference/choice) | Present two or three option cards with an icon, headline value, and preference label, plus an optional fallback button and selection reply. |
11
+ - [Compose](/garden/en/components/compose)
12
+ - [Compose reference](/garden/en/reference/compose)
13
+ - [Icons](/garden/en/reference/compose-icons)
@@ -93,7 +93,7 @@ make check
93
93
 
94
94
  ## 5. Editor Plugins
95
95
 
96
- To write an interactive component, insert an idea in VS Code, Cursor, or Typora, preview it, open the catalog, and let the `garden-ui` skill compile it. The plugins ship inside `hd-garden`. You do not compile them yourself.
96
+ To write an interactive component, insert an idea in VS Code, Cursor, or Typora, preview it, open the catalog, and let the `garden-compose` skill compile it. The plugins ship inside `hd-garden`. You do not compile them yourself.
97
97
 
98
98
  `npx hd-garden init` copies the files to `.garden/editors/`. An interactive terminal asks whether to install VS Code / Cursor and whether to install Typora. The first `npx garden sync` asks again if that prompt has not happened yet. With no TTY, `CI=1`, or `GARDEN_SKIP_EDITORS=1`, Garden only prints the hint. Install later with:
99
99
 
@@ -38,25 +38,20 @@ Three commands check your content at different scopes:
38
38
 
39
39
  | Code | Severity | Cause and Fix |
40
40
  | :--- | :--- | :--- |
41
- | `missing-title` / `missing-description` | Error | Front Matter is missing a non-empty `title` or `description` |
41
+ | `missing-title` / `invalid-description` | Error | The title is missing or empty, or description is neither a string nor null; a blank description is valid |
42
42
  | `unexpected-slug` | Error | Front Matter includes a manual `slug` field (remove `slug`; the filename is the slug) |
43
43
  | `date-format` | Error | `date` is not a valid `YYYY-MM-DD`, `YYYY-MM-DD HH:mm:ss`, or ISO timestamp with timezone |
44
- | `missing-cover` / `missing-asset` | Error | A local file referenced by `cover`, a Markdown image, or `garden file` does not exist |
44
+ | `missing-cover` / `missing-asset` | Error | A local file referenced by `cover`, a Markdown image, or Compose `file` does not exist |
45
45
  | `heading-h1` / `heading-skip` | Error | The post body uses an `#` H1 heading or skips a heading level (such as jumping from `##` to `####`) |
46
46
  | `reference-heading` | Error | The post body contains a references section heading (move references to the `references` Front Matter list) |
47
47
  | `callout-type` | Error | `> [!TYPE]` uses an unsupported callout type |
48
48
  | `title-split` | Warning | The title contains a split delimiter with an empty left or right side |
49
49
  | `diff-orphan` | Error | A `diff` code fence is not immediately preceded by a complete code block |
50
- | `legacy-fence` | Error | Uses a legacy fence name (such as `garden:stat`, `widget`, `embed`, or `html garden`); replace with `garden <name>` |
51
- | `garden-idea` | Error | A non-draft post still contains an uncompiled `garden` idea fence |
52
50
  | `compose-uncompiled` | Error | A non-draft `garden compose` fence is still prose, not markup |
53
51
  | `compose-invalid` | Error | A `garden compose` document is invalid: unknown tag, unclosed tag, or a YAML slot tree |
54
- | `garden-name` | Error | Unknown `garden` component name (`card`, `stat`, `compare`, `timeline`, `chart`, `compose`, `html`, `interactive`, `file`, `relations`, `list`, `choice`) |
55
- | `garden-yaml` | Error | Invalid YAML syntax, wrong top-level shape, or unsupported keys inside a `garden` fence |
56
- | `garden-relations` | Error | `garden relations` has fewer than 3 or more than 6 elements, or invalid `links` entries (use a `mermaid` flowchart for larger or branching diagrams, or `garden list` for one-pass steps) |
57
- | `garden-file` / `file-outside` | Error | `garden file` manually sets `resolved`, is missing a valid `src` / `files`, or points outside `content/` |
58
- | `file-large` | Warning | A local file referenced by `garden file` exceeds `5 MB` |
59
- | `compare-long` | Error | A single side-by-side cell in `garden compare` exceeds roughly 60 characters (does not apply when `verdict` is used) |
52
+ | `garden-name` | Error | Author component fences must use `garden compose`. |
53
+ | `compose-file` / `file-outside` | Error | Compose `file` manually sets `resolved`, is missing a valid `src` / `files`, or points outside `content/` |
54
+ | `file-large` | Warning | A local file referenced by Compose `file` exceeds `5 MB` |
60
55
  | `interactive-trivial` / `steps-prose` | Error | `garden compose` only computes a single multiplication, or `<Steps>` contains only prose without state changes |
61
56
 
62
57
  ## 3. Git Pre-commit Hook and Component Catalog
@@ -77,15 +72,14 @@ Garden provides three ways to insert or generate components quickly:
77
72
  1. **Draft cheat sheet comment**: Running `make new SLUG=xxx TITLE="..."` appends an HTML comment to the bottom of the new `.md` file with examples for idea fences and the built-in components. HTML comments are hidden from the rendered page and can be deleted when finished.
78
73
  2. **Snippet template files**: The `templates/` directory inside `hd-garden` includes two template files:
79
74
  - `templates/garden-blocks.md`: Copyable Markdown templates for idea fences and the built-in components.
80
- - `templates/garden-snippets.plist`: macOS text replacements (drag into **System Settings → Keyboard → Text Replacements**) with triggers `;gidea`, `;gcard`, `;gstat`, `;gcompare`, `;gtimeline`, `;gchart`, `;gcompose`, `;ghtml`, `;ginteractive`, `;gfile`, `;grel`, `;glist`, and `;gchoice`. `;gcompose` expands to a `garden compose` fence with one sentence. The others expand to their fences.
81
- 3. **Install AI Agent skills (`npx garden skill`)**: Running `npx garden skill` in a site repository (also run automatically during `npx hd-garden init`) copies three skills into `.agents/skills/`:
82
- - `garden-ui`: Compiles natural-language `garden` idea fences into concrete component blocks.
83
- - `garden-interactive-chart`: Authors `interactive`, `chart`, `compose`, and `html` components from article data.
75
+ - `templates/garden-snippets.plist`: one Compose author entry; choose components inside the scene.
76
+ 3. **Install AI Agent skills (`npx garden skill`)**: Running `npx garden skill` in a site repository (also run automatically during `npx hd-garden init`) copies two skills into `.agents/skills/`:
77
+ - `garden-compose`: Compiles natural-language `garden` idea fences into concrete component blocks.
84
78
  - `garden-post-review`: Reviews an entire post against layout and component rules.
85
79
 
86
80
  ## 5. VS Code, Cursor, and Typora Plugins
87
81
 
88
- The Intelligent UI plugins are the editor entry point for interactive components: insert a one-sentence idea, preview it, open the catalog, then hand compilation to the `garden-ui` skill. They ship inside `hd-garden`. A site does not compile `editors/vscode` or `editors/typora` from source.
82
+ The Intelligent UI plugins are the editor entry point for interactive components: insert a one-sentence idea, preview it, open the catalog, then hand compilation to the `garden-compose` skill. They ship inside `hd-garden`. A site does not compile `editors/vscode` or `editors/typora` from source.
89
83
 
90
84
  ### Install
91
85
 
@@ -110,7 +104,7 @@ The Obsidian plugin is not installed by this command.
110
104
 
111
105
  ### Use the plugins while writing
112
106
 
113
- 1. **Insert an idea.** In VS Code / Cursor, use `Cmd+Alt+I` on macOS or `Ctrl+Alt+I` on Windows and Linux, or the Garden insert command. In Typora, type `/` and choose `/garden` (the next list has a small preview image on each row), or use the insert command to open the component list directly; Windows and Linux default to `Ctrl+Alt+I`. On macOS, record a shortcut under Settings, Keyboard Shortcuts, because Option rewrites the key. The insertion is a plain `garden` fence: a short brief naming the component and the facts to mention, which the `garden-ui` skill compiles later.
107
+ 1. **Insert an idea.** In VS Code / Cursor, use `Cmd+Alt+I` on macOS or `Ctrl+Alt+I` on Windows and Linux, or the Garden insert command. In Typora, type `/` and choose `/garden` (the next list has a small preview image on each row), or use the insert command to open the component list directly; Windows and Linux default to `Ctrl+Alt+I`. On macOS, record a shortcut under Settings, Keyboard Shortcuts, because Option rewrites the key. The insertion is a plain `garden` fence: a short brief naming the component and the facts to mention, which the `garden-compose` skill compiles later.
114
108
  2. **Preview.** Open the Markdown preview. In Typora, move the cursor out of the fence. A `ui` block renders the same component as the blog. An `intent` block renders as an idea card. Clicks on sliders and buttons stay in the preview.
115
109
  3. **Open the catalog.** In VS Code / Cursor, the catalog command inserts a recipe at the cursor. The terminal builds the same page:
116
110
 
@@ -119,4 +113,14 @@ The Obsidian plugin is not installed by this command.
119
113
  ```
120
114
 
121
115
  That writes `.garden/ui-catalog.html`.
122
- 4. **Compile with the skill.** Copy compile prompt. On an English site (`locale: en_US`) the clipboard text is `Compile this post:` plus the post path. Paste it to an Agent that has the `garden-ui` skill. The skill runs `npx garden ui scan`, reads `npx garden ui prompt`, and replaces only that fence with `npx garden ui apply`. The plugin does not call a model. Check the result with `npx garden ui check` or the pre-commit hook.
116
+ 4. **Compile with the skill.** Copy compile prompt. On an English site (`locale: en_US`) the clipboard text is `Compile this post:` plus the post path. Paste it to an Agent that has the `garden-compose` skill. The skill runs `npx garden ui scan`, reads `npx garden ui prompt`, and replaces only that fence with `npx garden ui apply`. The plugin does not call a model. Check the result with `npx garden ui check` or the pre-commit hook.
117
+
118
+
119
+ ## Strict local check
120
+
121
+ Run `make check` to check every article structure and every Compose/UI block in the working tree, including drafts and untracked files. No staging is needed. Both checks run even if structural errors are found, so Compose diagnostics and a short project `garden-compose` skill instruction are still shown. No prompt file is generated by default. No AI call or clipboard copy happens.
122
+
123
+ `make check FILE=content/posts/post.md` limits the content preflight to that file. After preflight succeeds, the existing full-site sync/build stages still run. The engine repository retains its lint/test stages instead. Failure exits nonzero and skips these later stages. This is compilation/validation, not an automatic formatting or repair command.
124
+
125
+
126
+ `make check diff` checks only changed Markdown documents under `content/`: tracked working-tree changes against HEAD (including staged changes) plus untracked files. It reads current working-tree contents, deduplicates paths, uses rename destinations and skips deleted files. It does not run all-site sync/build/lint/tests, even with `make -j check diff`. No changes is a successful no-op; missing Git/HEAD is an explicit error, never an all-content fallback. `garden verify --diff` is the underlying command. Diff mode overrides FILE; plain `make check` is unchanged.
@@ -36,7 +36,7 @@ references:
36
36
  | :--- | :--- | :--- | :--- |
37
37
  | `title` | Yes | String | Post title. Write ` \| ` (with spaces on both sides) to split the heading into two lines and scale the font size to fit |
38
38
  | `date` | Yes | Date string | Publication date (such as `2026-10-18` or an ISO timestamp with timezone) |
39
- | `description` | Yes | String | Summary shown in the article deck, archive lists, and search engine descriptions |
39
+ | `description` | No | String | Summary shown in the article deck, archive lists, and search engine descriptions. Empty (`description: ""`), omitted, null, or whitespace-only values hide the summary; Garden does not substitute an excerpt from the body |
40
40
  | `updated` | No | Date string | Last updated date, shown in the article meta bar and used for RSS sorting |
41
41
  | `publishAt` | No | Date string | Scheduled publish time; included only when earlier than the build time (or when `CONTENT_INCLUDE_DRAFTS=1`) |
42
42
  | `tags` | No | String array | Tags for the post; clicking a tag filters `/blog?t=<tag>` |
@@ -62,12 +62,12 @@ func openStore(path string) (*Store, error) {
62
62
  }
63
63
  ```
64
64
 
65
- ```garden
65
+ ```garden compose
66
66
  Compared with the previous version: open the store with ModeWAL instead of ModeJournal.
67
67
  ```
68
68
  ````
69
69
 
70
- Following the `garden-ui` skill, the Agent runs `npx garden ui apply` to replace that idea fence with a `diff` fence right below the code block (see [Writing with AI](/garden/en/ai-writing)). The page combines the two adjacent blocks into a single code frame with tabs for the full code and the diff against the previous version, while the copy button always copies the new full code:
70
+ Following the `garden-compose` skill, the Agent runs `npx garden ui apply` to replace that idea fence with a `diff` fence right below the code block (see [Writing with AI](/garden/en/ai-writing)). The page combines the two adjacent blocks into a single code frame with tabs for the full code and the diff against the previous version, while the copy button always copies the new full code:
71
71
 
72
72
  ```go
73
73
  func openStore(path string) (*Store, error) {
@@ -13,19 +13,19 @@ Garden 是一个 Claude 风格的博客框架,文章用 Markdown 写,组件
13
13
 
14
14
  ### 1. 作者写一句想法
15
15
 
16
- 在想放交互的地方写一个不带名字的 `garden` 围栏,里面写清想让读者做什么、看到什么:
16
+ 在需要组件的地方写一个 `garden compose` 围栏,里面写清想让读者做什么、看到什么:
17
17
 
18
18
  ````markdown
19
19
  ## 写作节奏
20
20
 
21
- ```garden
21
+ ```garden compose
22
22
  让读者拖动每天写的字数和每周写几天,看写完一篇 8000 字的长文要几周。
23
23
  ```
24
24
  ````
25
25
 
26
26
  ### 2. Agent 扫描并写回组件
27
27
 
28
- 对 Agent 说「编译这篇:content/posts/writing-pace.md」。Agent 按站点里的 `garden-ui` skill 先运行 `npx garden ui scan`,拿到这一块的行号、原话和哈希:
28
+ 对 Agent 说「编译这篇:content/posts/writing-pace.md」。Agent 按站点里的 `garden-compose` skill 先运行 `npx garden ui scan`,拿到这一块的行号、原话和哈希:
29
29
 
30
30
  ```console
31
31
  $ npx garden ui scan content/posts/writing-pace.md
@@ -34,7 +34,7 @@ $ npx garden ui scan content/posts/writing-pace.md
34
34
  "draft": false,
35
35
  "blocks": [
36
36
  {
37
- "lang": "garden-idea",
37
+ "lang": "garden-compose",
38
38
  "status": "uncompiled",
39
39
  "startLine": 9,
40
40
  "intentHash": "cb3a3569",
@@ -52,31 +52,17 @@ $ npx garden ui apply content/posts/writing-pace.md --intent-hash cb3a3569 --fil
52
52
  {"ok":true,"file":"content/posts/writing-pace.md","kind":"garden","line":9}
53
53
  ```
54
54
 
55
- ### 3. 提交前钩子检查并生成修复提示词
55
+ ### 3. 提交前钩子检查并调用修复技能
56
56
 
57
- 首次运行 `garden sync` 或 `garden dev` 时,Garden 会在 `.git/hooks/pre-commit` 写入 `exec npx --no-install garden ui check --staged --quiet`。如果作者在第 2 步之前直接提交,钩子会拦下提交,并打印一段可以直接粘贴给 AI 的修复提示词:
57
+ 首次运行 `garden sync` 或 `garden dev` 时,Garden 会在 `.git/hooks/pre-commit` 写入 `exec npx --no-install garden ui check --staged --quiet`。如果作者在第 2 步之前直接提交,钩子会拦下提交,并显示诊断和调用项目技能的短指令:
58
58
 
59
59
  ```console
60
60
  $ git commit -m "写作节奏"
61
- content/posts/writing-pace.md:9 - garden-idea 还有没编译的想法
62
-
63
- ──────────────────────── 发给 AI 的修复提示词 ────────────────────────
64
- 请处理下面 Garden 博文里列出的块:没编译的想法要编译,有错误的交互块要修好。
65
-
66
- 要求:
67
- - 先运行 npx garden ui prompt,读组件目录和规则;仓库里有 garden-ui skill 时按它的流程做。
68
- - 只改列出的块,用 npx garden ui apply <稿件> --id <id> 写回(没有 id 的想法用 --intent-hash),不要直接编辑稿件。
69
- - 不改作者原话的意思。改完运行 npx garden ui check <稿件>,直到通过。
70
- - 如果你不能访问这个仓库,就只回复每块修好后的完整围栏。
71
-
72
- 1. content/posts/writing-pace.md,第 9–11 行,intent-hash: cb3a3569
73
- - garden-idea:这段想法还没编译,请按原话编译成 garden compose 或其他 garden 组件(或判断后写回正文)。
74
- (后面附当前围栏原文)
75
- ────────────────────────────────────────────────────────────
76
- 已写入 .garden/ui-fix-prompt.md。确实要先提交,可以用 git commit --no-verify。
61
+ content/posts/writing-pace.md:9 - compose-uncompiled 还有没编译的 compose 想法
62
+ 请调用 garden-compose skill(.agents/skills/garden-compose/SKILL.md),修复以上错误块后重新校验。
77
63
  ```
78
64
 
79
- 这段提示词同时写入 `.garden/ui-fix-prompt.md`,有剪贴板命令时自动复制。把提示词贴给 Agent 完成转换后再提交,钩子静默通过(退出码 `0`)。
65
+ 终端只显示诊断和一条指向项目 `garden-compose` skill 的短指令;默认不写文件、不复制剪贴板、不输出原文或组件目录。修复后钩子静默返回 `0`。
80
66
 
81
67
  ### 4. 页面渲染结果
82
68
 
@@ -87,18 +73,23 @@ caption: 每天多写几百字,比每周多写一天更快。
87
73
  intent: |
88
74
  让读者拖动每天写的字数和每周写几天,看写完一篇 8000 字的长文要几周。
89
75
  ---
90
- <State daily={500} days={3} />
91
- <Let weekly={daily * days} />
92
- <Let weeks={ceil(8000 / weekly)} />
76
+ {@body const [daily, setDaily] = DIL.useState(500)}
77
+ {@body const [days, setDays] = DIL.useState(3)}
78
+ {@body const weekly = daily * days}
79
+ {@body const weeks = ceil(8000 / weekly)}
93
80
 
94
- <Slider bind="daily" label="每天写" min={200} max={2000} step={100} unit="字" />
95
- <Slider bind="days" label="每周写" min={1} max={7} step={1} unit="天" />
96
81
 
97
- <Stat label="写完 8000 字需要" value={weeks} unit="周" hint="不足一周按一周算" />
82
+
83
+
84
+ <slider bind="daily" label="每天写" min={200} max={2000} step={100} unit="字" />
85
+ <slider bind="days" label="每周写" min={1} max={7} step={1} unit="天" />
86
+
87
+ <stat label="写完 8000 字需要" value={weeks} unit="周" hint="不足一周按一周算" />
88
+
98
89
  ```
99
90
 
100
91
  > [!IMPORTANT] 人和 Agent 用同一套工具
101
- > Agent 找块用的 `npx garden ui scan`、写回用的 `npx garden ui apply`、自查用的 `npx garden ui check`,和作者提交时 pre-commit 钩子运行的检查是同一组命令。钩子拦截时打印的提示词,就是发给 Agent 的下一步指令。详见 [用 AI 写作](/garden/ai-writing)。
92
+ > Agent 找块用的 `npx garden ui scan`、写回用的 `npx garden ui apply`、自查用的 `npx garden ui check`,和作者提交时 pre-commit 钩子运行的检查是同一组命令。钩子拦截时给出的技能调用短指令,就是发给 Agent 的下一步。详见 [用 AI 写作](/garden/ai-writing)。
102
93
 
103
94
  下面几节介绍不用 Agent 也会自动生效的版面与组件规则。
104
95
 
@@ -148,25 +139,13 @@ pages:
148
139
 
149
140
  ## 在文章里嵌入结构化组件
150
141
 
151
- 需要数字、对比、时间线或图表时,用 ```` ```garden <name> ```` 围栏插入内置组件。下面是一组 `garden stat`:
152
-
153
- ```garden stat
154
- items:
155
- - label: 正文阅读列
156
- value: "740"
157
- unit: px
158
- caption: 段落、代码块与列表的默认列宽
159
- - label: 宽幅配图区
160
- value: "1040"
161
- unit: px
162
- caption: 截图按像素宽度的一半显示,像素宽度约 2000px 以上时展开到这个宽度
163
- - label: 多列宽表区
164
- value: "1340"
165
- unit: px
166
- caption: 宽表格在桌面端向两侧对称外扩上限
142
+ 需要数字、对比、时间线或图表时,在 `garden compose` 内组合对应组件。下面是一组数值:
143
+
144
+ ```garden compose
145
+ <stack><metric label="正文阅读列" value="740" unit="px" caption="段落、代码块与列表的默认列宽"></metric><metric label="宽幅配图区" value="1040" unit="px" caption="截图按像素宽度的一半显示,像素宽度约 2000px 以上时展开到这个宽度"></metric><metric label="多列宽表区" value="1340" unit="px" caption="宽表格在桌面端向两侧对称外扩上限"></metric></stack>
167
146
  ```
168
147
 
169
- 组件页包括各个 `garden` 围栏,以及链接卡片、来源胶囊和本地图片。说明图是 [compose](/garden/components/compose)。效果见左侧导航的 [组件总览](/garden/components)。
148
+ 组件页以 `garden compose` 为唯一 Garden 作者入口,另含链接卡片、来源胶囊和本地图片。内容、布局和交互在 [compose](/garden/components/compose) 内组合。效果见左侧导航的 [组件总览](/garden/components)。
170
149
 
171
150
  <h2 id="garden-admin-title">从初始化到日常写作</h2>
172
151
 
@@ -1,182 +1,113 @@
1
1
  ---
2
- title: 组件参考 · compose
2
+ title: 组件参考 · Compose
3
3
  navTitle: compose
4
- description: 全部 compose 标签一览、共用 token,以及图标目录入口。
4
+ description: 单一作者入口、可执行渲染契约与验证。
5
5
  section: reference
6
6
  order: 6
7
7
  badge: compose
8
8
  ---
9
9
 
10
- [← 组件参考](/garden/reference) · [用法](/garden/components/compose) · [图标目录](/garden/reference/compose-icons)
10
+ ZH: 统一使用 `garden compose`;以下按真实实现解释组合机制、内容边界与检查方法。完整属性按需运行 `npx garden ui schema`,不复制易过期的目录。
11
11
 
12
- 围栏写 ` ```garden compose `。作者原话放 `<intent>`(不绘制)。未知标签报 `compose-invalid`。
12
+ ## One entry, component selection inside it
13
13
 
14
- 当前 **68** 个标签(见下方目录)。图标 **690** 个名字 —— 见 [图标目录](/garden/reference/compose-icons)。
14
+ Use `garden compose`. Select by the reader's task, not by another fence name:
15
15
 
16
- ## 共用 token
16
+ | Need | Compose structure |
17
+ | :--- | :--- |
18
+ | Reference material and takeaways | `resources/resource`, nested `point`, `reference` |
19
+ | Key results | `metric` with label, value, unit, caption, paragraphs and references |
20
+ | Time or stages | `timeline/event` |
21
+ | Alternatives and verdicts | `compare/item` |
22
+ | Icon-led editorial paragraphs | `icon-list/entry` or a small `icon` beside one shared text container |
23
+ | Download and preview | `files/file` or one `file src="…"` |
24
+ | Connected concepts | `relations/entity/edge`, stable ids; 3–6 entities |
25
+ | Rich selectable cards and replies | `choices/choice-option`, optional `none` option |
26
+ | Discrete bars and exact values | `plot/datum`; expandable data table |
27
+ | Parameter-dependent results | Play declarations, controls, `chart/bar/line`, `pie`, `table` |
28
+ | Article text and useful HTML | `markdown` and `html` content islands |
29
+ | Independent executable illustration | Play `sandbox` with literal html/css/js; isolated offline iframe |
17
30
 
18
- 多数布局标签共用;颜色只走 Garden 主题变量(Claude 纸色)。
31
+ The authoritative, demand-loaded catalog is `npx garden ui schema`: actual semantic fields, Play props/defaults/child contracts, icon names, safe HTML tags/attributes/CSS properties. `npx garden ui prompt` adds working recipes. `styleReference` also extracts current font/layout declarations, selectors, responsive conditions and source order from the installed stylesheets; it reports source defaults, not universal computed values. These are generated from the validators and actual styles; do not maintain a second exhaustive tag list. Static layout normalization is not a universal HTML/CSS API: inspect the normalized tree and output because some unsupported static layout attributes are ignored. Semantic unknown fields fail validation.
19
32
 
20
- | Token | 取值 |
21
- | :--- | :--- |
22
- | `padding` / `gap` | `0`–`4`(4px × n) |
23
- | `background` | `surface` `surface-secondary` `surface-accent` `surface-tip` `surface-muted` `transparent` |
24
- | `radius` | `none` `sm` `md` `lg` `xl` `full` |
25
- | `border` | `subtle` `strong`/`true` `none`/`false` |
26
- | `size` | `sm` `md` `lg` `xl` |
27
- | `tone` | `plain` `accent` `tip` `muted`(callout 另有 `note`/`warn`) |
28
- | `align` | `start` `center` `end` `stretch` |
29
- | `justify`(row) | `start` `center` `end` `between` `around` |
30
- | `wrap`(row) | `wrap` `nowrap` |
33
+ 图表的可运行示例见[Compose 活跃时段图](/garden/components/compose#ui-compose-chart-active-hours)。
31
34
 
32
- ## 高频属性
35
+ ## Relationships → hierarchy → layout → style → actual output
33
36
 
34
- ### `box` / `card`
37
+ First identify what belongs together. A heading and all its paragraphs must share a container. Next choose columns and proportions, then alignments and typography. Only then add surfaces and decorative details.
35
38
 
36
- | 属性 | 说明 |
37
- | :--- | :--- |
38
- | `frame` | `card`(默认)`band` `pill` `text`;也可用糖标签 `<band>` / `<pill>` |
39
- | `padding` `gap` `radius` `border` `background` `size` `align` `tone` `id` `mark` | 共用 token;`mark="shield"` 画盾牌 |
39
+ A static `row` wraps by default. Its direct text/title/stack/card children share available width (`flex: 1 1 0`), whereas an icon is content-sized. A heading placed directly in that row is a sibling column, not the heading of a paragraph below the row. `align="center"` on a row changes more than vertical placement: theme rules also center text. A centered stack propagates text alignment. For an editorial list use explicit start alignment on children of a shared right-hand group; do not center each title independently.
40
40
 
41
- ### `row` / `stack` / `grid`
41
+ Direct `row > stack` has 12px top padding in the current theme. A `group` is a width:100%, min-width:0 vertical container that shrinks beside the fixed icon and reads gap without that contextual padding; use it when icon and heading must begin on the same top line. Explicit `align="start"` survives normalization and emits data-align.
42
42
 
43
- | 属性 | 说明 |
44
- | :--- | :--- |
45
- | `gap` `align` | 共用 |
46
- | `justify` `wrap` | 仅 `row` |
47
- | `cols` | 仅 `grid`,1–6 |
48
- | `span` | 仅 `grid-item`,1–6 |
43
+ Nested paragraphs need separate `text` leaves or an article content island. Two unrelated top-level leaves do not establish a shared right column. Put a full-width divider **between rows**, not inside the right text container, if the rule must span the icon column too. `divider` and `separator` are real primitives, not text lines.
44
+
45
+ ```garden compose
46
+ <figure frame="none">
47
+ <row wrap="nowrap" align="start" gap="4">
48
+ <icon name="book-open" size="xl"/>
49
+ <group gap="2">
50
+ <title align="start">Test heading — not article content</title>
51
+ <text align="start">Explicit test paragraph: the heading and this body share the same right column. Keep the author's complete text; do not shrink or summarize it to fit.</text>
52
+ <text align="start">A second independent test paragraph stays in that column.</text>
53
+ </group>
54
+ </row>
55
+ <divider/>
56
+ <row wrap="nowrap" align="start" gap="4">
57
+ <icon name="users" size="xl"/>
58
+ <group gap="2">
59
+ <title align="start">Second test heading</title>
60
+ <text align="start">Another test body, aligned with its heading rather than spanning the icon column.</text>
61
+ </group>
62
+ </row>
63
+ </figure>
64
+ ```
49
65
 
50
- ### `text` / `title` / `caption`
66
+ For a native editorial list the same relationship is expressed with `icon-list` containing `entry icon="…" title="…"`, and multiple `text` children per entry. Native paragraph children are lowered to text strings: their nested text size/alignment/layout properties are not carried into the native scene. Use a generic layout with text size controls for such precision; do not assume identical nested styling contracts. Native scenes preserve the app's keyboard/selection/detail/file-preview behavior when rendered by the Garden article host. A standalone static export is a readable fallback, not an identical interactive host.
51
67
 
52
- | 属性 | 说明 |
53
- | :--- | :--- |
54
- | `size` `align` | 共用 |
55
- | `tone` | `text`:`plain` `muted` `accent` `tip`。`caption` 固定 muted。 |
68
+ ## Typography and complete-theme context
56
69
 
57
- ### `icon`
70
+ Default body text inherits the **actual article's** family, size and line height. There is no universal pixel baseline. This includes ordinary static text, list bodies and native readable prose; changing the article typography configuration must propagate. Semantic headings, graph labels, values, captions and controls intentionally retain their hierarchy.
58
71
 
59
- | 属性 | 说明 |
72
+ | Element/context | Actual source rule / intentional variation |
60
73
  | :--- | :--- |
61
- | `name` | 必填;须在 [图标目录](/garden/reference/compose-icons) |
62
- | `size` | `sm` `md` `lg` `xl` |
63
- | `inline` | 与文字同行 |
74
+ | Static `text` and `title` | Inherit body size; title weight 600, line height 1.4. `size="sm"` .875em; `lg` 1.125em; `xl` 1.25em. `md` keeps the baseline. |
75
+ | Static outer figure title/caption | Source defaults 18px/14px, not ordinary body; actual cascade still matters. |
76
+ | Static inline caption | Own semantic style; `sm` 11px, `lg` 16px. Not a body substitute. |
77
+ | Native icon-list entry title/body | Title weight 600; body inherits article. Group heading uses `--fs-small`. |
78
+ | Native choice value | 22px; narrow rule 20px. Option body inherits article. |
79
+ | Native relation ring | Compact/context-dependent labels and line clamps; detail prose inherits article. Do not treat a ring label as a long paragraph. |
80
+ | Play components | Query schema defaults and complete theme. Their controls/KPI/graph semantics are not globally changed to body size. |
64
81
 
65
- ## 标签目录
82
+ Use explicit variation only for a meaningful hierarchy. Never shrink body text globally to fit a screenshot or discard facts to avoid wrapping. Inspect actual computed styles with globals → tokens → article theme → shell in the real order, on desktop and narrow widths; base component CSS alone does not prove the final result.
66
83
 
67
- 每组一个迷你样例,下面一张一句话表;不写长文。
84
+ ## Markdown, safe HTML, and execution
68
85
 
69
- ### 布局
70
-
71
- ```garden compose
72
- <row gap={2}><box padding={2} radius="md" border="subtle"><title size="sm">甲</title></box><box padding={2} radius="md" background="surface-accent"><title size="sm">乙</title></box></row>
73
- ```
86
+ `text`, `title` and captions are inline contexts: `**bold**`, `_emphasis_`, backticks, `[links](https://example.com)`, `~~strike~~` and safe inline HTML such as `<u>underline</u>`. `<u>` is HTML, not standard Markdown.
74
87
 
75
- | 标签 | 用途 |
76
- | :--- | :--- |
77
- | `box` | 通用容器;可设 padding / gap / background / radius |
78
- | `card` | box 的卡面别名 |
79
- | `stack` | 竖排 |
80
- | `row` | 横排 |
81
- | `columns` | 多列横排(默认可换行) |
82
- | `grid` | 等分网格;cols 1–6 |
83
- | `grid-item` | 网格格;span 跨列 |
84
- | `group` | 语义分组容器 |
85
- | `field` | 表单项分组 |
86
- | `header` | 页眉区 |
87
- | `footer` | 页脚区 |
88
- | `figure` | 图示区 |
89
- | `prose` | 长文段落区 |
90
- | `divider` | 分隔线(自闭合) |
91
- | `separator` | divider 别名 |
92
- | `spacer` | 空白间距 |
93
- | `band` | 通栏强调条(box frame=band) |
94
- | `pill` | 胶囊(box frame=pill) |
95
-
96
- ### 文字
88
+ Use `markdown` or `html` islands for full paragraphs, lists, headings, blockquotes, code blocks, tables, images, details/summary and other allowlisted article content. The islands share the article Markdown/GFM and safe-HTML renderer; they are not arbitrary component trees. Static text outside islands is a lightweight layout shorthand, **not** the whole article block grammar. Play islands are literal content, not interpolated expressions. Keep state and expressions in Play component nodes outside them.
97
89
 
98
90
  ```garden compose
99
- <stack gap={1}><title size="sm">标题</title><text size="sm">正文</text><caption size="sm">说明</caption><badge>徽标</badge></stack>
100
- ```
91
+ <figure frame="none">
92
+ <markdown>
93
+ ### Explicit test content
101
94
 
102
- | 标签 | 用途 |
103
- | :--- | :--- |
104
- | `title` | 短标题 |
105
- | `text` | 正文 |
106
- | `caption` | 次要说明(默认 muted) |
107
- | `label` | 控件标签 |
108
- | `badge` | 胶囊徽标 |
109
- | `kpi` | 指标数字(自闭合) |
110
- | `stat` | kpi 别名 |
111
- | `icon` | 具名描边图标(自闭合) |
112
- | `callout` | 提示条 |
113
- | `kbd` | 键盘键帽 |
114
- | `link` | 行内链接 |
115
- | `intent` | 作者原话(不绘制) |
116
-
117
- ### 控件
95
+ **Bold**, _emphasis_, `code`, [link](https://example.com), ~~strike~~ and <u>underline</u>.
118
96
 
119
- ```garden compose
120
- <stack gap={2}><row gap={2}><avatar label="甲" size="sm"/><badge>好</badge><kbd>⌘K</kbd></row><list><list-item>一项</list-item><list-item>二项</list-item></list><progress value={40} max={100} label="40%"/></stack>
97
+ - A full Markdown list
98
+ - Another test item
99
+
100
+ <details><summary>Safe HTML details</summary><p>Useful article HTML can coexist with Markdown.</p></details>
101
+ </markdown>
102
+ </figure>
121
103
  ```
122
104
 
123
- | 标签 | 用途 |
124
- | :--- | :--- |
125
- | `button` | 按钮快照 |
126
- | `slider` | 滑杆快照 / play 可调 |
127
- | `progress` | 进度条 |
128
- | `meter` | 计量条 |
129
- | `checkbox` | 复选框快照 |
130
- | `radio` | 单选快照 |
131
- | `toggle` | 开关快照 |
132
- | `switch` | toggle 别名 |
133
- | `input` | 单行输入快照 |
134
- | `textarea` | 多行输入快照 |
135
- | `select` | 下拉快照 |
136
- | `tabs` | 选项卡容器 |
137
- | `tab` | 单个选项卡 |
138
- | `list` | 列表 |
139
- | `list-item` | 列表项 |
140
- | `table` | 表格 |
141
- | `thead` | 表头 |
142
- | `tbody` | 表体 |
143
- | `tr` | 表行 |
144
- | `th` | 表头格 |
145
- | `td` | 表数据格 |
146
- | `image` | 图片 |
147
- | `avatar` | 头像占位 |
148
- | `empty` | 空状态 |
149
- | `option` | 分段选项快照 |
150
-
151
- ### 连接糖
105
+ Safe HTML supports allowlisted local `style` properties, including useful layout and typography; inspect the generated schema for the actual set. Unsupported tags/properties, events, unsafe URLs, executable scripts and network CSS functions report diagnostics. Do not expand the article allowlist into arbitrary execution. An intentional executable demo uses `sandbox` inside the **same Compose entry**, with literal html/css/js and no parent origin access. Sandbox layout is its own document, not inherited article prose.
152
106
 
153
- ```garden compose
154
- <stack align="center" gap={1}><pill>起点</pill><arrow dir="down"/><band tone="accent" align="center"><title size="sm">枢纽</title></band></stack>
155
- ```
107
+ ## Verification levels
156
108
 
157
- | 标签 | 用途 |
158
- | :--- | :--- |
159
- | `arrow` | 箭头 |
160
- | `fan` | 向下分叉箭头 |
161
- | `join` | V 形汇合 |
162
- | `lanes` | 泳道图 |
163
- | `actor` | 泳道角色 |
164
- | `message` | 泳道消息 |
165
- | `steps` | 分步容器 |
166
- | `step` | 一步 |
167
- | `note` | 步骤展开说明 |
168
- | `compare` | 对照卡组 |
169
- | `item` | 对照项 |
170
- | `code` | 代码快照 |
171
- | `pre` | 预格式文本 |
172
-
173
-
174
- ## 图表示例
175
-
176
- 玩法级图表示例(静态八柱、融合权重滑杆)见 [说明图 · compose](/garden/components/compose#ui-compose-chart-active-hours)。
177
-
178
- ## 限制
179
-
180
- - 嵌套约 10 层 / 约 220 节点。
181
- - 只有白话、没有标签时报 `compose-uncompiled`。
182
- - Play(`{@body}`、`{#if}` …)见仓库 `docs/compose-dil.md`;静态围栏里的控件标签画成默认态快照。
109
+ 1. Run `npx garden ui check <file>` (and `npx garden check <file>` for real file paths). Preserve original text/resources and inspect diagnostics.
110
+ 2. Parse/render the actual scene; confirm accepted properties survive normalization and meaningful content appears.
111
+ 3. Inspect the complete-theme render: icon rail fixed, heading and **all** paragraphs share the same right edge/left edge, no centered headings or full-width body beneath a detached icon row, dividers outside rows, no unintended cards/arrows, no horizontal overflow.
112
+ 4. Check desktop and narrow screenshots plus geometry/computed styles; exercise choices, relations, file previews, state updates and sandbox behavior when used.
113
+ 5. A hand-authored passing scene proves engine capability, not that an independent model reliably produces it from a short prompt. Report those claims separately.
@@ -1,29 +1,13 @@
1
1
  ---
2
2
  title: 组件参考
3
- navTitle: 总览
4
- description: garden 围栏组件的字段、默认值、取值限制和报错代码。
3
+ navTitle: 组件参考
4
+ description: 组件参考
5
5
  section: reference
6
6
  order: 0
7
7
  ---
8
8
 
9
- 每页左边是代码,右边是同一段代码渲染出的真实效果;窄屏下用「效果 / 代码」切换。用法和什么时候用,见各组件的用法页。
9
+ 文章布局、富文本、语义场景与交互说明统一使用一个 `garden compose` 围栏。在入口内部选择并组合组件;普通 Markdown 已能表达清楚时不用增加组件。
10
10
 
11
- 链接卡片、来源胶囊和本地图片没有字段页,用法在 [组件总览](/garden/components)。
12
-
13
- 所有组件通用:YAML 语法错误,或顶层出现不支持的键名,整块报 `garden-yaml`;围栏名写错报 `garden-name`。
14
-
15
- | 组件 | 用途 |
16
- | :--- | :--- |
17
- | [`card`](/garden/reference/card) | 介绍一篇论文、一个项目或一组值得参考的公开工具。 |
18
- | [`stat`](/garden/reference/stat) | 把 2~4 个关键数字、单位与一句说明并排摆出来。 |
19
- | [`compare`](/garden/reference/compare) | 把两三种方案左右并列,或把不好的做法与更好的做法上下对照。 |
20
- | [`timeline`](/garden/reference/timeline) | 按时间或阶段顺序排开版本演进、排查经过或关键节点。 |
21
- | [`chart`](/garden/reference/chart) | 把一组算好的数字画成比例条形图,下方自带可展开的数据表。 |
22
- | [`compose`](/garden/reference/compose) | 用卡片、箭头和注释画一张说明图;标签全表与共用 token。 |
23
- | [`compose 图标`](/garden/reference/compose-icons) | 全部具名描边图标:字形 + 名字,按 A–Z 可扫。 |
24
- | [`html`](/garden/reference/html) | 在沙盒中运行一段独立的网页小工具、画布动画或演示。 |
25
- | [`interactive`](/garden/reference/interactive) | 让读者拖动滑杆或切换选项,实时看到公式和图表的计算结果。 |
26
- | [`file`](/garden/reference/file) | 给读者提供一份或一组可下载的文件,支持在当前页展开预览。 |
27
- | [`relations`](/garden/reference/relations) | 把三到六个要素排成环或中心辐射结构,画出谁影响谁、哪些是双向的。 |
28
- | [`list`](/garden/reference/list) | 用线条图标配短句列出几条并列动作,或带小标题列出分步做法。 |
29
- | [`choice`](/garden/reference/choice) | 给出两三个具体选项卡片,读者点选后看到对应的回应。 |
11
+ - [Compose](/garden/components/compose)
12
+ - [Compose reference](/garden/reference/compose)
13
+ - [Icons](/garden/reference/compose-icons)
@@ -93,7 +93,7 @@ make check
93
93
 
94
94
  ## 5. 编辑器插件
95
95
 
96
- 写交互组件时,可以在 VS Code、Cursor 或 Typora 里插入想法、预览组件、打开清单,再把编译交给 `garden-ui` skill。插件随 `hd-garden` 发布,不用自己编译。
96
+ 写交互组件时,可以在 VS Code、Cursor 或 Typora 里插入想法、预览组件、打开清单,再把编译交给 `garden-compose` skill。插件随 `hd-garden` 发布,不用自己编译。
97
97
 
98
98
  `npx hd-garden init` 会把产物放到 `.garden/editors/`。终端可交互时分别询问是否安装 VS Code / Cursor 和 Typora。第一次 `npx garden sync` 如果还没问过,会再问一次。没有 TTY、`CI=1` 或 `GARDEN_SKIP_EDITORS=1` 时只打印提示。之后运行:
99
99