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.
- package/.agents/skills/garden-compose/SKILL.md +24 -0
- package/.agents/skills/garden-compose/references/colors.md +11 -0
- package/.agents/skills/garden-compose/references/composition-patterns.md +162 -0
- package/.agents/skills/garden-compose/references/examples.md +55 -0
- package/.agents/skills/garden-compose/references/frames.md +7 -0
- package/.agents/skills/garden-compose/references/layout-recipes.md +84 -0
- package/.agents/skills/garden-compose/references/rendering-model.md +120 -0
- package/.agents/skills/garden-compose/references/static-play.md +19 -0
- package/.agents/skills/garden-compose/references/visual-selection.md +38 -0
- package/.agents/skills/garden-compose/references/workflow.md +27 -0
- package/.agents/skills/garden-compose/scripts/_cli.mjs +12 -0
- package/.agents/skills/garden-compose/scripts/apply.mjs +2 -0
- package/.agents/skills/garden-compose/scripts/check.mjs +2 -0
- package/.agents/skills/garden-compose/scripts/prompt.mjs +2 -0
- package/.agents/skills/garden-compose/scripts/scan.mjs +2 -0
- package/.agents/skills/garden-post-review/SKILL.md +5 -16
- package/Makefile +12 -3
- package/README.en.md +10 -5
- package/README.md +10 -5
- package/app/admin/preview/[...path]/page.tsx +4 -16
- package/app/api/admin/ui/blocks/route.ts +1 -1
- package/app/components/AdminUiPanels.tsx +6 -3
- package/app/components/GardenContentGuide.tsx +7 -8
- package/app/components/MarkdownArticle.tsx +2 -0
- package/app/components/UiStudio.tsx +29 -32
- package/app/components/garden/AuthorRich.tsx +5 -0
- package/app/components/garden/ComposePreview.tsx +9 -0
- package/app/components/garden/GardenBlock.tsx +12 -10
- package/app/components/garden/GardenFile.tsx +1 -1
- package/app/components/garden/blocks.tsx +9 -197
- package/app/components/garden/file-icons.tsx +1 -1
- package/app/components/garden/patterns.tsx +7 -65
- package/app/lib/rehype-garden-blocks.mjs +30 -0
- package/app/lib/remark-garden.mjs +0 -4
- package/app/lib/ui-model.ts +8 -9
- package/app/styles/a2.css +17 -1
- package/bin/garden.mjs +34 -35
- package/docs/handbook/ai-writing.md +19 -22
- package/docs/handbook/components/compose.md +16 -7
- package/docs/handbook/components/image.md +1 -1
- package/docs/handbook/components/link-card.md +2 -2
- package/docs/handbook/components.md +5 -213
- package/docs/handbook/deploy.md +11 -0
- package/docs/handbook/en/ai-writing.md +17 -20
- package/docs/handbook/en/components/compose.md +15 -6
- package/docs/handbook/en/components/image.md +1 -1
- package/docs/handbook/en/components/link-card.md +2 -2
- package/docs/handbook/en/components.md +7 -215
- package/docs/handbook/en/deploy.md +11 -0
- package/docs/handbook/en/index.md +29 -53
- package/docs/handbook/en/reference/compose.md +77 -148
- package/docs/handbook/en/reference.md +6 -22
- package/docs/handbook/en/start.md +1 -1
- package/docs/handbook/en/workflow.md +21 -17
- package/docs/handbook/en/writing.md +3 -3
- package/docs/handbook/index.md +26 -47
- package/docs/handbook/reference/compose.md +79 -148
- package/docs/handbook/reference.md +6 -22
- package/docs/handbook/start.md +1 -1
- package/docs/handbook/workflow.md +21 -17
- package/docs/handbook/writing.md +3 -3
- package/editors/dist/typora/main.js +324 -330
- package/editors/dist/typora/style.css +4299 -11
- package/editors/dist/vscode/garden-ui-0.14.2.vsix +0 -0
- package/eslint.config.mjs +3 -0
- package/package.json +5 -3
- package/public/images/compose-resources/resource-015b41eb0f32.svg +1 -0
- package/public/images/compose-resources/resource-ecee6b47f015.svg +1 -0
- package/public/images/compose-resources/resource-fd51121b5e8c.svg +1 -0
- package/scripts/build-content.mjs +40 -131
- package/scripts/build-ui-preview.mjs +7 -5
- package/scripts/check-post.mjs +10 -106
- package/scripts/check-site.mjs +80 -0
- package/scripts/compose-style-reference.mjs +22 -0
- package/scripts/editor-preview-css.mjs +14 -0
- package/scripts/file-preview.mjs +1 -1
- package/scripts/file-sizes.mjs +7 -7
- package/scripts/generated-cache.mjs +36 -0
- package/scripts/handbook-facts.mjs +10 -3
- package/scripts/image-sizes.mjs +6 -12
- package/scripts/link-assets.mjs +35 -10
- package/scripts/managed-skills.mjs +56 -0
- package/scripts/pack-editors.mjs +12 -1
- package/scripts/prepare-pages-output.mjs +1 -1
- package/scripts/site-guide.mjs +19 -0
- package/scripts/sync-editor-version.mjs +28 -0
- package/scripts/ui-cli.mjs +26 -33
- package/templates/garden-blocks.md +4 -180
- package/templates/garden-snippets.plist +2 -183
- package/templates/site/AGENTS.en.md +89 -0
- package/templates/site/AGENTS.md +72 -0
- package/templates/site/Makefile +12 -3
- package/templates/site/Makefile.en +12 -3
- package/templates/site/README.en.md +6 -1
- package/templates/site/README.md +6 -1
- package/templates/skills-en/garden-compose/SKILL.md +24 -0
- package/templates/skills-en/garden-post-review/SKILL.md +5 -16
- package/templates/workflows/pages.en.yml +11 -0
- package/templates/workflows/pages.yml +11 -0
- package/ui/compose/compose.css +54 -14
- package/ui/compose/contracts.mjs +16 -0
- package/ui/compose/dil.mjs +109 -48
- package/ui/compose/distribution.mjs +7 -0
- package/ui/compose/features.mjs +90 -0
- package/ui/compose/icons.mjs +8 -0
- package/ui/compose/index.mjs +2 -0
- package/ui/compose/inspect.mjs +11 -0
- package/ui/compose/markup.mjs +80 -23
- package/ui/compose/preview.mjs +13 -0
- package/ui/compose/prompt-catalog.mjs +15 -3
- package/ui/compose/render.mjs +46 -11
- package/ui/compose/scenes.mjs +10 -0
- package/ui/core/apply.mjs +12 -45
- package/ui/core/catalog.mjs +22 -32
- package/ui/core/cli-locale.mjs +8 -18
- package/ui/core/color.mjs +34 -0
- package/ui/core/compile.mjs +1 -8
- package/ui/core/demos.mjs +138 -108
- package/ui/core/fence.mjs +14 -70
- package/ui/core/fix-prompt.mjs +1 -3
- package/ui/core/garden-fence.mjs +3 -63
- package/ui/core/index.mjs +3 -5
- package/ui/core/parse.mjs +22 -8
- package/ui/core/scan.mjs +31 -43
- package/ui/core/starters.mjs +3 -3
- package/ui/core/static.mjs +36 -6
- package/ui/core/transform.mjs +64 -149
- package/ui/core/validate.mjs +20 -9
- package/ui/garden/article-content.mjs +98 -0
- package/ui/garden/catalog.mjs +21 -427
- package/ui/garden/check.mjs +18 -60
- package/ui/garden/file-block.mjs +1 -1
- package/ui/garden/file-paths.mjs +8 -6
- package/ui/garden/parse.mjs +19 -182
- package/ui/garden/relations.mjs +1 -1
- package/ui/garden/snippets.mjs +12 -153
- package/ui/garden/source-icon.mjs +17 -9
- package/ui/garden/word-count.mjs +16 -85
- package/ui/index.mjs +1 -5
- package/ui/preview/dist/garden-ui.css +4300 -11
- package/ui/preview/dist/garden-ui.esm.js +446 -418
- package/ui/preview/dist/garden-ui.iife.js +446 -418
- package/ui/preview/index.tsx +31 -98
- package/ui/preview/site-config.ts +4 -0
- package/ui/prompt/build.mjs +1 -4
- package/ui/prompt/recipes/code-walkthrough.md +17 -12
- package/ui/prompt/recipes/compare.md +14 -10
- package/ui/prompt/recipes/compose.md +3 -3
- package/ui/prompt/recipes/converter.md +17 -14
- package/ui/prompt/recipes/data-chart.md +9 -8
- package/ui/prompt/recipes/inspect-grid.md +9 -8
- package/ui/prompt/recipes/param-bench.md +17 -12
- package/ui/prompt/recipes/plan.md +4 -3
- package/ui/prompt/recipes/stepper.md +18 -16
- package/ui/prompt/recipes/trace.md +20 -18
- package/ui/prompt/rules.md +26 -133
- package/ui/prompt/studio.md +3 -18
- package/ui/react/CatalogPage.tsx +19 -21
- package/ui/react/recipes.ts +3 -3
- package/ui/react/runtime.tsx +23 -2
- package/ui/react/ui.css +17 -11
- package/vite.config.ts +16 -3
- package/.agents/skills/garden-interactive-chart/SKILL.md +0 -84
- package/.agents/skills/garden-interactive-chart/references/shell.html +0 -49
- package/.agents/skills/garden-interactive-chart/references/style.md +0 -61
- package/.agents/skills/garden-ui/SKILL.md +0 -125
- package/app/components/UiBlock.tsx +0 -23
- package/app/components/WidgetChart.tsx +0 -224
- package/app/lib/generated-content.ts +0 -385
- package/docs/handbook/components/card.md +0 -67
- package/docs/handbook/components/chart.md +0 -38
- package/docs/handbook/components/choice.md +0 -42
- package/docs/handbook/components/compare.md +0 -53
- package/docs/handbook/components/file.md +0 -29
- package/docs/handbook/components/html.md +0 -49
- package/docs/handbook/components/interactive.md +0 -48
- package/docs/handbook/components/list.md +0 -65
- package/docs/handbook/components/relations.md +0 -95
- package/docs/handbook/components/stat.md +0 -39
- package/docs/handbook/components/timeline.md +0 -37
- package/docs/handbook/en/components/card.md +0 -67
- package/docs/handbook/en/components/chart.md +0 -38
- package/docs/handbook/en/components/choice.md +0 -42
- package/docs/handbook/en/components/compare.md +0 -53
- package/docs/handbook/en/components/file.md +0 -29
- package/docs/handbook/en/components/html.md +0 -49
- package/docs/handbook/en/components/interactive.md +0 -44
- package/docs/handbook/en/components/list.md +0 -65
- package/docs/handbook/en/components/relations.md +0 -95
- package/docs/handbook/en/components/stat.md +0 -39
- package/docs/handbook/en/components/timeline.md +0 -37
- package/docs/handbook/en/reference/card.md +0 -85
- package/docs/handbook/en/reference/chart.md +0 -68
- package/docs/handbook/en/reference/choice.md +0 -69
- package/docs/handbook/en/reference/compare.md +0 -59
- package/docs/handbook/en/reference/file.md +0 -50
- package/docs/handbook/en/reference/html.md +0 -62
- package/docs/handbook/en/reference/interactive.md +0 -71
- package/docs/handbook/en/reference/list.md +0 -72
- package/docs/handbook/en/reference/relations.md +0 -113
- package/docs/handbook/en/reference/stat.md +0 -60
- package/docs/handbook/en/reference/timeline.md +0 -56
- package/docs/handbook/reference/card.md +0 -85
- package/docs/handbook/reference/chart.md +0 -68
- package/docs/handbook/reference/choice.md +0 -69
- package/docs/handbook/reference/compare.md +0 -59
- package/docs/handbook/reference/file.md +0 -50
- package/docs/handbook/reference/html.md +0 -62
- package/docs/handbook/reference/interactive.md +0 -71
- package/docs/handbook/reference/list.md +0 -72
- package/docs/handbook/reference/relations.md +0 -113
- package/docs/handbook/reference/stat.md +0 -60
- package/docs/handbook/reference/timeline.md +0 -56
- package/editors/dist/vscode/garden-ui-0.1.1.vsix +0 -0
- package/templates/skills-en/garden-interactive-chart/SKILL.md +0 -84
- package/templates/skills-en/garden-interactive-chart/references/shell.html +0 -49
- package/templates/skills-en/garden-interactive-chart/references/style.md +0 -61
- package/templates/skills-en/garden-ui/SKILL.md +0 -125
|
@@ -38,25 +38,20 @@ order: 40
|
|
|
38
38
|
|
|
39
39
|
| 诊断码 | 级别 | 触发原因与修复方法 |
|
|
40
40
|
| :--- | :--- | :--- |
|
|
41
|
-
| `missing-title` / `
|
|
41
|
+
| `missing-title` / `invalid-description` | 错误 | `title` 缺失或为空,或 `description` 不是字符串/空值;摘要可以留空 |
|
|
42
42
|
| `unexpected-slug` | 错误 | Front Matter 中手写了 `slug` 字段(文件名即标识,删掉 `slug`) |
|
|
43
43
|
| `date-format` | 错误 | `date` 不是合法的 `YYYY-MM-DD`、`YYYY-MM-DD HH:mm:ss` 或带时区的 ISO 时间 |
|
|
44
|
-
| `missing-cover` / `missing-asset` | 错误 | `cover` 封面图、正文图片或 `
|
|
44
|
+
| `missing-cover` / `missing-asset` | 错误 | `cover` 封面图、正文图片或 Compose `file` 引用的本地文件不存在 |
|
|
45
45
|
| `heading-h1` / `heading-skip` | 错误 | 正文使用了 `#` 一级标题,或标题层级跳级(例如从 `##` 直接跳到 `####`) |
|
|
46
46
|
| `reference-heading` | 错误 | 正文写了 `## 参考` 或 `## 参考资料` 标题(应改放到 Front Matter 的 `references` 列表) |
|
|
47
47
|
| `callout-type` | 错误 | `> [!TYPE]` 使用了不支持的提示框类型 |
|
|
48
48
|
| `title-split` | 警告 | 标题包含 `丨` 分隔符,但分隔符左边或右边为空(应写成「主题丨副题」) |
|
|
49
49
|
| `diff-orphan` | 错误 | `diff` 代码块前面没有紧挨着的完整代码块 |
|
|
50
|
-
| `legacy-fence` | 错误 | 使用了旧版围栏名(如 `garden:stat`、`widget`、`embed`、`html garden`),需改为 `garden <name>` |
|
|
51
|
-
| `garden-idea` | 错误 | 非草稿文章里还有未编译的空白 `garden` 想法块 |
|
|
52
50
|
| `compose-uncompiled` | 错误 | 非草稿里的 `garden compose` 还是白话,没有编译成标记 |
|
|
53
51
|
| `compose-invalid` | 错误 | `garden compose` 的标记不合法:未知标签、没闭合,或写成了 YAML 槽 |
|
|
54
|
-
| `garden-name` | 错误 |
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `garden-file` / `file-outside` | 错误 | `garden file` 手写了 `resolved`、缺少有效的 `src` / `files`,或本地路径越出了 `content/` 目录 |
|
|
58
|
-
| `file-large` | 警告 | `garden file` 引用的单个本地文件体积超过 `5 MB` |
|
|
59
|
-
| `compare-long` | 错误 | `garden compare` 并排模式下单个对比格的正文超过约 60 字(带 `verdict` 的上下对照不受此限) |
|
|
52
|
+
| `garden-name` | 错误 | 作者组件围栏统一使用 `garden compose`。 |
|
|
53
|
+
| `compose-file` / `file-outside` | 错误 | Compose `file` 手写了 `resolved`、缺少有效的 `src` / `files`,或本地路径越出了 `content/` 目录 |
|
|
54
|
+
| `file-large` | 警告 | Compose `file` 引用的单个本地文件体积超过 `5 MB` |
|
|
60
55
|
| `interactive-trivial` / `steps-prose` | 错误 | `garden compose` 只有一次简单乘法,或步骤只是散文而没有状态变化 |
|
|
61
56
|
|
|
62
57
|
## 3. Git 提交前钩子与组件画廊
|
|
@@ -77,15 +72,14 @@ Garden 通过以下三种方式提供组件模板与智能辅助:
|
|
|
77
72
|
1. **新建文章自动附带速查表**:运行 `make new SLUG=xxx TITLE="..."` 创建文章时,生成的 `.md` 文件底部会自动带有一段 `<!-- 组件速查 ... -->` HTML 注释,列出想法块和各个组件的示例写法,复制需要的那块即可。这段注释不会显示在页面上,写完可以删掉。
|
|
78
73
|
2. **代码片段模板文件**:`hd-garden` 包内的 `templates/` 目录自带两份模板文件:
|
|
79
74
|
- `templates/garden-blocks.md`:想法块和内置组件的可复制 Markdown 模板。
|
|
80
|
-
- `templates/garden-snippets.plist
|
|
81
|
-
3. **安装 AI Agent 技能(`npx garden skill`)**:在站点目录运行 `npx garden skill`(`npx hd-garden init`
|
|
82
|
-
- `garden-
|
|
83
|
-
- `garden-interactive-chart`:根据文章数据编写 `interactive`、`chart`、`compose` 与 `html` 组件。
|
|
75
|
+
- `templates/garden-snippets.plist`: one Compose author entry; choose components inside the scene.
|
|
76
|
+
3. **安装 AI Agent 技能(`npx garden skill`)**:在站点目录运行 `npx garden skill`(`npx hd-garden init` 时也会自动执行),会把两个技能复制到站点根目录下的 `.agents/skills/`:
|
|
77
|
+
- `garden-compose`:把文章里的 Compose 意图编译成同一入口内的布局、内容与交互。
|
|
84
78
|
- `garden-post-review`:按排版与组件规范审阅整篇文章。
|
|
85
79
|
|
|
86
80
|
## 5. VS Code、Cursor 与 Typora 插件
|
|
87
81
|
|
|
88
|
-
Intelligent UI 插件是写交互组件的编辑器入口:插入一句想法、在编辑器里预览、打开组件清单,再把编译交给 `garden-
|
|
82
|
+
Intelligent UI 插件是写交互组件的编辑器入口:插入一句想法、在编辑器里预览、打开组件清单,再把编译交给 `garden-compose` skill。插件随 `hd-garden` 发布,站点不用从 `editors/vscode` 或 `editors/typora` 源码编译。
|
|
89
83
|
|
|
90
84
|
### 安装
|
|
91
85
|
|
|
@@ -110,7 +104,7 @@ Obsidian 插件这一轮不随包安装。
|
|
|
110
104
|
|
|
111
105
|
### 在编辑器里怎么用
|
|
112
106
|
|
|
113
|
-
1. **插入想法。** VS Code / Cursor:macOS 用 `Cmd+Alt+I`,Windows / Linux 用 `Ctrl+Alt+I`,或命令「插入 Garden 块」。Typora:输入 `/` 后选 `/garden`(下一层列表每一项有一张小预览图),或命令「插入 Garden 块」直接打开组件列表(Windows / Linux 默认 `Ctrl+Alt+I`,macOS 请到「设置 → 快捷键」里自己录,因为 Option 会改写按键)。插入的是不带组件名的 `garden` 围栏,正文说明要写成哪种组件、写上哪些事实,交给 `garden-
|
|
107
|
+
1. **插入想法。** VS Code / Cursor:macOS 用 `Cmd+Alt+I`,Windows / Linux 用 `Ctrl+Alt+I`,或命令「插入 Garden 块」。Typora:输入 `/` 后选 `/garden`(下一层列表每一项有一张小预览图),或命令「插入 Garden 块」直接打开组件列表(Windows / Linux 默认 `Ctrl+Alt+I`,macOS 请到「设置 → 快捷键」里自己录,因为 Option 会改写按键)。插入的是不带组件名的 `garden` 围栏,正文说明要写成哪种组件、写上哪些事实,交给 `garden-compose` skill 编译。
|
|
114
108
|
2. **预览。** 打开 Markdown 预览(Typora 里光标离开围栏即可)。`ui` 块画成和博客一样的组件,`intent` 块显示成想法卡片。点滑杆、按钮不会跳回源码。
|
|
115
109
|
3. **看组件清单。** VS Code / Cursor 里用「查看组件清单」,点「用它开始」把配方插进当前稿件。终端里的同一份清单:
|
|
116
110
|
|
|
@@ -119,4 +113,14 @@ Obsidian 插件这一轮不随包安装。
|
|
|
119
113
|
```
|
|
120
114
|
|
|
121
115
|
生成 `.garden/ui-catalog.html`。
|
|
122
|
-
4. **交给 skill 编译。** 「复制编译提示词」在中文站点得到 `编译这篇:<相对路径>`,在 `locale: en_US` 的站点得到 `Compile this post: <相对路径>`。把这句话发给装了 `garden-
|
|
116
|
+
4. **交给 skill 编译。** 「复制编译提示词」在中文站点得到 `编译这篇:<相对路径>`,在 `locale: en_US` 的站点得到 `Compile this post: <相对路径>`。把这句话发给装了 `garden-compose` skill 的 Agent。它会运行 `npx garden ui scan`,阅读 `npx garden ui prompt`,再用 `npx garden ui apply` 只替换这一块。插件本身不调用模型。写完用 `npx garden ui check` 或提交前钩子再查一遍。
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
## 本地严格检查
|
|
120
|
+
|
|
121
|
+
运行 `make check`:检查工作区所有文章的结构和全部 Compose/UI 块,包含草稿与未跟踪的新稿,不必先暂存。结构错误不会阻止 Compose 检查;有待编译/错误块时显示诊断和调用项目 `garden-compose` skill 的短指令,默认不生成提示词文件。不会调用 AI 或复制剪贴板。
|
|
122
|
+
|
|
123
|
+
`make check FILE=content/posts/文章.md` 只限制内容预检范围;通过后仍执行原来的全站 sync/build(引擎仓库保留 lint/test)。预检失败返回非零并跳过后续阶段。这是编译/校验,不是自动格式化或自动改稿。
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
`make check diff` 只检查 `content/` 下相对 HEAD 有改动的 Markdown(含已暂存、未暂存)和未跟踪新稿,读取工作区当前内容,去重、取重命名后的路径、跳过已删除文件。不会继续运行全站 sync/build/lint/tests,`make -j check diff` 也只执行一次改动检查。没有改动则成功退出;不在 Git 仓库或没有 HEAD 时明确报错,不回退全量。底层命令是 `garden verify --diff`。diff 模式优先于 FILE;不带 diff 的 `make check` 不变。
|
package/docs/handbook/writing.md
CHANGED
|
@@ -36,7 +36,7 @@ references:
|
|
|
36
36
|
| :--- | :--- | :--- | :--- |
|
|
37
37
|
| `title` | 是 | 字符串 | 文章标题。中间写 `丨`、`|` 或 ` \| ` 会分成两行并按字数缩放字号 |
|
|
38
38
|
| `date` | 是 | 日期字符串 | 发布日期(如 `2026-10-18` 或带时区的 ISO 时间) |
|
|
39
|
-
| `description` |
|
|
39
|
+
| `description` | 否 | 字符串 | 文章摘要,显示在正文开头导语、列表页与搜索引擎摘要中;留空(如 `description: ""`)、省略、YAML `null` 或只写空白时,不渲染摘要,也不会自动截取正文替代 |
|
|
40
40
|
| `updated` | 否 | 日期字符串 | 最后更新日期,显示在文章元信息栏并用于 RSS 排序 |
|
|
41
41
|
| `publishAt` | 否 | 日期字符串 | 定时发布时间;早于当前构建时间(或设置 `CONTENT_INCLUDE_DRAFTS=1`)才会发布 |
|
|
42
42
|
| `tags` | 否 | 字符串数组 | 文章标签列表,点击标签会跳转到 `/blog?t=<标签>` 筛选 |
|
|
@@ -62,12 +62,12 @@ func openStore(path string) (*Store, error) {
|
|
|
62
62
|
}
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
```garden
|
|
65
|
+
```garden compose
|
|
66
66
|
和上一版比:打开存储时的模式从 ModeJournal 改成了 ModeWAL。
|
|
67
67
|
```
|
|
68
68
|
````
|
|
69
69
|
|
|
70
|
-
Agent 按 `garden-
|
|
70
|
+
Agent 按 `garden-compose` skill 会通过 `npx garden ui apply` 把这段想法替换成紧挨着完整代码的 `diff` 围栏(详见 [用 AI 写作](/garden/ai-writing))。页面渲染时会把这两段合成一个可切换 **「代码」** 和 **「对比上一版」** 的代码框,右上角的复制按钮始终复制新版完整代码:
|
|
71
71
|
|
|
72
72
|
```go
|
|
73
73
|
func openStore(path string) (*Store, error) {
|