hd-garden 0.14.12 → 0.14.13

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 (118) hide show
  1. package/Makefile +1 -1
  2. package/app/api/admin/distribution/route.ts +4 -2
  3. package/app/blog/[...path]/page.tsx +4 -2
  4. package/app/columns/[column]/[...path]/page.tsx +4 -2
  5. package/app/components/GardenMediaGuide.tsx +11 -23
  6. package/app/components/GardenPlayer.tsx +25 -0
  7. package/app/components/HandbookView.tsx +5 -3
  8. package/app/components/MarkdownArticle.tsx +7 -2
  9. package/app/components/PostReadingView.tsx +3 -3
  10. package/app/garden-modules.d.ts +10 -2
  11. package/app/globals.css +58 -1
  12. package/app/lib/content-body.ts +20 -0
  13. package/app/lib/garden-docs-meta.ts +2 -0
  14. package/app/lib/markdown-plugins.ts +5 -0
  15. package/app/lib/remark-video-player.d.mts +10 -0
  16. package/app/lib/remark-video-player.mjs +70 -0
  17. package/app/rss.xml/route.ts +3 -2
  18. package/bin/garden.mjs +18 -78
  19. package/docs/handbook/components/compose.md +3 -1
  20. package/docs/handbook/components/diagrams/chart.md +38 -0
  21. package/docs/handbook/components/diagrams/code-walkthrough.md +38 -0
  22. package/docs/handbook/components/diagrams/columns-join.md +38 -0
  23. package/docs/handbook/components/diagrams/compare.md +38 -0
  24. package/docs/handbook/components/diagrams/converter.md +38 -0
  25. package/docs/handbook/components/diagrams/facets.md +38 -0
  26. package/docs/handbook/components/diagrams/fan-out.md +38 -0
  27. package/docs/handbook/components/diagrams/icon-rail.md +38 -0
  28. package/docs/handbook/components/diagrams/inspect-grid.md +38 -0
  29. package/docs/handbook/components/diagrams/lanes.md +38 -0
  30. package/docs/handbook/components/diagrams/layers.md +38 -0
  31. package/docs/handbook/components/diagrams/other.md +37 -0
  32. package/docs/handbook/components/diagrams/plan.md +38 -0
  33. package/docs/handbook/components/diagrams/previews/chart.svg +7 -0
  34. package/docs/handbook/components/diagrams/previews/code-walkthrough.svg +5 -0
  35. package/docs/handbook/components/diagrams/previews/columns-join.svg +6 -0
  36. package/docs/handbook/components/diagrams/previews/compare.svg +5 -0
  37. package/docs/handbook/components/diagrams/previews/converter.svg +6 -0
  38. package/docs/handbook/components/diagrams/previews/facets.svg +6 -0
  39. package/docs/handbook/components/diagrams/previews/fan-out.svg +8 -0
  40. package/docs/handbook/components/diagrams/previews/icon-rail.svg +5 -0
  41. package/docs/handbook/components/diagrams/previews/inspect-grid.svg +5 -0
  42. package/docs/handbook/components/diagrams/previews/lanes.svg +5 -0
  43. package/docs/handbook/components/diagrams/previews/layers.svg +6 -0
  44. package/docs/handbook/components/diagrams/previews/other.svg +6 -0
  45. package/docs/handbook/components/diagrams/previews/plan.svg +5 -0
  46. package/docs/handbook/components/diagrams/previews/sequence.svg +7 -0
  47. package/docs/handbook/components/diagrams/previews/stepper.svg +5 -0
  48. package/docs/handbook/components/diagrams/previews/steps.svg +7 -0
  49. package/docs/handbook/components/diagrams/previews/tabs.svg +6 -0
  50. package/docs/handbook/components/diagrams/previews/timeline.svg +5 -0
  51. package/docs/handbook/components/diagrams/previews/trace.svg +7 -0
  52. package/docs/handbook/components/diagrams/previews/tunable.svg +4 -0
  53. package/docs/handbook/components/diagrams/previews/two-row.svg +4 -0
  54. package/docs/handbook/components/diagrams/sequence.md +38 -0
  55. package/docs/handbook/components/diagrams/stepper.md +38 -0
  56. package/docs/handbook/components/diagrams/steps.md +38 -0
  57. package/docs/handbook/components/diagrams/tabs.md +38 -0
  58. package/docs/handbook/components/diagrams/timeline.md +38 -0
  59. package/docs/handbook/components/diagrams/trace.md +38 -0
  60. package/docs/handbook/components/diagrams/tunable.md +38 -0
  61. package/docs/handbook/components/diagrams/two-row.md +38 -0
  62. package/docs/handbook/components/diagrams.md +100 -0
  63. package/docs/handbook/components/link-card.md +1 -1
  64. package/docs/handbook/components.md +1 -0
  65. package/docs/handbook/en/components/compose.md +3 -1
  66. package/docs/handbook/en/components/diagrams/chart.md +40 -0
  67. package/docs/handbook/en/components/diagrams/code-walkthrough.md +40 -0
  68. package/docs/handbook/en/components/diagrams/columns-join.md +40 -0
  69. package/docs/handbook/en/components/diagrams/compare.md +40 -0
  70. package/docs/handbook/en/components/diagrams/converter.md +40 -0
  71. package/docs/handbook/en/components/diagrams/facets.md +40 -0
  72. package/docs/handbook/en/components/diagrams/fan-out.md +40 -0
  73. package/docs/handbook/en/components/diagrams/icon-rail.md +40 -0
  74. package/docs/handbook/en/components/diagrams/inspect-grid.md +40 -0
  75. package/docs/handbook/en/components/diagrams/lanes.md +40 -0
  76. package/docs/handbook/en/components/diagrams/layers.md +40 -0
  77. package/docs/handbook/en/components/diagrams/other.md +39 -0
  78. package/docs/handbook/en/components/diagrams/plan.md +40 -0
  79. package/docs/handbook/en/components/diagrams/sequence.md +40 -0
  80. package/docs/handbook/en/components/diagrams/stepper.md +40 -0
  81. package/docs/handbook/en/components/diagrams/steps.md +40 -0
  82. package/docs/handbook/en/components/diagrams/tabs.md +40 -0
  83. package/docs/handbook/en/components/diagrams/timeline.md +40 -0
  84. package/docs/handbook/en/components/diagrams/trace.md +40 -0
  85. package/docs/handbook/en/components/diagrams/tunable.md +40 -0
  86. package/docs/handbook/en/components/diagrams/two-row.md +40 -0
  87. package/docs/handbook/en/components/diagrams.md +100 -0
  88. package/docs/handbook/en/components/link-card.md +1 -1
  89. package/docs/handbook/en/components.md +1 -0
  90. package/docs/handbook/en/start.md +1 -1
  91. package/docs/handbook/en/workflow.md +2 -2
  92. package/docs/handbook/en/writing.md +82 -1
  93. package/docs/handbook/start.md +1 -1
  94. package/docs/handbook/workflow.md +2 -2
  95. package/docs/handbook/writing.md +82 -1
  96. package/editors/dist/{garden-typora-0.14.12.zip → garden-typora-0.14.13.zip} +0 -0
  97. package/editors/dist/typora/main.js +175 -175
  98. package/editors/dist/typora/manifest.json +1 -1
  99. package/editors/dist/typora/style.css +44 -6
  100. package/editors/dist/vscode/{garden-ui-0.14.12.vsix → garden-ui-0.14.13.vsix} +0 -0
  101. package/package.json +1 -1
  102. package/scripts/build-content.mjs +23 -8
  103. package/scripts/dev-server.mjs +30 -2
  104. package/scripts/fetch-embed.mjs +39 -27
  105. package/scripts/handbook-diagrams.mjs +434 -0
  106. package/scripts/link-assets.mjs +6 -0
  107. package/scripts/vinext-runtime.mjs +80 -0
  108. package/templates/site/Makefile +1 -1
  109. package/templates/site/Makefile.en +1 -1
  110. package/ui/compose/compose.css +43 -5
  111. package/ui/garden/markdown-links.mjs +8 -5
  112. package/ui/garden/picker-placement.mjs +106 -2
  113. package/ui/garden/player.mjs +286 -0
  114. package/ui/garden/rehype-keep-punctuation.mjs +87 -18
  115. package/ui/preview/dist/garden-ui.css +43 -5
  116. package/ui/preview/dist/garden-ui.esm.js +4 -4
  117. package/ui/preview/dist/garden-ui.iife.js +4 -4
  118. package/vite.config.ts +84 -23
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: "Tabs"
3
+ navTitle: "Tabs"
4
+ description: "Use this when several groups of notes are independent and the reader should see one group at a time"
5
+ section: diagrams
6
+ order: 121
7
+ ---
8
+
9
+ <!-- Generated by scripts/handbook-diagrams.mjs. Do not edit by hand. -->
10
+
11
+ ![Schematic for Tabs](../../../components/diagrams/previews/tabs.svg)
12
+
13
+ Use this when several groups of notes are independent and the reader should see one group at a time.
14
+
15
+ Do not hide facts that must be compared at the same time. This is not app navigation.
16
+
17
+ Typora and VS Code / Cursor share this list. In the `/garden` picker, this row is the same figure and the same use case. Choosing it inserts a `garden compose` brief. Fill in your material and goal, then ask the AI to compile the post.
18
+
19
+ The built-in picker currently inserts that brief in Chinese. The English wording below is the same recommended brief, written for the English handbook so you can copy it when you write in English.
20
+
21
+ The recommended brief is a starting point, not a syntax lesson, and not the only valid form. You may still combine Markdown or safe HTML building blocks in the same `garden compose` fence.
22
+
23
+ ````markdown
24
+ ```garden compose
25
+ Please make a "Tabs" diagram in garden compose from the material and the communication goal I provide.
26
+
27
+ My material:
28
+ - (paste the original items and wording to keep)
29
+
30
+ My goal:
31
+ - (what the reader should see at a glance)
32
+
33
+ Please:
34
+ - Organize only from the material; do not invent facts or conclusions
35
+ - Handle the graphic syntax, layout, and mobile reading yourself; do not ask me to learn tags or write CSS
36
+ - "Tabs" is the recommended starting point: Use tabs only when the groups can be read separately. Do not hide content that must be compared side by side
37
+ - A recommended figure is not the only valid form; you may still combine necessary Markdown / HTML building blocks in the same compose fence
38
+ - Do not start a different author fence or a new syntax; use only garden compose
39
+ ```
40
+ ````
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: "Timeline"
3
+ navTitle: "Timeline"
4
+ description: "Use this to arrange events by date or time"
5
+ section: diagrams
6
+ order: 101
7
+ ---
8
+
9
+ <!-- Generated by scripts/handbook-diagrams.mjs. Do not edit by hand. -->
10
+
11
+ ![Schematic for Timeline](../../../components/diagrams/previews/timeline.svg)
12
+
13
+ Use this to arrange events by date or time.
14
+
15
+ If the material is not a duration-scaled schedule, do not draw a Gantt chart with bar lengths.
16
+
17
+ Typora and VS Code / Cursor share this list. In the `/garden` picker, this row is the same figure and the same use case. Choosing it inserts a `garden compose` brief. Fill in your material and goal, then ask the AI to compile the post.
18
+
19
+ The built-in picker currently inserts that brief in Chinese. The English wording below is the same recommended brief, written for the English handbook so you can copy it when you write in English.
20
+
21
+ The recommended brief is a starting point, not a syntax lesson, and not the only valid form. You may still combine Markdown or safe HTML building blocks in the same `garden compose` fence.
22
+
23
+ ````markdown
24
+ ```garden compose
25
+ Please make a "Timeline" diagram in garden compose from the material and the communication goal I provide.
26
+
27
+ My material:
28
+ - (paste the original items and wording to keep)
29
+
30
+ My goal:
31
+ - (what the reader should see at a glance)
32
+
33
+ Please:
34
+ - Organize only from the material; do not invent facts or conclusions
35
+ - Handle the graphic syntax, layout, and mobile reading yourself; do not ask me to learn tags or write CSS
36
+ - "Timeline" is the recommended starting point: Arrange events by the dates or times in the source, and keep that order. Do not turn it into a duration-scaled progress bar
37
+ - A recommended figure is not the only valid form; you may still combine necessary Markdown / HTML building blocks in the same compose fence
38
+ - Do not start a different author fence or a new syntax; use only garden compose
39
+ ```
40
+ ````
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: "Path callout"
3
+ navTitle: "Path callout"
4
+ description: "Use this to mark how far you have walked on an existing flow or state diagram"
5
+ section: diagrams
6
+ order: 181
7
+ ---
8
+
9
+ <!-- Generated by scripts/handbook-diagrams.mjs. Do not edit by hand. -->
10
+
11
+ ![Schematic for Path callout](../../../components/diagrams/previews/trace.svg)
12
+
13
+ Use this to mark how far you have walked on an existing flow or state diagram.
14
+
15
+ If you only need the structure, or there are too many nodes and edges, split it first.
16
+
17
+ Typora and VS Code / Cursor share this list. In the `/garden` picker, this row is the same figure and the same use case. Choosing it inserts a `garden compose` brief. Fill in your material and goal, then ask the AI to compile the post.
18
+
19
+ The built-in picker currently inserts that brief in Chinese. The English wording below is the same recommended brief, written for the English handbook so you can copy it when you write in English.
20
+
21
+ The recommended brief is a starting point, not a syntax lesson, and not the only valid form. You may still combine Markdown or safe HTML building blocks in the same `garden compose` fence.
22
+
23
+ ````markdown
24
+ ```garden compose
25
+ Please make a "Path callout" diagram in garden compose from the material and the communication goal I provide.
26
+
27
+ My material:
28
+ - (paste the original items and wording to keep)
29
+
30
+ My goal:
31
+ - (what the reader should see at a glance)
32
+
33
+ Please:
34
+ - Organize only from the material; do not invent facts or conclusions
35
+ - Handle the graphic syntax, layout, and mobile reading yourself; do not ask me to learn tags or write CSS
36
+ - "Path callout" is the recommended starting point: Mark the current step on an existing state or flow diagram. Do not invent nodes or transitions that are not in the source
37
+ - A recommended figure is not the only valid form; you may still combine necessary Markdown / HTML building blocks in the same compose fence
38
+ - Do not start a different author fence or a new syntax; use only garden compose
39
+ ```
40
+ ````
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: "Tunable chart"
3
+ navTitle: "Tunable chart"
4
+ description: "Use this when the reader should change one or two inputs and watch the result"
5
+ section: diagrams
6
+ order: 141
7
+ ---
8
+
9
+ <!-- Generated by scripts/handbook-diagrams.mjs. Do not edit by hand. -->
10
+
11
+ ![Schematic for Tunable chart](../../../components/diagrams/previews/tunable.svg)
12
+
13
+ Use this when the reader should change one or two inputs and watch the result.
14
+
15
+ If there is only one fixed example, or too many inputs, split it first. If one input should drive several outputs, use a conversion diagram.
16
+
17
+ Typora and VS Code / Cursor share this list. In the `/garden` picker, this row is the same figure and the same use case. Choosing it inserts a `garden compose` brief. Fill in your material and goal, then ask the AI to compile the post.
18
+
19
+ The built-in picker currently inserts that brief in Chinese. The English wording below is the same recommended brief, written for the English handbook so you can copy it when you write in English.
20
+
21
+ The recommended brief is a starting point, not a syntax lesson, and not the only valid form. You may still combine Markdown or safe HTML building blocks in the same `garden compose` fence.
22
+
23
+ ````markdown
24
+ ```garden compose
25
+ Please make a "Tunable chart" diagram in garden compose from the material and the communication goal I provide.
26
+
27
+ My material:
28
+ - (paste the original items and wording to keep)
29
+
30
+ My goal:
31
+ - (what the reader should see at a glance)
32
+
33
+ Please:
34
+ - Organize only from the material; do not invent facts or conclusions
35
+ - Handle the graphic syntax, layout, and mobile reading yourself; do not ask me to learn tags or write CSS
36
+ - "Tunable chart" is the recommended starting point: Name the inputs and the conclusion that changes with them. The default state should already make sense. Do not ask the author to write a program
37
+ - A recommended figure is not the only valid form; you may still combine necessary Markdown / HTML building blocks in the same compose fence
38
+ - Do not start a different author fence or a new syntax; use only garden compose
39
+ ```
40
+ ````
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: "Two-row contrast"
3
+ navTitle: "Two-row contrast"
4
+ description: "Use this to contrast a background process with the process you want to emphasize, on two rows"
5
+ section: diagrams
6
+ order: 51
7
+ ---
8
+
9
+ <!-- Generated by scripts/handbook-diagrams.mjs. Do not edit by hand. -->
10
+
11
+ ![Schematic for Two-row contrast](../../../components/diagrams/previews/two-row.svg)
12
+
13
+ Use this to contrast a background process with the process you want to emphasize, on two rows.
14
+
15
+ If you are not contrasting two processes, or you are comparing options under the same conditions, do not use this two-row layout.
16
+
17
+ Typora and VS Code / Cursor share this list. In the `/garden` picker, this row is the same figure and the same use case. Choosing it inserts a `garden compose` brief. Fill in your material and goal, then ask the AI to compile the post.
18
+
19
+ The built-in picker currently inserts that brief in Chinese. The English wording below is the same recommended brief, written for the English handbook so you can copy it when you write in English.
20
+
21
+ The recommended brief is a starting point, not a syntax lesson, and not the only valid form. You may still combine Markdown or safe HTML building blocks in the same `garden compose` fence.
22
+
23
+ ````markdown
24
+ ```garden compose
25
+ Please make a "Two-row contrast" diagram in garden compose from the material and the communication goal I provide.
26
+
27
+ My material:
28
+ - (paste the original items and wording to keep)
29
+
30
+ My goal:
31
+ - (what the reader should see at a glance)
32
+
33
+ Please:
34
+ - Organize only from the material; do not invent facts or conclusions
35
+ - Handle the graphic syntax, layout, and mobile reading yourself; do not ask me to learn tags or write CSS
36
+ - "Two-row contrast" is the recommended starting point: Name the stages of the background process above and the focus process below, and say which row is the focus
37
+ - A recommended figure is not the only valid form; you may still combine necessary Markdown / HTML building blocks in the same compose fence
38
+ - Do not start a different author fence or a new syntax; use only garden compose
39
+ ```
40
+ ````
@@ -0,0 +1,100 @@
1
+ ---
2
+ title: "Recommended figures"
3
+ navTitle: "Recommended figures"
4
+ description: "Names, schematics, use cases, and recommended briefs for the built-in Typora and VS Code figure list."
5
+ section: diagrams
6
+ order: 1
7
+ ---
8
+
9
+ <!-- Generated by scripts/handbook-diagrams.mjs. Do not edit by hand. -->
10
+
11
+
12
+ The `/garden` list in Typora and in VS Code / Cursor comes from the same built-in list. There are currently 21 items: 20 common figures, and Other as the last item. Choosing one inserts a single `garden compose` brief, not a different author fence. That brief is for your material and goal, not a syntax lesson.
13
+
14
+ Use Other when no built-in figure fits, or when you need to combine text and graphics freely. Do not treat the list below as a closed allowlist.
15
+
16
+ For the entry and compile steps, see [Compose](/garden/en/components/compose) and [Checks & Shortcuts](/garden/en/workflow).
17
+
18
+ ![Schematic for Join diagram](../../components/diagrams/previews/columns-join.svg)
19
+
20
+ **[Join diagram](/garden/en/components/diagrams/columns-join/)** Use this to show how two sides connect through a middle item.
21
+
22
+ ![Schematic for Fan-out diagram](../../components/diagrams/previews/fan-out.svg)
23
+
24
+ **[Fan-out diagram](/garden/en/components/diagrams/fan-out/)** Use this to show a first stop that then branches to several places at once.
25
+
26
+ ![Schematic for Layer diagram](../../components/diagrams/previews/layers.svg)
27
+
28
+ **[Layer diagram](/garden/en/components/diagrams/layers/)** Use this to show top-down layers that do not have to be walked in order.
29
+
30
+ ![Schematic for Aspect diagram](../../components/diagrams/previews/facets.svg)
31
+
32
+ **[Aspect diagram](/garden/en/components/diagrams/facets/)** Use this to show several aspects of one thing, with no required order.
33
+
34
+ ![Schematic for Two-row contrast](../../components/diagrams/previews/two-row.svg)
35
+
36
+ **[Two-row contrast](/garden/en/components/diagrams/two-row/)** Use this to contrast a background process with the process you want to emphasize, on two rows.
37
+
38
+ ![Schematic for Illustrated list](../../components/diagrams/previews/icon-rail.svg)
39
+
40
+ **[Illustrated list](/garden/en/components/diagrams/icon-rail/)** Use this to explain independent items one by one.
41
+
42
+ ![Schematic for Flow diagram](../../components/diagrams/previews/sequence.svg)
43
+
44
+ **[Flow diagram](/garden/en/components/diagrams/sequence/)** Use this to show the order in which something is done.
45
+
46
+ ![Schematic for Step diagram](../../components/diagrams/previews/steps.svg)
47
+
48
+ **[Step diagram](/garden/en/components/diagrams/steps/)** Use this to explain something step by step, with room for detail inside a step.
49
+
50
+ ![Schematic for Comparison diagram](../../components/diagrams/previews/compare.svg)
51
+
52
+ **[Comparison diagram](/garden/en/components/diagrams/compare/)** Use this to compare two or three options under the same conditions.
53
+
54
+ ![Schematic for Timeline](../../components/diagrams/previews/timeline.svg)
55
+
56
+ **[Timeline](/garden/en/components/diagrams/timeline/)** Use this to arrange events by date or time.
57
+
58
+ ![Schematic for Message sequence](../../components/diagrams/previews/lanes.svg)
59
+
60
+ **[Message sequence](/garden/en/components/diagrams/lanes/)** Use this to show who sent what to whom, and when.
61
+
62
+ ![Schematic for Tabs](../../components/diagrams/previews/tabs.svg)
63
+
64
+ **[Tabs](/garden/en/components/diagrams/tabs/)** Use this when several groups of notes are independent and the reader should see one group at a time.
65
+
66
+ ![Schematic for Chart](../../components/diagrams/previews/chart.svg)
67
+
68
+ **[Chart](/garden/en/components/diagrams/chart/)** Use this to turn numbers you already have into bars, lines, or shares.
69
+
70
+ ![Schematic for Tunable chart](../../components/diagrams/previews/tunable.svg)
71
+
72
+ **[Tunable chart](/garden/en/components/diagrams/tunable/)** Use this when the reader should change one or two inputs and watch the result.
73
+
74
+ ![Schematic for Conversion diagram](../../components/diagrams/previews/converter.svg)
75
+
76
+ **[Conversion diagram](/garden/en/components/diagrams/converter/)** Use this when one input should produce several results at once.
77
+
78
+ ![Schematic for Code walkthrough](../../components/diagrams/previews/code-walkthrough.svg)
79
+
80
+ **[Code walkthrough](/garden/en/components/diagrams/code-walkthrough/)** Use this to walk through code line by line: what runs, and what the variables are.
81
+
82
+ ![Schematic for Stepper](../../components/diagrams/previews/stepper.svg)
83
+
84
+ **[Stepper](/garden/en/components/diagrams/stepper/)** Use this when the reader should pause on a step and see how state changes.
85
+
86
+ ![Schematic for Path callout](../../components/diagrams/previews/trace.svg)
87
+
88
+ **[Path callout](/garden/en/components/diagrams/trace/)** Use this to mark how far you have walked on an existing flow or state diagram.
89
+
90
+ ![Schematic for Checklist](../../components/diagrams/previews/plan.svg)
91
+
92
+ **[Checklist](/garden/en/components/diagrams/plan/)** Use this when the reader should follow items one by one and come back to check progress.
93
+
94
+ ![Schematic for Grid diagram](../../components/diagrams/previews/inspect-grid.svg)
95
+
96
+ **[Grid diagram](/garden/en/components/diagrams/inspect-grid/)** Use this to mark which cells in a two-dimensional structure matter, and why.
97
+
98
+ ![Schematic for Other](../../components/diagrams/previews/other.svg)
99
+
100
+ **[Other](/garden/en/components/diagrams/other/)** Use this when no built-in figure fits, and you need to combine text and graphics freely.
@@ -6,7 +6,7 @@ section: components
6
6
  order: 43
