figdown 0.1.0-rc.1 → 0.1.0
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/README.md +253 -171
- package/dist/figdown.js +2601 -580
- package/dist/figdown.mjs +2601 -580
- package/examples/evpn-fabric.svg +16 -11
- package/examples/showcase/arp-resolution.svg +18 -16
- package/examples/showcase/ethernet-frame.svg +12 -10
- package/examples/showcase/l2-forwarding-logic.svg +20 -16
- package/examples/showcase/tcp-handshake.svg +14 -13
- package/examples/showcase/tcp-header.svg +26 -19
- package/examples/showcase/tcp-state-machine.svg +57 -44
- package/guide/expressing.md +160 -0
- package/guide/layout.md +635 -0
- package/{SHOWCASE.md → guide/showcase.md} +130 -108
- package/package.json +30 -4
- package/skill/figdown/SKILL.md +173 -0
- package/skill/figdown/build-svg.js +51 -16
- package/skill/figdown/figdown.html +3005 -783
- package/skill/figdown/reference/bitfield.md +130 -0
- package/skill/figdown/reference/experimental/constructs.md +90 -0
- package/skill/figdown/reference/experimental/flowchart.md +56 -0
- package/skill/figdown/reference/experimental/timing.md +33 -0
- package/skill/figdown/reference/experimental/topology.md +38 -0
- package/skill/figdown/reference/layout.md +77 -0
- package/skill/figdown/reference/reading.md +119 -0
- package/skill/figdown/reference/scene.md +118 -0
- package/skill/figdown/reference/table.md +71 -0
- package/skill/figdown/reference/transcribe.md +46 -0
- package/EXPRESSING.md +0 -119
- package/LAYOUT-GUIDE.md +0 -367
- package/README.zh-tw.md +0 -185
package/README.md
CHANGED
|
@@ -1,201 +1,283 @@
|
|
|
1
1
|
# FigDown
|
|
2
2
|
|
|
3
|
-
> **Figures as text — one source, two readers.**
|
|
3
|
+
> **Figures as text in Markdown — one source, two readers.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
FigDown is an open standard for describing figures as plain text inside
|
|
6
|
+
Markdown, so that **one** source serves two readers who need completely
|
|
7
|
+
different things from it:
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
- **AI agents read the `.fd` for meaning.** The knowledge in your diagrams —
|
|
10
|
+
participants, relationships, containment, field widths, table structure —
|
|
11
|
+
stops being locked inside a bitmap. An agent answers questions from the
|
|
12
|
+
text, and never has to OCR a picture.
|
|
13
|
+
- **Humans see a deterministic SVG.** The same source is converted to SVG by
|
|
14
|
+
a plain program — no model in the rendering path — and the artifact travels
|
|
15
|
+
with the document, viewable in any Markdown viewer.
|
|
9
16
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
Think of it as the figure layer of Markdown: what Mermaid did for flowcharts,
|
|
18
|
+
extended to the diagram families Mermaid cannot express — annotated block
|
|
19
|
+
architectures, protocol headers, lookup tables, packet walks — with **layout
|
|
20
|
+
treated as part of the knowledge** rather than as something the renderer is
|
|
21
|
+
free to rearrange.
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
extended to the diagram types Mermaid can't express (network topologies,
|
|
17
|
-
annotated block diagrams, lookup chains, packet walks…), with layout
|
|
18
|
-
treated as part of the knowledge.
|
|
23
|
+
**[Try it live — the editor runs in your browser, no install.](https://figdown.github.io/figdown/)**
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
(edit text on the left, deterministic SVG on the right; open/save real
|
|
22
|
-
`.fd` files; every GUI action is a text edit).
|
|
25
|
+
---
|
|
23
26
|
|
|
24
|
-
##
|
|
27
|
+
## Fifteen seconds
|
|
25
28
|
|
|
26
|
-
This
|
|
29
|
+
This is a complete FigDown document. Nothing has been elided.
|
|
27
30
|
|
|
28
31
|
```figdown
|
|
29
|
-
figdown 0.1
|
|
30
|
-
title "
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
node
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
flow down
|
|
46
|
-
rank sp1 sp2
|
|
47
|
-
rank lf1 lf2 lf3
|
|
48
|
-
|
|
49
|
-
# underlay: every leaf peers with every spine
|
|
50
|
-
edge sp1 -[eBGP]- lf1 class=underlay
|
|
51
|
-
edge sp1 -- lf2 class=underlay
|
|
52
|
-
edge sp1 -- lf3 class=underlay
|
|
53
|
-
edge sp2 -- lf1 class=underlay
|
|
54
|
-
edge sp2 -- lf2 class=underlay
|
|
55
|
-
edge sp2 -- lf3 class=underlay
|
|
56
|
-
edge lf1 -- h1 class=underlay
|
|
57
|
-
edge lf2 -- h2 class=underlay
|
|
58
|
-
edge lf3 -- h3 class=underlay
|
|
59
|
-
|
|
60
|
-
# overlay: VXLAN tunnel between the two VTEPs sharing VNI 10010
|
|
61
|
-
layer overlay "VXLAN tunnels" z=2
|
|
62
|
-
edge lf1 <-[VXLAN VNI 10010]-> lf2 class=overlay layer=overlay
|
|
63
|
-
|
|
64
|
-
# ── Supplementary knowledge ─────────────────────────────────────────
|
|
65
|
-
table vni "VNI mapping"
|
|
66
|
-
| Leaf | VLAN | VNI | Type |
|
|
67
|
-
|--------|:----:|-------|------|
|
|
68
|
-
| Leaf-1 | 10 | 10010 | L2 |
|
|
69
|
-
| Leaf-2 | 10 | 10010 | L2 |
|
|
70
|
-
| Leaf-3 | 20 | 10020 | L2 |
|
|
71
|
-
cell 1,3 color=#fee2e2
|
|
72
|
-
cell 2,3 color=#fee2e2
|
|
73
|
-
|
|
74
|
-
table planes "Fabric planes"
|
|
75
|
-
| Plane | Protocol | Role |
|
|
76
|
-
|-----------------|-------------------|---------------------------|
|
|
77
|
-
| Underlay | eBGP | loopback reachability |
|
|
78
|
-
| Overlay control | MP-BGP EVPN | MAC/IP route distribution |
|
|
79
|
-
| Overlay data | VXLAN (UDP 4789) | L2-in-L3 encapsulation |
|
|
32
|
+
figdown 0.1 block
|
|
33
|
+
title "Ingress datapath (excerpt)"
|
|
34
|
+
group ing "Ingress Pipeline"
|
|
35
|
+
node mac "MAC RX" in=ing
|
|
36
|
+
node parser "Parser" in=ing
|
|
37
|
+
node l2 "L2 Lookup" in=ing
|
|
38
|
+
node l3 "L3 Lookup" in=ing fill=#d1fae5
|
|
39
|
+
node acl "ACL" in=ing
|
|
40
|
+
node mmu "MMU / Buffer"
|
|
41
|
+
flow right
|
|
42
|
+
edge mac -> parser
|
|
43
|
+
edge parser -> l2
|
|
44
|
+
edge l2 -[L3 hit]-> l3
|
|
45
|
+
edge l2 -[miss]-> acl style=dashed
|
|
46
|
+
edge l3 -> mmu
|
|
47
|
+
edge acl -> mmu
|
|
80
48
|
```
|
|
81
49
|
|
|
82
|
-
|
|
83
|
-
the red dashed VXLAN edge belongs to a declared `layer` (named overlay, z=2),
|
|
84
|
-
so it can be toggled or styled independently of the underlay topology;
|
|
85
|
-
the two GFM tables are pasted verbatim — they render as formatted tables in the
|
|
86
|
-
SVG and are read as structured data by AI agents without any conversion step;
|
|
87
|
-
and the rank declarations give the layout explicit semantic structure
|
|
88
|
-
(spines above leaves above hosts) that survives edits without a full re-layout.
|
|
89
|
-
The fenced block above is exactly what an AI agent reads as the figure's meaning.
|
|
50
|
+
It renders to this, deterministically — same source, same bytes, every time:
|
|
90
51
|
|
|
91
|
-

|
|
92
53
|
|
|
93
|
-
<sub>source: [
|
|
54
|
+
<sub>source: [figures/ingress.fd](figures/ingress.fd) — this figure is FigDown</sub>
|
|
55
|
+
|
|
56
|
+
An agent handed the text above can say which stages are inside the ingress
|
|
57
|
+
pipeline, that an L2 miss goes to the ACL stage, and that both branches
|
|
58
|
+
converge on the MMU. It can say all of it without seeing the picture. That is
|
|
59
|
+
the whole idea.
|
|
60
|
+
|
|
61
|
+
In a Markdown document you embed the artifact and point at the source:
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+
<sub>source: [figures/ingress.fd](figures/ingress.fd)</sub>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The SVG is what humans see; the `source:` footer is what agents follow. Each
|
|
70
|
+
generated SVG also embeds its own source text and a SHA-256 of it, so a figure
|
|
71
|
+
that gets separated from its `.fd` can always be recovered and reopened.
|
|
72
|
+
|
|
73
|
+
---
|
|
94
74
|
|
|
95
75
|
## Why
|
|
96
76
|
|
|
97
|
-
Technical documents are full of figures whose
|
|
98
|
-
rank, zones, direction, adjacency. Today that knowledge is trapped in
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
part of the problem and none of them promise the property we consider
|
|
102
|
-
essential: **a small edit to the source must produce a small change in the
|
|
103
|
-
figure** — never a full re-layout that destroys the reader's mental map.
|
|
77
|
+
Technical documents are full of figures whose **layout carries meaning** —
|
|
78
|
+
rank, zones, direction, adjacency. Today that knowledge is trapped in images:
|
|
79
|
+
AI agents cannot reliably read it, and hand-maintained diagrams drift from the
|
|
80
|
+
text around them.
|
|
104
81
|
|
|
105
|
-
|
|
82
|
+
Existing text-to-diagram tools cover only part of the problem, and none of them
|
|
83
|
+
promise the property we consider essential:
|
|
106
84
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
2. **Deterministic, program-only rendering.** Same source → same SVG,
|
|
110
|
-
bit-level; no LLM in the rendering path.
|
|
111
|
-
3. **Layout stability.** Local edit → local change. Explicitly declared
|
|
112
|
-
attributes (position, size, color…) are rigid; everything undeclared
|
|
113
|
-
adapts automatically with minimal spillover.
|
|
114
|
-
4. **Two audiences, one artifact.** AI reads the fenced source block;
|
|
115
|
-
humans see the embedded SVG. The standard defines how the two stay
|
|
116
|
-
paired and in sync.
|
|
117
|
-
5. **Defaults = the common case.** Most figures should need no
|
|
118
|
-
supplementary declarations at all (convention over configuration).
|
|
119
|
-
6. **Small, closed, token-lean core.** Every line starts with a known
|
|
120
|
-
keyword; unknown lines are errors with line numbers (this powers the
|
|
121
|
-
AI write→validate→fix loop). Teaching the language to an AI agent must
|
|
122
|
-
fit in a lean prompt. Generic rules over special cases; survey existing
|
|
123
|
-
standards before inventing anything.
|
|
124
|
-
7. **An editor is mandatory, but every GUI action is a text edit** —
|
|
125
|
-
dragging a node writes a position declaration. The GUI never owns state
|
|
126
|
-
that the text can't express.
|
|
127
|
-
8. **Static first; dynamic later.** Dynamic = static + a discrete
|
|
128
|
-
page/step sequence (for algorithm/protocol walkthroughs), not a
|
|
129
|
-
timeline animation language.
|
|
85
|
+
> **A small edit to the source must produce a small change in the figure** —
|
|
86
|
+
> never a full re-layout that destroys the reader's mental map.
|
|
130
87
|
|
|
131
|
-
|
|
88
|
+
That sentence is the project's reason to exist. A diagram language that
|
|
89
|
+
re-flows the whole picture when you rename one node is not a maintenance tool;
|
|
90
|
+
it is a generator you run once and then stop touching, which is exactly how
|
|
91
|
+
figures come to disagree with the prose beside them.
|
|
132
92
|
|
|
133
|
-
|
|
134
|
-
embed figures like this:
|
|
93
|
+
## Design axioms
|
|
135
94
|
|
|
136
|
-
|
|
137
|
-
|
|
95
|
+
These are the beliefs the language is built on. Every ruling in
|
|
96
|
+
[`decisions/`](decisions/README.md) traces back to one of them, and they are
|
|
97
|
+
listed here rather than buried because a reader who has only the rules cannot
|
|
98
|
+
tell a principled decision from an arbitrary one.
|
|
138
99
|
|
|
139
|
-
|
|
100
|
+
1. **Text is the single source of truth.** Figures are build artifacts, 100%
|
|
101
|
+
generated from text. No dual maintenance, ever.
|
|
102
|
+
2. **Deterministic, program-only rendering.** Same source → same SVG, at the
|
|
103
|
+
byte level; **no model in the rendering path**.
|
|
104
|
+
3. **Layout stability.** Local edit → local change. Explicitly declared
|
|
105
|
+
attributes (position, extent, colour…) are rigid; everything undeclared
|
|
106
|
+
adapts automatically, with spillover kept minimal.
|
|
107
|
+
4. **Two audiences, one artifact.** An AI agent reads the source block; humans
|
|
108
|
+
see the embedded SVG. The standard defines how the two stay paired and in
|
|
109
|
+
sync.
|
|
110
|
+
5. **Defaults are the common case.** Most figures should need no supplementary
|
|
111
|
+
declarations at all — convention over configuration.
|
|
112
|
+
6. **A small, closed, token-lean core.** Every line starts with a known
|
|
113
|
+
keyword; unknown lines are errors carrying a line number, which is what
|
|
114
|
+
powers the AI write → validate → fix loop. Teaching the language to an agent
|
|
115
|
+
must fit in a lean prompt. Generic rules over special cases; survey existing
|
|
116
|
+
standards before inventing anything.
|
|
117
|
+
7. **An editor is mandatory, but every GUI action is a text edit.** Dragging a
|
|
118
|
+
node writes a position declaration. The GUI never owns state that the text
|
|
119
|
+
cannot express.
|
|
120
|
+
8. **Static first; dynamic later.** Dynamic means static plus a discrete
|
|
121
|
+
page/step sequence, for algorithm and protocol walkthroughs — not a timeline
|
|
122
|
+
animation language.
|
|
123
|
+
|
|
124
|
+
## Stability — read this before adopting
|
|
125
|
+
|
|
126
|
+
**FigDown 0.x is a preview, and it is NOT stable.** The language may change
|
|
127
|
+
between 0.x versions in ways that require a document to be rewritten. No 0.x
|
|
128
|
+
version carries a stability promise, and none should be read as carrying one.
|
|
129
|
+
|
|
130
|
+
This is stated plainly because the opposite mistake is expensive and quiet: the
|
|
131
|
+
project's visible care — a migration log, a conformance suite, the word
|
|
132
|
+
*frozen* — invites a reader to infer a stability promise that was never made.
|
|
133
|
+
|
|
134
|
+
> **"Frozen" is not "stable".**
|
|
135
|
+
>
|
|
136
|
+
> *Frozen* names the **scope of the change-management promise**, not the
|
|
137
|
+
> absence of change. A frozen construct **may still change**. What frozen
|
|
138
|
+
> guarantees is *how* it may change: in the same release, the change must ship
|
|
139
|
+
> an entry in [`spec/migrations.md`](spec/migrations.md) carrying a
|
|
140
|
+
> **mechanical rewrite rule**, a **named diagnostic** so that documents written
|
|
141
|
+
> against the old spelling fail loudly instead of silently changing meaning,
|
|
142
|
+
> and the matching rewrite in the migration tool.
|
|
143
|
+
>
|
|
144
|
+
> Anything marked **experimental** may change or be withdrawn with none of
|
|
145
|
+
> those three.
|
|
146
|
+
|
|
147
|
+
So "frozen" is a real guarantee — about *process*, not about *permanence*.
|
|
148
|
+
|
|
149
|
+
### Two version numbers, and how they are bound
|
|
150
|
+
|
|
151
|
+
FigDown carries **two** version numbers. Confusing them makes the central
|
|
152
|
+
promise unstatable, because "you may stay on a version" has to say *which*
|
|
153
|
+
version or it means nothing.
|
|
154
|
+
|
|
155
|
+
| number | what it versions | where it is written |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| **`figdown X.Y`** | the **language** — the document format | the `figdown` header line of every `.fd` file |
|
|
158
|
+
| **`vX.Y.Z`** | the **release** — this repository and its engine | the git tag, `package.json`, and every artifact's `data-engine-version` |
|
|
159
|
+
|
|
160
|
+
**They are bound: `figdown X.Y` is the first two parts of the release version.**
|
|
161
|
+
Release `v0.3.2` implements language `figdown 0.3`. The language number has no
|
|
162
|
+
third part and never will — a `Z` bump is by definition a change the language
|
|
163
|
+
did not make.
|
|
164
|
+
|
|
165
|
+
| part | meaning |
|
|
166
|
+
|---|---|
|
|
167
|
+
| **`Z`** | **Bug fixes only.** The language does not move. `v0.1.1` may fix a rendering defect with **no `.fd` file altered**. |
|
|
168
|
+
| **`Y`** | **Features are added. Nothing is ever removed.** Every document a `Y` release accepted, the next one still accepts. |
|
|
169
|
+
| **`X`** | **The only point at which support may be removed** — and removing it forces a migration. |
|
|
170
|
+
|
|
171
|
+
`X` carries the whole removal budget. That is the strict part, and it has a
|
|
172
|
+
sharp consequence: **a rename is a removal.** After `v1.0.0` a frozen construct
|
|
173
|
+
cannot be renamed within `figdown 1.y` — a rename takes `figdown 2.0`. The
|
|
174
|
+
industry-standard deprecate-then-remove cycle is deliberately refused, because
|
|
175
|
+
**code is maintained but documents are archived**: a deprecation warning assumes
|
|
176
|
+
an author who comes back and runs the thing, and a five-year-old figure has no
|
|
177
|
+
such author.
|
|
178
|
+
|
|
179
|
+
### Three promises, not one
|
|
180
|
+
|
|
181
|
+
One word — "version" — usually carries all three of these. They are distinct,
|
|
182
|
+
and each is worth something on its own:
|
|
183
|
+
|
|
184
|
+
| promise | what it says | condition |
|
|
185
|
+
|---|---|---|
|
|
186
|
+
| **Compatible** | the document's **meaning** is preserved; the engine accepts it and renders it correctly | same `X`, engine `Y` ≥ document `y` — **from `v1.0.0` only** |
|
|
187
|
+
| **Reproducible** | the **bytes** of the SVG are identical | same source **and** same release version — holds today |
|
|
188
|
+
| **Available** | the **archived engine still runs**, so the exact figure is always recoverable | unconditional, from the first release onward |
|
|
189
|
+
|
|
190
|
+
Two limits are worth stating plainly, because assuming them away is what makes
|
|
191
|
+
the archive look redundant when it is not:
|
|
192
|
+
|
|
193
|
+
- **Compatibility takes force at `v1.0.0`.** During 0.x there is no such
|
|
194
|
+
guarantee, and **`figdown 0.1` → `figdown 0.2` is not covered**. The rule is
|
|
195
|
+
written now so that it is rehearsed now.
|
|
196
|
+
- **Compatible is not byte-identical.** A `Y` bump may legitimately improve
|
|
197
|
+
rendering while removing nothing: the meaning is unchanged, the picture may
|
|
198
|
+
not be. To recover the exact figure you need the exact engine — which is
|
|
199
|
+
precisely why the per-release archive exists.
|
|
200
|
+
|
|
201
|
+
### What is promised
|
|
202
|
+
|
|
203
|
+
| | **0.x (today)** | **v1.0 and later** |
|
|
204
|
+
|---|---|---|
|
|
205
|
+
| Mechanical migration between language versions | **SHOULD** — best effort | **MUST** |
|
|
206
|
+
| A document staying on an older declared language version | **MAY** — permitted, not promised | **MUST** be honoured; a rewrite is never forced |
|
|
207
|
+
| The archived engine for a release remaining runnable | **MUST** | **MUST** |
|
|
208
|
+
|
|
209
|
+
The middle row is the compatibility promise above; the bottom row is
|
|
210
|
+
availability, and it is the one that does not weaken in 0.x.
|
|
211
|
+
|
|
212
|
+
Two consequences worth planning around:
|
|
213
|
+
|
|
214
|
+
- **The archive is the promise that does not weaken.** Every release gets one
|
|
215
|
+
tag and one immutable, self-contained engine page. A user who wants to stay
|
|
216
|
+
on a language version always can, by running the release that implemented it
|
|
217
|
+
— and that does not depend on any future engine still understanding old
|
|
218
|
+
documents.
|
|
219
|
+
- **Expect one migration at `figdown 1.0`, and none after it** — until a
|
|
220
|
+
`figdown 2.0`, which is the only place a removal may occur and which arrives
|
|
221
|
+
with its own migration.
|
|
222
|
+
|
|
223
|
+
**Stability begins at v1.0.** The full normative policy is
|
|
224
|
+
[`spec/core.md` §13](spec/core.md#13-stability-and-versioning-normative).
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Where to go next
|
|
229
|
+
|
|
230
|
+
Every document below has exactly one reader. Find yourself in the left column
|
|
231
|
+
and read that row; you should not need the others.
|
|
232
|
+
|
|
233
|
+
| If you are… | Read |
|
|
234
|
+
|---|---|
|
|
235
|
+
| **authoring a figure** | [`guide/authoring.md`](guide/authoring.md) — state the meaning, pick a genre, express it, and know when to stop |
|
|
236
|
+
| **an AI agent or a tool reading `.fd`** | [`guide/agents.md`](guide/agents.md), then the reading-agent contract in [`spec/core.md` §12.7](spec/core.md#127-the-reading-agent-contract) — what you may conclude from a document, and what you must not |
|
|
237
|
+
| **handed a `.fd` and needing to read it correctly** | [`read/0.1/reading.md`](read/0.1/reading.md) — nothing to install: that file plus the one for the genre on line 1 ([`bitfield.md`](read/0.1/bitfield.md), [`scene.md`](read/0.1/scene.md) for `block`, `topology` and `flowchart`, [`table.md`](read/0.1/table.md), [`layout.md`](read/0.1/layout.md) for arrangement, [`transcribe.md`](read/0.1/transcribe.md) to go the other way). Reading a `bitfield` costs those two files, ~13 KB, against ~335 KB of specification. `0.1` is the language version they describe; a later `read/0.2/` is added beside them and `read/0.1/` does not change. |
|
|
238
|
+
| **implementing FigDown** | [`spec/core.md`](spec/core.md) for the normative language, then [`conformance/`](conformance/README.md) — golden fixtures designed to be passed without ever reading the reference engine |
|
|
239
|
+
| **evaluating whether to adopt it** | [`guide/showcase.md`](guide/showcase.md) — worked figures, each with its source, what a human sees, what an agent can answer from the text alone, and what the figure still cannot say |
|
|
240
|
+
|
|
241
|
+
Secondary routes, once you are past the first read:
|
|
242
|
+
|
|
243
|
+
| | |
|
|
244
|
+
|---|---|
|
|
245
|
+
| [`guide/expressing.md`](guide/expressing.md) | stuck on one thing mid-document: "I need to show X → use Y", plus what the current language cannot express and the sanctioned interim for each |
|
|
246
|
+
| [`guide/layout.md`](guide/layout.md) | the figure parses but does not read well: the escalation ladder and when to stop climbing it |
|
|
247
|
+
| [`spec/README.md`](spec/README.md) | what is frozen, what is experimental, and what each promises |
|
|
248
|
+
| [`decisions/`](decisions/README.md) | why the language is shaped this way, what was rejected, and what would reopen it |
|
|
249
|
+
| [`examples/`](examples/index.md) | specimens to copy — real `.fd` + `.svg` pairs |
|
|
250
|
+
| [`skill/`](skill/README.md) | installing FigDown into a coding agent |
|
|
251
|
+
| [`tools/`](tools/README.md) | building and checking figures from a command line or in CI |
|
|
252
|
+
| [`dist/`](dist/README.md) | embedding the renderer in your own program |
|
|
253
|
+
| [`integrations/`](integrations/) | wiring FigDown into a documentation pipeline |
|
|
254
|
+
|
|
255
|
+
## Install
|
|
256
|
+
|
|
257
|
+
The renderer is published on npm under the MIT licence:
|
|
258
|
+
|
|
259
|
+
```sh
|
|
260
|
+
npm install -g figdown
|
|
261
|
+
figdown-svg your.fd
|
|
140
262
|
```
|
|
141
263
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
`.fd` for the meaning** and never paste its content into the `.md`.
|
|
145
|
-
Each generated SVG also embeds its own source + SHA-256, so the figure
|
|
146
|
-
file alone can always be reopened and edited. See
|
|
147
|
-
[AGENT-GUIDE.md](AGENT-GUIDE.md) for the full agent-facing workflow.
|
|
148
|
-
|
|
149
|
-
## Status
|
|
150
|
-
|
|
151
|
-
**Requirements & design phase.** Nothing to install yet. Current documents:
|
|
152
|
-
|
|
153
|
-
- [requirements-notes.md](design/requirements-notes.md) — the requirements log
|
|
154
|
-
(R0–R15) and decisions (D1–D3), also in
|
|
155
|
-
[繁體中文](design/requirements-notes.zh-tw.md)
|
|
156
|
-
- [syntax-draft.md](spec/syntax-draft.md) — syntax draft v0.0 (discussion
|
|
157
|
-
stage), also in [繁體中文](spec/syntax-draft.zh-tw.md)
|
|
158
|
-
- [AUTHORING.md](AUTHORING.md) — the authoring SOP: how to pick a
|
|
159
|
-
template, express meaning with existing constructs, and escalate a
|
|
160
|
-
gap into a syntax proposal, also in [繁體中文](AUTHORING.zh-tw.md)
|
|
161
|
-
- [AGENT-GUIDE.md](AGENT-GUIDE.md) — the self-contained guide for AI
|
|
162
|
-
agents maintaining figures with FigDown, also in
|
|
163
|
-
[繁體中文](AGENT-GUIDE.zh-tw.md)
|
|
164
|
-
- [MIGRATIONS.md](spec/MIGRATIONS.md) — schema-migration-style version log:
|
|
165
|
-
every syntax change ships a mechanical rewrite rule, also in
|
|
166
|
-
[繁體中文](spec/MIGRATIONS.zh-tw.md)
|
|
167
|
-
- [census.md](design/census.md) — figure-type census over a real 774-document
|
|
168
|
-
corpus; the empirical basis for v0.1 scope and priorities, also in
|
|
169
|
-
[繁體中文](design/census.zh-tw.md)
|
|
170
|
-
- [spec/genres/](spec/genres/bitfield.md) — per-genre normative documents
|
|
171
|
-
(R51): one self-contained file per genre (bitfield, table, wave) covering
|
|
172
|
-
defaults, closed keyword vocabulary, semantic model, errors, and an example
|
|
173
|
-
- [conformance/](conformance/README.md) — golden parser-conformance
|
|
174
|
-
fixtures (100 cases) a second implementation can be tested against;
|
|
175
|
-
engine-vs-spec deviations recorded in its DISCREPANCIES file
|
|
176
|
-
- [prior-art.md](design/prior-art.md) — informative survey of mainstream
|
|
177
|
-
diagram-language conventions (edge labels, ERD, D2 relationship),
|
|
178
|
-
weighted by adoption, also in [繁體中文](design/prior-art.zh-tw.md)
|
|
179
|
-
- [examples/index.md](examples/index.md) — the example gallery: real
|
|
180
|
-
figures as committed `.fd`+`.svg` pairs (protocol headers first)
|
|
181
|
-
- [editor/figdown.html](editor/figdown.html) — the editor
|
|
182
|
-
([live](https://figdown.github.io/figdown/)): open in any
|
|
183
|
-
browser, edit text on the left, get a deterministic SVG on the right
|
|
184
|
-
(core scene + bitfield + table + wave). Opens/saves `.fd` files
|
|
185
|
-
(Ctrl+S writes back to the same file), undo/redo, autosave,
|
|
186
|
-
draw.io-style direct manipulation where every GUI action is a text
|
|
187
|
-
edit. The exported SVG embeds its own source and SHA-256.
|
|
188
|
-
- [skill/README.md](skill/README.md) — installable agent skill: teach
|
|
189
|
-
a coding agent (e.g. Claude Code) to maintain figures with FigDown —
|
|
190
|
-
`cp -r skill/figdown ~/.claude/skills/` and ask for a figure.
|
|
264
|
+
No network access and no other dependency is needed to render. The browser
|
|
265
|
+
editor is a single self-contained HTML file; the CLI needs only Node.js.
|
|
191
266
|
|
|
192
267
|
## Contributing
|
|
193
268
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
269
|
+
Proposals, counter-examples and prior-art pointers are welcome. The registry is
|
|
270
|
+
closed by design, so a change arrives fastest when it brings evidence — see
|
|
271
|
+
[`.github/CONTRIBUTING.md`](.github/CONTRIBUTING.md) for what a proposal must
|
|
272
|
+
carry and how a frozen construct differs from an experimental one.
|
|
273
|
+
|
|
274
|
+
The most valuable contributions right now are diagram types the standard must
|
|
275
|
+
cover (with real samples), existing conventions it should borrow instead of
|
|
276
|
+
invent, and attacks on the axioms above — tell us where they break.
|
|
277
|
+
|
|
278
|
+
Security reports go through [`.github/SECURITY.md`](.github/SECURITY.md), never
|
|
279
|
+
a public issue.
|
|
280
|
+
|
|
281
|
+
## Licence
|
|
198
282
|
|
|
199
|
-
|
|
200
|
-
- existing standards/conventions we should borrow instead of invent,
|
|
201
|
-
- attacks on the axioms above (tell us where they break).
|
|
283
|
+
MIT — see [LICENSE](LICENSE).
|