hd-garden 0.8.0 → 0.8.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.
- package/.agents/skills/garden-ui/SKILL.md +2 -2
- package/.env.en.example +67 -0
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/app/a2/[slug]/page.tsx +4 -3
- package/app/a2/page.tsx +4 -3
- package/app/about/page.tsx +8 -9
- package/app/admin/page.tsx +7 -6
- package/app/admin/preview/[...path]/page.tsx +2 -1
- package/app/admin/ui/blocks/page.tsx +2 -1
- package/app/admin/ui/catalog/page.tsx +2 -1
- package/app/admin/ui/evals/page.tsx +2 -1
- package/app/admin/ui/page.tsx +2 -1
- package/app/blog/[...path]/page.tsx +7 -6
- package/app/blog/page.tsx +4 -2
- package/app/columns/[column]/[...path]/page.tsx +8 -7
- package/app/columns/page.tsx +12 -8
- package/app/components/AdminUiShell.tsx +4 -3
- package/app/components/ArticleMeasure.tsx +6 -3
- package/app/components/ArticleReferences.tsx +4 -1
- package/app/components/ArticleTags.tsx +3 -2
- package/app/components/BlogArchive.tsx +20 -16
- package/app/components/Comments.tsx +16 -10
- package/app/components/ContentEmptyState.tsx +29 -28
- package/app/components/ExternalEmbed.tsx +15 -14
- package/app/components/GardenContentGuide.tsx +10 -2
- package/app/components/GardenDocsNav.tsx +4 -2
- package/app/components/GiscusComments.tsx +2 -1
- package/app/components/GithubLiveOverview.tsx +10 -8
- package/app/components/GithubProfile.tsx +31 -21
- package/app/components/HandbookLangSwitch.tsx +8 -4
- package/app/components/HandbookView.tsx +92 -9
- package/app/components/MarkdownArticle.tsx +31 -7
- package/app/components/MermaidDiagram.tsx +4 -3
- package/app/components/SiteChrome.tsx +3 -3
- package/app/components/SiteFooter.tsx +1 -1
- package/app/components/SiteHeader.tsx +13 -4
- package/app/components/ThoughtCard.tsx +16 -14
- package/app/components/UiBlock.tsx +3 -2
- package/app/components/Webmentions.tsx +11 -11
- package/app/components/WidgetChart.tsx +8 -6
- package/app/components/garden/FilePreview.tsx +2 -2
- package/app/components/garden/GardenBlock.tsx +7 -0
- package/app/components/garden/GardenFile.tsx +2 -2
- package/app/components/garden/RefDemo.tsx +62 -0
- package/app/components/garden/blocks.tsx +56 -8
- package/app/components/garden/patterns.tsx +497 -0
- package/app/garden/[...slug]/page.tsx +3 -2
- package/app/garden/en/page.tsx +7 -7
- package/app/garden/page.tsx +3 -2
- package/app/globals.css +49 -1
- package/app/lib/a2-meta.ts +26 -3
- package/app/lib/content.ts +2 -2
- package/app/lib/garden-docs-meta.ts +24 -0
- package/app/lib/github-id.mjs +8 -0
- package/app/lib/handbook-switch.mjs +12 -0
- package/app/lib/i18n.ts +401 -2
- package/app/lib/rehype-field-tables.mjs +47 -0
- package/app/lib/remark-a2.mjs +18 -8
- package/app/lib/remark-link-card.mjs +22 -0
- package/app/lib/remark-ref-demos.mjs +42 -0
- package/app/lib/tag-filter.ts +9 -2
- package/app/not-found.tsx +32 -4
- package/app/page.tsx +17 -14
- package/app/rss.xml/route.ts +2 -1
- package/app/styles/a2.css +338 -0
- package/app/styles/shell.css +15 -2
- package/app/tags/page.tsx +7 -5
- package/app/thoughts/[slug]/page.tsx +2 -1
- package/app/thoughts/page/[n]/page.tsx +1 -1
- package/app/thoughts/page.tsx +2 -1
- package/app/ui-parity/page.tsx +38 -22
- package/bin/garden.mjs +129 -19
- package/docs/handbook/ai-writing.md +2 -2
- package/docs/handbook/assets/reading-layout-en.svg +26 -0
- package/docs/handbook/components/card.md +43 -22
- package/docs/handbook/components/chart.md +10 -26
- package/docs/handbook/components/choice.md +42 -0
- package/docs/handbook/components/compare.md +32 -17
- package/docs/handbook/components/figure.md +33 -46
- package/docs/handbook/components/file.md +10 -15
- package/docs/handbook/components/html.md +10 -30
- package/docs/handbook/components/interactive.md +9 -35
- package/docs/handbook/components/list.md +65 -0
- package/docs/handbook/components/relations.md +95 -0
- package/docs/handbook/components/stat.md +10 -28
- package/docs/handbook/components/timeline.md +13 -28
- package/docs/handbook/components.md +210 -19
- package/docs/handbook/config.md +5 -3
- package/docs/handbook/deploy.md +1 -1
- package/docs/handbook/design.md +20 -12
- package/docs/handbook/en/ai-writing.md +2 -2
- package/docs/handbook/en/components/card.md +42 -21
- package/docs/handbook/en/components/chart.md +10 -26
- package/docs/handbook/en/components/choice.md +42 -0
- package/docs/handbook/en/components/compare.md +30 -15
- package/docs/handbook/en/components/figure.md +29 -42
- package/docs/handbook/en/components/file.md +9 -14
- package/docs/handbook/en/components/html.md +9 -29
- package/docs/handbook/en/components/interactive.md +8 -34
- package/docs/handbook/en/components/list.md +65 -0
- package/docs/handbook/en/components/relations.md +95 -0
- package/docs/handbook/en/components/stat.md +9 -27
- package/docs/handbook/en/components/timeline.md +9 -24
- package/docs/handbook/en/components.md +211 -19
- package/docs/handbook/en/config.md +32 -30
- package/docs/handbook/en/deploy.md +12 -12
- package/docs/handbook/en/design.md +19 -12
- package/docs/handbook/en/index.md +2 -2
- package/docs/handbook/en/reference/card.md +85 -0
- package/docs/handbook/en/reference/chart.md +68 -0
- package/docs/handbook/en/reference/choice.md +69 -0
- package/docs/handbook/en/reference/compare.md +59 -0
- package/docs/handbook/en/reference/figure.md +84 -0
- package/docs/handbook/en/reference/file/checklist.md +17 -0
- package/docs/handbook/en/reference/file.md +50 -0
- package/docs/handbook/en/reference/html.md +62 -0
- package/docs/handbook/en/reference/interactive.md +71 -0
- package/docs/handbook/en/reference/list.md +72 -0
- package/docs/handbook/en/reference/relations.md +113 -0
- package/docs/handbook/en/reference/stat.md +60 -0
- package/docs/handbook/en/reference/timeline.md +56 -0
- package/docs/handbook/en/reference.md +26 -0
- package/docs/handbook/en/start.md +2 -2
- package/docs/handbook/en/workflow.md +6 -5
- package/docs/handbook/en/writing.md +3 -2
- package/docs/handbook/index.md +1 -1
- package/docs/handbook/reference/card.md +85 -0
- package/docs/handbook/reference/chart.md +68 -0
- package/docs/handbook/reference/choice.md +69 -0
- package/docs/handbook/reference/compare.md +59 -0
- package/docs/handbook/reference/figure.md +84 -0
- package/docs/handbook/reference/file/checklist.md +17 -0
- package/docs/handbook/reference/file.md +50 -0
- package/docs/handbook/reference/html.md +62 -0
- package/docs/handbook/reference/interactive.md +71 -0
- package/docs/handbook/reference/list.md +72 -0
- package/docs/handbook/reference/relations.md +113 -0
- package/docs/handbook/reference/stat.md +60 -0
- package/docs/handbook/reference/timeline.md +56 -0
- package/docs/handbook/reference.md +26 -0
- package/docs/handbook/start.md +1 -1
- package/docs/handbook/workflow.md +6 -5
- package/docs/handbook/writing.md +3 -2
- package/next.config.ts +6 -0
- package/package.json +2 -1
- package/public/images/garden/ref-card-book.svg +1 -0
- package/public/images/garden/ref-card-lamp.svg +1 -0
- package/scripts/build-content.mjs +37 -16
- package/scripts/favicon-ico.mjs +9 -6
- package/scripts/file-preview.mjs +10 -7
- package/scripts/handbook-allowlist.mjs +18 -0
- package/scripts/handbook-facts.mjs +305 -11
- package/scripts/link-assets.mjs +7 -0
- package/scripts/new-post.mjs +18 -9
- package/scripts/prepare-pages-output.mjs +30 -18
- package/scripts/redirects.mjs +17 -6
- package/templates/garden-blocks.md +67 -0
- package/templates/garden-snippets.plist +61 -0
- package/templates/site/Makefile.en +45 -0
- package/templates/site/README.en.md +15 -0
- package/templates/site/site.config.en.yaml +55 -0
- package/templates/skills-en/garden-interactive-chart/SKILL.md +84 -0
- package/templates/skills-en/garden-interactive-chart/references/shell.html +49 -0
- package/templates/skills-en/garden-interactive-chart/references/style.md +61 -0
- package/templates/skills-en/garden-post-review/SKILL.md +63 -0
- package/templates/skills-en/garden-ui/SKILL.md +118 -0
- package/templates/workflows/pages.en.yml +195 -0
- package/templates/workflows/pages.yml +195 -0
- package/ui/garden/catalog.mjs +205 -4
- package/ui/garden/check.mjs +6 -0
- package/ui/garden/file-block.mjs +8 -7
- package/ui/garden/html-lang.mjs +73 -1
- package/ui/garden/markdown-links.mjs +7 -4
- package/ui/garden/parse.mjs +45 -0
- package/ui/garden/relations.mjs +252 -0
- package/ui/garden/search-index.mjs +6 -4
- package/ui/garden/source-icon.mjs +54 -0
- package/ui/parity-fixtures.mjs +77 -0
- package/ui/preview/dist/garden-ui.esm.js +41 -4
- package/ui/preview/dist/garden-ui.iife.js +41 -4
- package/ui/prompt/rules.md +28 -1
- package/ui/react/components/chart.tsx +1 -1
- package/ui/react/components/display.tsx +1 -1
- package/ui/react/lang.tsx +4 -0
- package/ui/react/parity.tsx +8 -6
- package/worker/index.ts +8 -2
|
@@ -1,30 +1,221 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: 组件总览
|
|
3
3
|
navTitle: 组件总览
|
|
4
|
-
description:
|
|
4
|
+
description: 12 个内置组件的效果预览。
|
|
5
5
|
section: components
|
|
6
6
|
order: 30
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## [知识卡片 · card](/garden/components/card)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
```garden card
|
|
12
|
+
title: SQLite WAL 写入模式
|
|
13
|
+
url: https://www.sqlite.org/wal.html
|
|
14
|
+
meta: 文档说明 · sqlite.org
|
|
15
|
+
description: 把修改先顺序追加到预写日志,读操作继续访问原数据库页,减少读写互斥等待。
|
|
16
|
+
points:
|
|
17
|
+
- 写入只追加到 `-wal` 文件末尾,不需要在事务提交时原地覆盖数据页。
|
|
18
|
+
- 读事务记录当前末尾偏移量即可看到一致快照,不会阻塞并发写入。
|
|
19
|
+
```
|
|
12
20
|
|
|
13
|
-
|
|
14
|
-
| :--- | :--- | :--- | :--- |
|
|
15
|
-
| [知识卡片](/garden/components/card) | ```` ```garden card ```` | 介绍论文、开源项目或模块要点 | 至少填 `description` 或 `points` |
|
|
16
|
-
| [数字指标](/garden/components/stat) | ```` ```garden stat ```` | 并排展示 2~4 组关键数值与单位 | 每项必填 `label` 与 `value` |
|
|
17
|
-
| [并排对比](/garden/components/compare) | ```` ```garden compare ```` | 左右并列对比 2~3 种方案或改动前后差异 | `items` 至少 2 项,每格不超过约 60 字 |
|
|
18
|
-
| [时间线](/garden/components/timeline) | ```` ```garden timeline ```` | 按先后顺序串联排查记录或演进阶段 | `items` 至少 2 项 |
|
|
19
|
-
| [条形图表](/garden/components/chart) | ```` ```garden chart ```` | 用数据绘制比例条形图(自带可展开数据表) | `data` 至少 2 行 |
|
|
20
|
-
| [分区结构图](/garden/components/figure) | ```` ```garden figure ```` | 带分区按钮高亮与说明的 SVG / 图片结构图 | `svg` 或 `image` 二选一 |
|
|
21
|
-
| [嵌入网页片段](/garden/components/html) | ```` ```garden html ```` | 在沙盒 `iframe` 中运行独立 HTML/JS 演示 | `src` 或 `code` 二选一 |
|
|
22
|
-
| [可调公式与参数](/garden/components/interactive) | ```` ```garden interactive ```` | 提供滑杆或单选控件实时计算非平凡公式 | 含输入控件且公式不能是单次乘法 |
|
|
23
|
-
| [文件下载与预览](/garden/components/file) | ```` ```garden file ```` | 提供本地或远程文件下载与页内预览 | `src` 或 `files` 二选一 |
|
|
21
|
+
## [数字指标 · stat](/garden/components/stat)
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
```garden stat
|
|
24
|
+
items:
|
|
25
|
+
- label: 正文列宽
|
|
26
|
+
value: "740"
|
|
27
|
+
unit: px
|
|
28
|
+
caption: 默认阅读列宽度
|
|
29
|
+
- label: 宽图上限
|
|
30
|
+
value: "1040"
|
|
31
|
+
unit: px
|
|
32
|
+
caption: 左右各最多外扩 150px
|
|
33
|
+
- label: 宽表上限
|
|
34
|
+
value: "1340"
|
|
35
|
+
unit: px
|
|
36
|
+
caption: 左右各最多外扩 300px
|
|
37
|
+
```
|
|
26
38
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
## [并排对比 · compare](/garden/components/compare)
|
|
40
|
+
|
|
41
|
+
```garden compare
|
|
42
|
+
items:
|
|
43
|
+
- title: 写一句话说明改了什么
|
|
44
|
+
text: 想法块紧跟在完整代码下面,AI 把它换成 diff,页面合成「代码 / 对比上一版」。
|
|
45
|
+
- title: 手写 diff
|
|
46
|
+
text: 完整代码下面紧跟一段 diff。
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## [时间线 · timeline](/garden/components/timeline)
|
|
50
|
+
|
|
51
|
+
```garden timeline
|
|
52
|
+
items:
|
|
53
|
+
- date: 步骤 1
|
|
54
|
+
title: 同步内容与静态资源
|
|
55
|
+
text: 校验 Front Matter、复制图片附件并生成搜索索引与 RSS。
|
|
56
|
+
- date: 步骤 2
|
|
57
|
+
title: 构建静态站点产物
|
|
58
|
+
text: 把全部路由预渲染到静态目录。
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## [条形图表 · chart](/garden/components/chart)
|
|
62
|
+
|
|
63
|
+
```garden chart
|
|
64
|
+
title: 三种版面区域的宽度上限
|
|
65
|
+
xLabel: 版面区域
|
|
66
|
+
yLabel: 最大宽度
|
|
67
|
+
unit: px
|
|
68
|
+
data:
|
|
69
|
+
- x: 普通正文列
|
|
70
|
+
y: 740
|
|
71
|
+
- x: 宽幅配图区
|
|
72
|
+
y: 1040
|
|
73
|
+
- x: 多列宽表格
|
|
74
|
+
y: 1340
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## [分区结构图 · figure](/garden/components/figure)
|
|
78
|
+
|
|
79
|
+
```garden figure
|
|
80
|
+
svg: |
|
|
81
|
+
<svg viewBox="0 0 560 194" xmlns="http://www.w3.org/2000/svg" font-family="var(--sans)" style="max-width: 380px; margin-inline: auto">
|
|
82
|
+
<rect data-p="sync" x="2" y="4" width="180" height="186" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
|
|
83
|
+
<text data-p="sync" x="92" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">1. garden</text>
|
|
84
|
+
<text data-p="sync" x="92" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">sync</text>
|
|
85
|
+
<text data-p="sync" x="92" y="108" text-anchor="middle" font-size="24" fill="var(--muted)">解析</text>
|
|
86
|
+
<text data-p="sync" x="92" y="137" text-anchor="middle" font-size="24" fill="var(--muted)">Markdown 与</text>
|
|
87
|
+
<text data-p="sync" x="92" y="166" text-anchor="middle" font-size="24" fill="var(--muted)">图片尺寸</text>
|
|
88
|
+
<path d="M183.5 97 H188.5" stroke="var(--muted)" stroke-width="2.5"/>
|
|
89
|
+
<rect data-p="build" x="190" y="4" width="180" height="186" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
|
|
90
|
+
<text data-p="build" x="280" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">2. garden</text>
|
|
91
|
+
<text data-p="build" x="280" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">build</text>
|
|
92
|
+
<text data-p="build" x="280" y="108" text-anchor="middle" font-size="24" fill="var(--muted)">生成静态页面</text>
|
|
93
|
+
<text data-p="build" x="280" y="137" text-anchor="middle" font-size="24" fill="var(--muted)">与搜索索引</text>
|
|
94
|
+
<path d="M371.5 97 H376.5" stroke="var(--muted)" stroke-width="2.5"/>
|
|
95
|
+
<rect data-p="validate" x="378" y="4" width="180" height="186" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
|
|
96
|
+
<text data-p="validate" x="468" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">3. pages:</text>
|
|
97
|
+
<text data-p="validate" x="468" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">validate</text>
|
|
98
|
+
<text data-p="validate" x="468" y="108" text-anchor="middle" font-size="24" fill="var(--muted)">检查导出目录</text>
|
|
99
|
+
</svg>
|
|
100
|
+
parts:
|
|
101
|
+
- id: sync
|
|
102
|
+
label: 1. 同步内容
|
|
103
|
+
text: 扫描正文与附件,生成站点数据。
|
|
104
|
+
- id: build
|
|
105
|
+
label: 2. 构建页面
|
|
106
|
+
text: 预渲染所有页面路由,输出 RSS、sitemap 与搜索文件。
|
|
107
|
+
- id: validate
|
|
108
|
+
label: 3. 导出校验
|
|
109
|
+
text: 确认导出目录结构完整。
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## [嵌入网页片段 · html](/garden/components/html)
|
|
113
|
+
|
|
114
|
+
```garden html
|
|
115
|
+
title: 字符长度小工具
|
|
116
|
+
code: |
|
|
117
|
+
<!doctype html>
|
|
118
|
+
<html lang="zh-CN">
|
|
119
|
+
<head>
|
|
120
|
+
<meta charset="utf-8" />
|
|
121
|
+
<style>
|
|
122
|
+
body { margin: 0; padding: 16px 18px; font: 14px/1.6 system-ui, sans-serif; color: #1b1a18; background: #faf9f5; }
|
|
123
|
+
input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d5d1c8; border-radius: 6px; font: inherit; background: #fff; color: #1b1a18; }
|
|
124
|
+
.meta { margin-top: 10px; color: #6e6b64; font-variant-numeric: tabular-nums; }
|
|
125
|
+
strong { color: #1b1a18; }
|
|
126
|
+
</style>
|
|
127
|
+
</head>
|
|
128
|
+
<body>
|
|
129
|
+
<input id="txt" value="把文章放在自己的 Git 仓库里,推送后自动构建。" aria-label="输入示例文本" />
|
|
130
|
+
<div class="meta">当前字符数:<strong id="count">23</strong> 字</div>
|
|
131
|
+
<script>
|
|
132
|
+
const input = document.getElementById("txt");
|
|
133
|
+
const count = document.getElementById("count");
|
|
134
|
+
input.addEventListener("input", () => { count.textContent = String(input.value.length); });
|
|
135
|
+
</script>
|
|
136
|
+
</body>
|
|
137
|
+
</html>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## [可调公式与参数 · interactive](/garden/components/interactive)
|
|
141
|
+
|
|
142
|
+
```garden interactive #overview-reading
|
|
143
|
+
caption: 示例:按字数和阅读速度估算阅读时间。
|
|
144
|
+
---
|
|
145
|
+
<State words={6000} speed={400} />
|
|
146
|
+
<Let minutes={round(words / speed)} />
|
|
147
|
+
|
|
148
|
+
<Slider bind="words" label="正文字数" min={1000} max={20000} step={500} unit="字" />
|
|
149
|
+
<Slider bind="speed" label="阅读速度" min={200} max={800} step={50} unit="字/分钟" />
|
|
150
|
+
|
|
151
|
+
<Stat label="预计阅读时间" value={minutes} unit="分钟" />
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## [文件下载与预览 · file](/garden/components/file)
|
|
155
|
+
|
|
156
|
+
```garden file
|
|
157
|
+
src: ./components/file/checklist.md
|
|
158
|
+
title: 发布前检查清单
|
|
159
|
+
note: 可点击「预览」在当前页展开阅读,或直接下载原文件
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## [关系图 · relations](/garden/components/relations)
|
|
163
|
+
|
|
164
|
+
```garden relations
|
|
165
|
+
items:
|
|
166
|
+
- title: 选书
|
|
167
|
+
text: 定下这个月读什么
|
|
168
|
+
- title: 共读
|
|
169
|
+
text: 每周读完约定的章节
|
|
170
|
+
- title: 讨论
|
|
171
|
+
text: 见面聊各自的看法
|
|
172
|
+
- title: 复盘
|
|
173
|
+
text: 记下下次要改的地方
|
|
174
|
+
links:
|
|
175
|
+
- from: 1
|
|
176
|
+
to: 2
|
|
177
|
+
- from: 2
|
|
178
|
+
to: 3
|
|
179
|
+
- from: 3
|
|
180
|
+
to: 4
|
|
181
|
+
- from: 4
|
|
182
|
+
to: 1
|
|
183
|
+
- from: 3
|
|
184
|
+
to: 1
|
|
185
|
+
style: dashed
|
|
186
|
+
label: 影响选书
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## [图标列表 · list](/garden/components/list)
|
|
190
|
+
|
|
191
|
+
```garden list
|
|
192
|
+
items:
|
|
193
|
+
- icon: search
|
|
194
|
+
text: 搜索这个月的书名
|
|
195
|
+
- icon: eye
|
|
196
|
+
text: 看了 3 篇书评
|
|
197
|
+
- icon: heart
|
|
198
|
+
text: 收藏了活动页面
|
|
199
|
+
- icon: chat
|
|
200
|
+
text: 在群里问能不能只听不说
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## [选择卡 · choice](/garden/components/choice)
|
|
204
|
+
|
|
205
|
+
```garden choice
|
|
206
|
+
title: 下个月在哪里见面?
|
|
207
|
+
items:
|
|
208
|
+
- icon: idea
|
|
209
|
+
value: ¥40 / 人
|
|
210
|
+
text: 街角咖啡馆,含一杯饮料
|
|
211
|
+
label: 更看重氛围
|
|
212
|
+
reply: 选了咖啡馆。我们会提前订好靠窗的长桌。
|
|
213
|
+
- icon: book
|
|
214
|
+
value: 免费
|
|
215
|
+
text: 社区图书馆活动室,需提前预约
|
|
216
|
+
label: 更看重安静
|
|
217
|
+
reply: 选了图书馆。我们会在月初提交预约。
|
|
218
|
+
none:
|
|
219
|
+
label: 都不合适 / 说不清
|
|
220
|
+
reply: 没关系,我们会在群里再列几个场地。
|
|
221
|
+
```
|
package/docs/handbook/config.md
CHANGED
|
@@ -43,6 +43,8 @@ pages:
|
|
|
43
43
|
thoughts:
|
|
44
44
|
title: 随想
|
|
45
45
|
subtitle: 短笔记、图片和链接。
|
|
46
|
+
# 每屏显示多少条,往下读时自动加载下一屏。默认 10。
|
|
47
|
+
# pageSize: 10
|
|
46
48
|
columns:
|
|
47
49
|
title: 专栏
|
|
48
50
|
subtitle: 按顺序读的一组文章。
|
|
@@ -75,7 +77,7 @@ footer: 持续记录。
|
|
|
75
77
|
| `name` | 站点名称,显示在左上角导航栏、浏览器标题后缀与 RSS 订阅源标题 |
|
|
76
78
|
| `tagline` | 站点副标题 |
|
|
77
79
|
| `description` | 站点简介,用于首页 SEO 描述与 RSS 频道描述 |
|
|
78
|
-
| `locale` | 语言与地区标识,默认写 `zh_CN
|
|
80
|
+
| `locale` | 语言与地区标识,默认写 `zh_CN`(下划线格式);设为 `en_US` 时,全站框架文案(导航、首页、文章列表、文章元信息与永久链接、Giscus 评论提示、标签、专栏、关于页、404 页面、分页、RSS/sitemap 与 meta/og)会在构建时切换为英文 |
|
|
79
81
|
| `url` | 站点的公开完整网址(如 `https://blog.example.com`)。配置后,文章里指向该地址的完整链接会自动按站内链接处理 |
|
|
80
82
|
| `author.name` | 作者署名,显示在文章元信息栏、关于页和页脚 |
|
|
81
83
|
| `author.github` | GitHub 用户名(不要写完整网址),用于拼接 GitHub 主页链接及拉取关于页的公开动态 |
|
|
@@ -107,7 +109,7 @@ footer: 持续记录。
|
|
|
107
109
|
columns:
|
|
108
110
|
- slug: building-in-public
|
|
109
111
|
title: 一个人造产品
|
|
110
|
-
status:
|
|
112
|
+
status: ongoing
|
|
111
113
|
description: 从最小闭环到验证发布的完整记录。
|
|
112
114
|
cover: windowsill-herbs.svg
|
|
113
115
|
posts:
|
|
@@ -120,6 +122,6 @@ columns:
|
|
|
120
122
|
| `slug` | 是 | 专栏标识,只能包含小写字母、数字和连字符,生成路由 `/columns/<slug>/<post>` |
|
|
121
123
|
| `title` | 是 | 专栏名称(同时会显示在 `/blog` 文章列表对应文章的右侧) |
|
|
122
124
|
| `description` | 是 | 专栏简介,显示在 `/columns` 列表卡片上 |
|
|
123
|
-
| `status` | 否 |
|
|
125
|
+
| `status` | 否 | 状态标识:`default`(或不写,显示为「持续更新」)、`ongoing`(「连载中」)、`completed`(「已完结」);旧写法 `持续更新`、`连载中`、`已完结` 仍可识别,其他文字按原样显示 |
|
|
124
126
|
| `cover` | 否 | 专栏封面图路径(相对 `content/covers/`) |
|
|
125
127
|
| `posts` | 是 | 按阅读顺序排列的文章路径列表(相对于 `content/posts/`,不带 `.md` 后缀) |
|
package/docs/handbook/deploy.md
CHANGED
|
@@ -6,7 +6,7 @@ section: getting-started
|
|
|
6
6
|
order: 4
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
默认中文初始化(`npx hd-garden init`)不会自动创建 `.github/workflows/pages.yml`(使用 `--locale en` 或 `--locale en_US` 初始化英文站点时会自动安装英文工作流模板)。发布到 GitHub Pages 时,在站点仓库新建或检查这个文件。同一份工作流同时支持**单个公开仓库**和**私有源码仓库 + 公开页面仓库**两种模式,按 `PAGES_REPOSITORY` 变量是否为空自动切换。
|
|
10
10
|
|
|
11
11
|
下面的工作流和 Garden 仓库自己的 `.github/workflows/pages.yml` 一致,改动只有两处:一是去掉只对 Garden 仓库有用的 `paths-ignore`、`npm run lint` 和 `npm test`;二是 `publish-repository` 任务先装依赖,再用 `npx garden pages:prepare static-site pages-repository` 写入公开仓库(Garden 仓库里直接调用的是同一个脚本 `scripts/prepare-pages-output.mjs`)。`npm ci` 需要仓库里有 `package-lock.json`,第一次 `npm install` 后记得一起提交。
|
|
12
12
|
|
package/docs/handbook/design.md
CHANGED
|
@@ -36,18 +36,26 @@ Garden 的文章页面围绕长文阅读体验做了几项自动化处理。这
|
|
|
36
36
|
```garden figure
|
|
37
37
|
caption: 点击上方按钮查看图片从构建到渲染的三个阶段
|
|
38
38
|
svg: |
|
|
39
|
-
<svg viewBox="0 0
|
|
40
|
-
<rect data-p="sync" x="
|
|
41
|
-
<text data-p="sync" x="
|
|
42
|
-
<text data-p="sync" x="
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
<text data-p="
|
|
50
|
-
<text data-p="
|
|
39
|
+
<svg viewBox="0 0 560 194" xmlns="http://www.w3.org/2000/svg" font-family="var(--sans)" style="max-width: 380px; margin-inline: auto">
|
|
40
|
+
<rect data-p="sync" x="2" y="4" width="180" height="186" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
|
|
41
|
+
<text data-p="sync" x="92" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">1. 构建期</text>
|
|
42
|
+
<text data-p="sync" x="92" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">读取尺寸</text>
|
|
43
|
+
<text data-p="sync" x="92" y="108" text-anchor="middle" font-size="24" fill="var(--muted)">写入 width /</text>
|
|
44
|
+
<text data-p="sync" x="92" y="137" text-anchor="middle" font-size="24" fill="var(--muted)">height 与 --wl</text>
|
|
45
|
+
<path d="M183.5 97 H188.5" stroke="var(--muted)" stroke-width="2.5"/>
|
|
46
|
+
<rect data-p="measure" x="190" y="4" width="180" height="186" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
|
|
47
|
+
<text data-p="measure" x="280" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">2. 客户端</text>
|
|
48
|
+
<text data-p="measure" x="280" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">测量拓宽</text>
|
|
49
|
+
<text data-p="measure" x="280" y="108" text-anchor="middle" font-size="24" fill="var(--muted)">按当前视口</text>
|
|
50
|
+
<text data-p="measure" x="280" y="137" text-anchor="middle" font-size="24" fill="var(--muted)">调整宽图</text>
|
|
51
|
+
<text data-p="measure" x="280" y="166" text-anchor="middle" font-size="24" fill="var(--muted)">与目录</text>
|
|
52
|
+
<path d="M371.5 97 H376.5" stroke="var(--muted)" stroke-width="2.5"/>
|
|
53
|
+
<rect data-p="dark" x="378" y="4" width="180" height="186" rx="16" fill="var(--card)" stroke="var(--rule-strong)" stroke-width="2.5"/>
|
|
54
|
+
<text data-p="dark" x="468" y="42" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">3. 深色衬底</text>
|
|
55
|
+
<text data-p="dark" x="468" y="72" text-anchor="middle" font-size="24" font-weight="600" fill="var(--ink)">与灯箱</text>
|
|
56
|
+
<text data-p="dark" x="468" y="108" text-anchor="middle" font-size="24" fill="var(--muted)">深色垫</text>
|
|
57
|
+
<text data-p="dark" x="468" y="137" text-anchor="middle" font-size="24" fill="var(--muted)">#faf9f5 ·</text>
|
|
58
|
+
<text data-p="dark" x="468" y="166" text-anchor="middle" font-size="24" fill="var(--muted)">点击放大</text>
|
|
51
59
|
</svg>
|
|
52
60
|
parts:
|
|
53
61
|
- id: sync
|
|
@@ -86,8 +86,8 @@ Following the `garden-ui` skill, the Agent replaces that idea fence with a `diff
|
|
|
86
86
|
|
|
87
87
|
When writing components by hand without AI, you can use the templates and snippets shipped in the package:
|
|
88
88
|
|
|
89
|
-
- Every draft created by `make new` includes an HTML comment at the bottom with copy-ready examples for idea fences and all
|
|
90
|
-
- `templates/garden-blocks.md` lists `when` / `whenNot` guidance and copyable templates for every block; macOS, Typora, and Alfred users can import `templates/garden-snippets.plist` to expand `;gidea`, `;gcard`, `;gstat`, `;gcompare`, `;gtimeline`, `;gchart`, `;gfigure`, `;ghtml`, `;ginteractive`, and `;
|
|
89
|
+
- Every draft created by `make new` includes an HTML comment at the bottom with copy-ready examples for idea fences and all 12 components; delete the comment whenever you are done.
|
|
90
|
+
- `templates/garden-blocks.md` lists `when` / `whenNot` guidance and copyable templates for every block; macOS, Typora, and Alfred users can import `templates/garden-snippets.plist` to expand `;gidea`, `;gcard`, `;gstat`, `;gcompare`, `;gtimeline`, `;gchart`, `;gfigure`, `;ghtml`, `;ginteractive`, `;gfile`, `;grel`, `;glist`, and `;gchoice`.
|
|
91
91
|
- The engine repository also ships editor integrations under `editors/vscode`, `editors/typora`, and `editors/obsidian`, and `npx garden ui catalog` generates an offline component catalog at `.garden/ui-catalog.html`.
|
|
92
92
|
|
|
93
93
|
## 7. Optional Standalone Admin
|
|
@@ -7,8 +7,6 @@ order: 31
|
|
|
7
7
|
badge: card
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
Write "add a `card` summarizing the SQLite WAL documentation with a title, link, and three takeaways" inside a `garden` idea block, and the Agent generates the `garden card` block below via the `garden-ui` skill (hand-written syntax follows).
|
|
11
|
-
|
|
12
10
|
```garden card
|
|
13
11
|
title: SQLite Write-Ahead Logging
|
|
14
12
|
url: https://www.sqlite.org/wal.html
|
|
@@ -20,27 +18,50 @@ points:
|
|
|
20
18
|
- Background checkpoints copy log pages back into the main database file in batches once a threshold is reached.
|
|
21
19
|
```
|
|
22
20
|
|
|
21
|
+
- **When to use**: Introducing a paper, open-source project, or subsystem where a link and 2 to 4 numbered points belong together, or listing several tools or references with a takeaway line.
|
|
22
|
+
- **When to skip**: A sentence or two of prose or a `[Title](url){card}` link card is enough.
|
|
23
|
+
|
|
24
|
+
You can tell the AI:
|
|
25
|
+
|
|
23
26
|
````markdown
|
|
27
|
+
```garden
|
|
28
|
+
Summarize the SQLite WAL documentation in a card with a link, a one-sentence summary, and three takeaways.
|
|
29
|
+
```
|
|
30
|
+
````
|
|
31
|
+
|
|
32
|
+
## Multiple Resource Row Cards (`cards`)
|
|
33
|
+
|
|
34
|
+
When you want to list several projects, tools, or references in one block and attach a takeaway line to each, use `cards`:
|
|
35
|
+
|
|
24
36
|
```garden card
|
|
25
|
-
|
|
26
|
-
url: https://
|
|
27
|
-
|
|
28
|
-
description:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
cards:
|
|
38
|
+
- url: https://openlibrary.org/
|
|
39
|
+
title: "Open Library: one page per book"
|
|
40
|
+
description: An open catalogue run by the Internet Archive, with editions and e-book loans.
|
|
41
|
+
image: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'%3E%3Crect width='132' height='132' fill='%23F0EEE6'/%3E%3Crect x='34' y='26' width='64' height='84' rx='6' fill='%23C9B79C'/%3E%3Crect x='34' y='26' width='10' height='84' fill='%238B6A45'/%3E%3Crect x='52' y='44' width='34' height='5' rx='2' fill='%23FAF9F5'/%3E%3Crect x='52' y='54' width='24' height='5' rx='2' fill='%23FAF9F5'/%3E%3C/svg%3E"
|
|
42
|
+
alt: A closed book
|
|
43
|
+
source:
|
|
44
|
+
- https://openlibrary.org/
|
|
45
|
+
takeaway: "**Worth borrowing:** link the book's page when you pick, so everyone reads the same edition."
|
|
46
|
+
- url: https://www.gutenberg.org/
|
|
47
|
+
title: "Project Gutenberg: public-domain e-books"
|
|
48
|
+
description: E-books that have entered the public domain, free to download.
|
|
49
|
+
image: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'%3E%3Crect width='132' height='132' fill='%23E8EEF0'/%3E%3Ccircle cx='66' cy='60' r='30' fill='%239DB7A8'/%3E%3Crect x='30' y='98' width='72' height='8' rx='4' fill='%233F6B55'/%3E%3Crect x='44' y='112' width='44' height='6' rx='3' fill='%239DB7A8'/%3E%3C/svg%3E"
|
|
50
|
+
alt: A desk lamp
|
|
51
|
+
source:
|
|
52
|
+
- https://www.gutenberg.org/
|
|
53
|
+
- https://en.wikipedia.org/wiki/Project_Gutenberg
|
|
54
|
+
takeaway: "**Worth borrowing:** pick a public-domain book now and then, so people without a copy can join at once."
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
You can tell the AI:
|
|
58
|
+
|
|
59
|
+
````markdown
|
|
60
|
+
```garden
|
|
61
|
+
List Open Library and Project Gutenberg as two cards, each with a source link and a takeaway line on what is worth borrowing.
|
|
33
62
|
```
|
|
34
63
|
````
|
|
35
64
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
| Field | Required | Type | Description |
|
|
40
|
-
| :--- | :--- | :--- | :--- |
|
|
41
|
-
| `title` | Recommended | string | Card heading |
|
|
42
|
-
| `url` | No | full URL | External link shown next to the heading |
|
|
43
|
-
| `meta` | No | string | Subtitle or metadata line below the heading |
|
|
44
|
-
| `description` | Either this or `points` | string | Main summary paragraph (supports inline bold and code) |
|
|
45
|
-
| `points` | Either this or `description` | string[] | Numbered list of takeaways below the summary |
|
|
46
|
-
| `source` | No | string or `{ title, url }` | Source attribution in the bottom-right corner |
|
|
65
|
+
## Fields
|
|
66
|
+
|
|
67
|
+
Every field, default, limit and error code is in [Component reference · card](/garden/en/reference/card).
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Bar Chart (chart)
|
|
3
3
|
navTitle: chart
|
|
4
|
-
description: Render proportional horizontal bars
|
|
4
|
+
description: Render proportional horizontal bars with a built-in expandable data table underneath.
|
|
5
5
|
section: components
|
|
6
6
|
order: 35
|
|
7
7
|
badge: chart
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
Write "use `chart` to compare the max widths of the prose column, wide figures, and wide tables" inside a `garden` idea block, and the Agent generates the `garden chart` block below via the `garden-ui` skill (hand-written syntax follows).
|
|
11
|
-
|
|
12
10
|
```garden chart
|
|
13
11
|
title: Max Width by Layout Zone
|
|
14
12
|
xLabel: Layout Zone
|
|
@@ -24,31 +22,17 @@ data:
|
|
|
24
22
|
caption: Click "View data table" below to expand the full numeric table.
|
|
25
23
|
```
|
|
26
24
|
|
|
25
|
+
- **When to use**: Comparing the relative magnitudes of 2 to 8 values that share the same unit.
|
|
26
|
+
- **When to skip**: Numbers change with reader input (use [`interactive`](/garden/en/components/interactive)), or you already have a Markdown table with the same numbers in that section (the chart includes its own expandable table).
|
|
27
|
+
|
|
28
|
+
You can tell the AI:
|
|
29
|
+
|
|
27
30
|
````markdown
|
|
28
|
-
```garden
|
|
29
|
-
|
|
30
|
-
xLabel: Layout Zone
|
|
31
|
-
yLabel: Max Width
|
|
32
|
-
unit: px
|
|
33
|
-
data:
|
|
34
|
-
- x: Prose Column
|
|
35
|
-
y: 740
|
|
36
|
-
- x: Wide Figure Zone
|
|
37
|
-
y: 1040
|
|
38
|
-
- x: Wide Table Zone
|
|
39
|
-
y: 1340
|
|
40
|
-
caption: Click "View data table" below to expand the full numeric table.
|
|
31
|
+
```garden
|
|
32
|
+
Compare the max widths of the prose column, wide figures, and wide tables with a horizontal bar chart.
|
|
41
33
|
```
|
|
42
34
|
````
|
|
43
35
|
|
|
44
|
-
|
|
45
|
-
- **Skip when**: You already have a Markdown table with the same numbers in that section (`chart` includes its own expandable table).
|
|
36
|
+
## Fields
|
|
46
37
|
|
|
47
|
-
|
|
48
|
-
| :--- | :--- | :--- | :--- |
|
|
49
|
-
| `title` | Recommended | string | Chart heading |
|
|
50
|
-
| `data` | Yes | `{ x, y, label? }[]` (at least 2) | Data rows where `x` is the label and `y` is the numeric value |
|
|
51
|
-
| `unit` | No | string | Unit suffix appended when a row does not specify its own `label` |
|
|
52
|
-
| `xLabel` | No | string | Header for the first column of the expandable table |
|
|
53
|
-
| `yLabel` | No | string | Header for the second column of the expandable table |
|
|
54
|
-
| `caption` | No | string | Caption shown below the chart |
|
|
38
|
+
Every field, default, limit and error code is in [Component reference · chart](/garden/en/reference/chart).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Choice Cards (choice)
|
|
3
|
+
navTitle: choice
|
|
4
|
+
description: Present two or three option cards with an icon, headline value, and preference label, plus an optional fallback button and selection reply.
|
|
5
|
+
section: components
|
|
6
|
+
order: 42
|
|
7
|
+
badge: choice
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
```garden choice
|
|
11
|
+
title: Where should we meet next month?
|
|
12
|
+
items:
|
|
13
|
+
- icon: idea
|
|
14
|
+
value: $6 each
|
|
15
|
+
text: Corner café, one drink included
|
|
16
|
+
label: Prefer the atmosphere
|
|
17
|
+
reply: Café it is. We will book the long table by the window.
|
|
18
|
+
- icon: book
|
|
19
|
+
value: Free
|
|
20
|
+
text: Library meeting room, booking needed
|
|
21
|
+
label: Prefer the quiet
|
|
22
|
+
reply: Library it is. We will book the room at the start of the month.
|
|
23
|
+
none:
|
|
24
|
+
label: Neither / not sure
|
|
25
|
+
reply: No problem. We will share a few more venues in the group chat.
|
|
26
|
+
caption: Illustrative only. Venues and prices are made up.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- **When to use**: Offering two or three concrete options where each choice has an icon, a prominent number or price, and a short note.
|
|
30
|
+
- **When to skip**: Choosing an option recalculates a formula or updates a chart; use [`interactive`](/garden/en/components/interactive) instead.
|
|
31
|
+
|
|
32
|
+
You can tell the AI:
|
|
33
|
+
|
|
34
|
+
````markdown
|
|
35
|
+
```garden
|
|
36
|
+
Give readers two venue cards (corner cafe vs. library meeting room) with cost, preference label, selection reply, and a "neither" button underneath.
|
|
37
|
+
```
|
|
38
|
+
````
|
|
39
|
+
|
|
40
|
+
## Fields
|
|
41
|
+
|
|
42
|
+
Every field, default, limit and error code is in [Component reference · choice](/garden/en/reference/choice).
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Side-by-Side Comparison (compare)
|
|
3
3
|
navTitle: compare
|
|
4
|
-
description: Place two or three options side by side to contrast tradeoffs and
|
|
4
|
+
description: Place two or three options side by side to contrast tradeoffs, or stack good and bad practices.
|
|
5
5
|
section: components
|
|
6
6
|
order: 33
|
|
7
7
|
badge: compare
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
Write "use `compare` to contrast describing a code change in one sentence against writing a diff block by hand" inside a `garden` idea block, and the Agent generates the `garden compare` block below via the `garden-ui` skill (hand-written syntax follows).
|
|
11
|
-
|
|
12
10
|
```garden compare
|
|
13
11
|
items:
|
|
14
12
|
- title: Describe the change in one sentence
|
|
@@ -17,22 +15,39 @@ items:
|
|
|
17
15
|
text: Place a diff below full code; alone it raises diff-orphan.
|
|
18
16
|
```
|
|
19
17
|
|
|
18
|
+
- **When to use**: Comparing 2 or 3 options, configurations, or before/after behaviors side by side (up to ~60 characters per cell in side-by-side mode), or stacking anti-patterns and recommended practices.
|
|
19
|
+
- **When to skip**: Comparing more than 3 items or aligning multiple attributes across rows; use a Markdown list or table instead.
|
|
20
|
+
|
|
21
|
+
You can tell the AI:
|
|
22
|
+
|
|
20
23
|
````markdown
|
|
24
|
+
```garden
|
|
25
|
+
Contrast describing a code change in one sentence against writing a diff block by hand.
|
|
26
|
+
```
|
|
27
|
+
````
|
|
28
|
+
|
|
29
|
+
## Good vs. Bad Verdicts (`verdict: good | bad`)
|
|
30
|
+
|
|
31
|
+
When contrasting an anti-pattern with a recommended practice, adding `verdict: bad` or `verdict: good` stacks the items vertically and shows a red cross or green check beside each heading:
|
|
32
|
+
|
|
21
33
|
```garden compare
|
|
22
34
|
items:
|
|
23
|
-
- title:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
- title: A poor question
|
|
36
|
+
verdict: bad
|
|
37
|
+
text: "“Have you read this author's other books? Could you share a review?”"
|
|
38
|
+
- title: A better question
|
|
39
|
+
verdict: good
|
|
40
|
+
text: "“When do you usually read? Would you like to sit in once first?”"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
You can tell the AI:
|
|
44
|
+
|
|
45
|
+
````markdown
|
|
46
|
+
```garden
|
|
47
|
+
Contrast a poor question and a better question when welcoming a newcomer, marked as bad and good examples.
|
|
27
48
|
```
|
|
28
49
|
````
|
|
29
50
|
|
|
30
|
-
|
|
31
|
-
- **Skip when**: Comparing more than 3 items or aligning multiple attributes across rows; use a Markdown table instead.
|
|
51
|
+
## Fields
|
|
32
52
|
|
|
33
|
-
|
|
34
|
-
| :--- | :--- | :--- | :--- |
|
|
35
|
-
| `items` | Yes | array (at least 2) | Options to compare; each entry can also be a `"Title: description"` shorthand string |
|
|
36
|
-
| `items[].title` | Recommended | string | Column heading |
|
|
37
|
-
| `items[].text` | Recommended | string or string[] | Body description for the column |
|
|
38
|
-
| `items[].<customKey>` | No | string or number | Extra key-value pairs rendered as attribute tags along the bottom of the card |
|
|
53
|
+
Every field, default, limit and error code is in [Component reference · compare](/garden/en/reference/compare).
|