7
7
  ---
8
8
 
9
- A URL on its own paragraph, or a link followed immediately by `{card}`, renders as a link card (same-site and external share one path). An ordinary titled link in prose stays a link, such as [Typora](https://typora.io/): an external one shows the site favicon before the text and a `↗` at the upper right; a titled same-site link still navigates in place.
9
+ A URL on its own paragraph, or a link followed immediately by `{card}`, renders as a link card (same-site and external share one path). Exception: a playable YouTube or Bilibili video URL on its own line becomes an in-article player; see [Writing](/garden/en/writing). To keep a card, write `{card}` immediately after the link. An ordinary titled link in prose stays a link, such as [Typora](https://typora.io/): an external one shows the site favicon before the text and a `↗` at the upper right; a titled same-site link still navigates in place.
10
10
 
11
11
  - **When to use**: The reader should see the site name, title, and summary before opening the page.
12
12
  - **When to skip**: Use a [source chip](/garden/en/components/source) to cite a site inside a sentence, or a [reference card](/garden/en/components/compose) when you are writing the takeaways yourself.
@@ -9,5 +9,6 @@ order: 30
9
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
11
  - [Compose](/garden/en/components/compose)
12
+ - [Recommended figures](/garden/en/components/diagrams)
12
13
  - [Compose reference](/garden/en/reference/compose)
13
14
  - [Icons](/garden/en/reference/compose-icons)
@@ -21,7 +21,7 @@ make dev
21
21
 
22
22
  `npx hd-garden init` copies the site template into `my-blog` and writes the helper skills under `.agents/skills/`. When `--locale en` or `--locale en_US` is passed, it generates an English `site.config.yaml`, `Makefile`, and `README.md`, and installs `.github/workflows/pages.yml` from `templates/workflows/pages.en.yml` (default `zh_CN` initialization does not create `.github/workflows/pages.yml`; see [Deploy to GitHub Pages](/garden/en/deploy)). It does not run `npm install` automatically.
23
23
 
24
- On the first `make dev` run, if `node_modules` is missing, `make prepare` in the `Makefile` runs `npm install` before invoking `npx garden dev` (which syncs content first) and starting the local dev server at `http://localhost:3000`.
24
+ On the first `make dev` run, if `node_modules` is missing, `make prepare` in the `Makefile` runs `npm install` before invoking `npx garden dev` (which syncs content first) and starting the local development server. The default preview is Node RSC; use `npx garden dev --worker` when you need Cloudflare Worker behavior.
25
25
 
26
26
  ## 2. Directory Structure
27
27
 
@@ -104,8 +104,8 @@ The Obsidian plugin is not installed by this command.
104
104
 
105
105
  ### Use the plugins while writing
106
106
 
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.
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.
107
+ 1. **Insert Compose.** 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`, then pick a figure type from the next list (the last item is Other; each row has a small preview), or use the insert command to open that 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 selection inserts a `garden compose` fence with a draft brief for that figure, which the `garden-compose` skill compiles later. Do not insert a legacy `ui` or `intent` fence. For every built-in figure, see [Recommended figures](/garden/en/components/diagrams).
108
+ 2. **Preview.** Open the Markdown preview. In Typora, move the cursor out of the fence. A compiled `garden compose` fence renders the same component as the blog. An uncompiled plain-language fence renders as an idea card. Clicks on sliders and buttons stay in the preview.
109
109
  3. **Open the catalog.** In VS Code / Cursor, the catalog command inserts a recipe at the cursor. The terminal builds the same page:
110
110
 
111
111
  ```bash
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Writing Posts
3
3
  navTitle: Writing Posts
4
- description: Front Matter fields for posts, code diff toggles, callouts, math formulas, and Mermaid diagrams, with links to local images, source chips, and link cards.
4
+ description: Front matter fields for long posts, code-and-diff switches, callouts, math and diagrams, plus images, audio and video, external players, footnotes, file downloads, and link cards.
5
5
  section: writing-and-reading
6
6
  order: 10
7
7
  ---
@@ -129,3 +129,84 @@ graph LR
129
129
  B --> C[Search & Static Assets]
130
130
  C --> D[Rendered Page]
131
131
  ```
132
+
133
+ ## 6. Local Audio and Video
134
+
135
+ For a post at `content/posts/my-post.md`, put audio and video in `content/posts/my-post/`. Write them in the Markdown body. Do not wrap them in Compose, and do not put them inside a Compose `<html>` island. Use an `audio` or `video` tag with `controls`, and set `src` to a relative path such as `./my-post/clip.mp3` or `./my-post/clip.mp4`. Files in object storage use a full `https://` address. Do not autoplay.
136
+
137
+ The build copies local attachments into the public directory. Do not commit large media to Git; prefer object storage.
138
+
139
+ ## 7. YouTube and Bilibili Players
140
+
141
+ Paste a playable video URL on its own line, with blank lines around it. The page renders an in-article player that does not autoplay, and keeps a link to the original site:
142
+
143
+ ```markdown
144
+ https://www.youtube.com/watch?v=VIDEO_ID
145
+
146
+ https://www.bilibili.com/video/BV1xx411c7mD
147
+ ```
148
+
149
+ `https://youtu.be/VIDEO_ID`, `/shorts/`, and `/embed/` also work, as do Bilibili `av` ids and `player.bilibili.com` player URLs. Tracking parameters are ignored. A YouTube start time such as `?t=90` or `?t=1m30s` starts at that second.
150
+
151
+ These do not become a player:
152
+
153
+ - A link inside a sentence, or more than one link in the same paragraph
154
+ - A URL inside a code fence or inline code
155
+ - An address that is not a single video (playlists, channels, article pages). A URL like that on its own line still renders as a [link card](/garden/en/components/link-card)
156
+ - Lookalike or unrelated hosts that are not exactly YouTube or Bilibili
157
+ - Short links such as `b23.tv` that need a redirect to discover the video. Rendering does not wait on the network to resolve them. Open the short link in a browser, or run `npx garden embed <short-url>`, then paste the printed full video URL on its own line
158
+ - When you want a card instead of a player, write `{card}` immediately after the link
159
+
160
+ The player accepts only official video URLs from those platforms. YouTube uses the privacy-enhanced `youtube-nocookie.com` host. Arbitrary pages and arbitrary iframes are not embedded.
161
+
162
+ `npx garden embed URL` or `make embed URL="..."` prints one paste-ready canonical URL, and writes any title or summary to the terminal. It no longer emits a legacy `embed` fence.
163
+
164
+ ## 8. File Downloads and Previews
165
+
166
+ To let readers download a file (a spec pack, a PDF, or sample code), use `<file>` or `<files>` inside `garden compose`. Put the files in the post's same-named directory, and write `src` relative to the Markdown file:
167
+
168
+ ```text
169
+ content/posts/go-lock.md
170
+ content/posts/go-lock/mutex-notes.pdf
171
+ content/posts/go-lock/demo.zip
172
+ ```
173
+
174
+ One file:
175
+
176
+ ````markdown
177
+ ```garden compose
178
+ <file src="./go-lock/demo.zip" title="Sample code" note="Three lock examples you can run"/>
179
+ ```
180
+ ````
181
+
182
+ A group of files:
183
+
184
+ ````markdown
185
+ ```garden compose
186
+ <files title="References">
187
+ <file src="./go-lock/mutex-notes.pdf" note="A one-page mutex state machine"/>
188
+ <file src="./go-lock/readme.md"/>
189
+ <file src="https://oss.example.com/go-lock/trace.zip" title="Full trace"/>
190
+ </files>
191
+ ```
192
+ ````
193
+
194
+ | Attribute | Meaning |
195
+ | :--- | :--- |
196
+ | `src` | Required. Local files use a relative path; files in object storage use a full `https://` URL |
197
+ | `title` | Optional card name; defaults to the file name |
198
+ | `note` | Optional one-line description |
199
+
200
+ You do not write the format or size. The build fills in a line such as `PDF · 204 KB`. A missing local file fails the build. Local Markdown, HTML, and PDF files can be previewed on the page: choose Preview to open the file on the right, or full screen on a phone.
201
+
202
+ ## 9. Footnotes
203
+
204
+ Use GFM footnotes. Put the marker in the prose and the definition in its own paragraph, with matching names:
205
+
206
+ ```markdown
207
+ This rule comes from a CommonMark derivative.[^1]
208
+
209
+ [^1]: See [remark-gfm](https://github.com/remarkjs/remark-gfm).
210
+ ```
211
+
212
+ Footnotes are collected at the end of the article.
@@ -21,7 +21,7 @@ make dev
21
21
 
22
22
  `npx hd-garden init` 会把站点模板复制到 `my-blog` 目录,并写入 `.agents/skills/` 辅助技能文件(传入 `--locale en` 或 `--locale en_US` 时会生成英文版 `site.config.yaml`、`Makefile`、`README.md`,并安装 `.github/workflows/pages.yml`)。默认中文初始化不会自动执行 `npm install`,也不会自动创建 `.github/workflows/pages.yml`(GitHub Pages 工作流配置见 [发布到 GitHub Pages](/garden/deploy))。
23
23
 
24
- 首次运行 `make dev` 时,如果还没有 `node_modules`,`Makefile` 中的 `make prepare` 会先自动执行 `npm install`,随后运行 `npx garden dev`(其内部会先执行内容同步)并启动本地开发服务器,默认地址为 `http://localhost:3000`。
24
+ 首次运行 `make dev` 时,如果还没有 `node_modules`,`Makefile` 中的 `make prepare` 会先自动执行 `npm install`,随后运行 `npx garden dev`(其内部会先执行内容同步)并启动本地开发服务器。默认是 Node RSC 预览;需要 Cloudflare Worker 行为时用 `npx garden dev --worker`。
25
25
 
26
26
  ## 2. 站点目录结构
27
27
 
@@ -104,8 +104,8 @@ Obsidian 插件这一轮不随包安装。
104
104
 
105
105
  ### 在编辑器里怎么用
106
106
 
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 编译。
108
- 2. **预览。** 打开 Markdown 预览(Typora 里光标离开围栏即可)。`ui` 块画成和博客一样的组件,`intent` 块显示成想法卡片。点滑杆、按钮不会跳回源码。
107
+ 1. **插入 Compose。** VS Code / Cursor:macOS 用 `Cmd+Alt+I`,Windows / Linux 用 `Ctrl+Alt+I`,或命令「插入 Garden 块」。Typora:输入 `/` 后选 `/garden`,在下一层图示列表里选一种(最后一项是「其他」;每一项有一张小预览图),或用命令「插入 Garden 块」直接打开这个列表(Windows / Linux 默认 `Ctrl+Alt+I`,macOS 请到「设置 → 快捷键」里自己录,因为 Option 会改写按键)。选中后会直接插入一个 `garden compose` 围栏,里面是针对该图示的说明草稿,交给 `garden-compose` skill 编译。不要再插入旧的 `ui` 或 `intent` 围栏。全部内置图示见[推荐图示](/garden/components/diagrams)。
108
+ 2. **预览。** 打开 Markdown 预览(Typora 里光标离开围栏即可)。已编译的 `garden compose` 画成和博客一样的组件;还没编译的白话围栏显示成想法卡片。点滑杆、按钮不会跳回源码。
109
109
  3. **看组件清单。** VS Code / Cursor 里用「查看组件清单」,点「用它开始」把配方插进当前稿件。终端里的同一份清单:
110
110
 
111
111
  ```bash
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: 写文章
3
3
  navTitle: 写文章
4
- description: 长文的 Front Matter 字段、代码块对比、提示框、公式与流程图,以及配图、来源胶囊和链接卡片的入口。
4
+ description: 长文的 Front Matter 字段、代码块对比、提示框、公式与流程图,以及配图、音视频、外链播放器、脚注、文件下载与链接卡片的入口。
5
5
  section: writing-and-reading
6
6
  order: 10
7
7
  ---
@@ -129,3 +129,84 @@ graph LR
129
129
  B --> C[生成搜索与静态资源]
130
130
  C --> D[页面渲染]
131
131
  ```
132
+
133
+ ## 6. 本地音频和视频
134
+
135
+ 长文 `content/posts/my-post.md` 的音视频放在同名目录 `content/posts/my-post/`。写在 Markdown 正文里,不要包进 Compose,也不要放进 Compose 的 `<html>` 内容岛。使用带 `controls` 的 `audio` 或 `video` 标签,`src` 填写相对路径,例如 `./my-post/clip.mp3` 或 `./my-post/clip.mp4`。对象存储里的文件写完整的 `https://` 地址。不要自动播放。
136
+
137
+ 构建会把本地附件复制到公开目录。大文件不要提交进 Git,更适合放对象存储。
138
+
139
+ ## 7. 嵌入 YouTube / Bilibili
140
+
141
+ 把可播放的视频链接单独占一行,前后留空行。页面会渲染成站内播放器,不自动播放,并保留到原站的链接:
142
+
143
+ ```markdown
144
+ https://www.youtube.com/watch?v=VIDEO_ID
145
+
146
+ https://www.bilibili.com/video/BV1xx411c7mD
147
+ ```
148
+
149
+ 也支持 `https://youtu.be/VIDEO_ID`、`/shorts/`、`/embed/`,以及 Bilibili 的 `av` 号和 `player.bilibili.com` 播放地址。多余的跟踪参数会被忽略;YouTube 链接里的开始时间(如 `?t=90` 或 `?t=1m30s`)会从那一秒起播。
150
+
151
+ 这些情况不会变成播放器:
152
+
153
+ - 句子里的链接,或同一段里有多条链接
154
+ - 代码块、行内代码里的地址
155
+ - 不是单个视频的地址(播放列表、频道、专栏文章等)。单独一行时仍按[链接卡片](/garden/components/link-card)处理
156
+ - 域名并不精确匹配 YouTube / Bilibili 的仿冒或无关地址
157
+ - `b23.tv` 等需要跳转才能确定视频的短链。渲染时不会为了解析短链去访问网络;请先在浏览器打开,或运行 `npx garden embed <短链>`,把打印出的完整视频链接单独一行贴进文章
158
+ - 希望显示卡片而不是播放器时,在链接后紧跟 `{card}`
159
+
160
+ 播放器只接受上述平台的官方视频地址,YouTube 使用隐私增强域名 `youtube-nocookie.com`,不会嵌入任意网页或任意 iframe。
161
+
162
+ `npx garden embed URL` 或 `make embed URL="..."` 会打印一行可直接粘贴的规范化地址,标题等说明写在终端里,不再生成旧的 `embed` 围栏。
163
+
164
+ ## 8. 文件下载与预览
165
+
166
+ 想让读者下载一份文件(规格包、PDF、示例代码),在 `garden compose` 里用 `<file>` 或 `<files>`。文件放在这篇稿的同名目录里,`src` 相对这篇 Markdown 写:
167
+
168
+ ```text
169
+ content/posts/go-lock.md
170
+ content/posts/go-lock/mutex-notes.pdf
171
+ content/posts/go-lock/demo.zip
172
+ ```
173
+
174
+ 一个文件:
175
+
176
+ ````markdown
177
+ ```garden compose
178
+ <file src="./go-lock/demo.zip" title="示例代码" note="三个可以直接运行的加锁例子"/>
179
+ ```
180
+ ````
181
+
182
+ 一组文件:
183
+
184
+ ````markdown
185
+ ```garden compose
186
+ <files title="参考资料">
187
+ <file src="./go-lock/mutex-notes.pdf" note="互斥锁的状态机,一页纸"/>
188
+ <file src="./go-lock/readme.md"/>
189
+ <file src="https://oss.example.com/go-lock/trace.zip" title="完整 trace"/>
190
+ </files>
191
+ ```
192
+ ````
193
+
194
+ | 属性 | 说明 |
195
+ | :--- | :--- |
196
+ | `src` | 必填。本地文件写相对路径;对象存储里的文件写完整的 `https://` 地址 |
197
+ | `title` | 可选,卡片上的名字,默认是文件名 |
198
+ | `note` | 可选,一句话说明里面有什么 |
199
+
200
+ 格式和大小不用手写,构建时会算出来,显示成「PDF · 204 KB」这样的一行。找不到本地文件时,构建会失败。本地的 Markdown、HTML 和 PDF 可以在页面里预览:点「预览」,文件在右侧打开,手机上占满全屏。
201
+
202
+ ## 9. 脚注
203
+
204
+ 使用 GFM 脚注。标记写在正文里,定义单独成段,名称要对应:
205
+
206
+ ```markdown
207
+ 这条规则来自 CommonMark 的衍生语法。[^1]
208
+
209
+ [^1]: 详见 [remark-gfm](https://github.com/remarkjs/remark-gfm)。
210
+ ```
211
+
212
+ 脚注会集中出现在文章末尾。