Make great documentation goal 1.2, and plan the README's reorganisation and the nested-template gaps #33

Open
lilleman wants to merge 966 commits from worktree-todo-relative-dates-exact-counts into main
3 changed files with 25 additions and 16 deletions
Showing only changes of commit 4ec20e6e3a - Show all commits
+5 -6
View File
@@ -823,17 +823,16 @@ the Development section below, and who ships a register the four above then draw
3. **Valid by construction** — every value passes the check its real consumer 3. **Valid by construction** — every value passes the check its real consumer
applies; facts that belong together come from one draw, within a value and applies; facts that belong together come from one draw, within a value and
across categories. across categories.
4. **Templates are intuitive, and text means what it says** — a template, and every 4. **Templates are intuitive, and text means what it says** — a template or a path,
path in it, renders what every writer reading it would expect, judged by simulated and every path in a template, renders what every writer reading it would expect,
writers from the Audience. judged by simulated writers from the Audience. A format renders as written; only `{…}` varies, random characters included
A format renders as written; only `{…}` varies, random characters included
(`{digits(3)}`), and a selected row, `[SE]`, is that row wherever it is written. (`{digits(3)}`), and a selected row, `[SE]`, is that row wherever it is written.
Where two writers could expect different outputs, the template is a load error Where two writers could expect different outputs, the template is a load error
naming a spelling for each. One spelling per result; the wrong one is a load error naming a spelling for each. One spelling per result; the wrong one is a load error
naming the right one. naming the right one.
5. **Every mistake is a load error** — `New` rejects the data and `NewTemplate` 5. **Every mistake is a load error** — `New` rejects the data and `NewTemplate`
the inline template; on a loaded generator `Fake` fails only for an unknown the inline template; on a loaded generator `Fake` fails only for a path that
path, `FakeStruct` only for a non-struct argument or a type its tags do not names nothing or could name two things, `FakeStruct` only for a non-struct argument or a type its tags do not
describe, with the same error every call, and `Template.Fake` cannot fail at all. describe, with the same error every call, and `Template.Fake` cannot fail at all.
6. **Zero to a value in one command** — `go install`, then `fejkdata sv_SE.person`: 6. **Zero to a value in one command** — `go install`, then `fejkdata sv_SE.person`:
no checkout, no flag. Flags are GNU-form (`--seed 42`, `-n 3`) in any position; no checkout, no flag. Flags are GNU-form (`--seed 42`, `-n 3`) in any position;
+12 -8
View File
@@ -383,16 +383,20 @@ case but the last, where two expected a render and all three accepted the refusa
## A link column after a row steps up to the parent row, and a path may not end on it ## A link column after a row steps up to the parent row, and a path may not end on it
Decided 2026-09-27 by the maintainer, for goal 4; valid while a link column holds the Decided 2026-09-27 by the maintainer, for goal 4; valid while a link column holds the
parent's key. parent's key. It extends [After a row, a path names a column or a linked
table](#after-a-row-a-path-names-a-column-or-a-linked-table) from child tables to the
parent. A row is selected or drawn alike.
- Where a segment follows, the link column's name reads the parent row, one level per - Where a segment follows, the link column's name reads the parent row, one level per
step, chained: `city[Oslo].country.name` renders `Norway`, and step, chained: `city[Oslo].country.name` renders `Norway`, `locality.municipality.name`
`geo.SE.locality[Lund].municipality.region.name` Lund's region. the drawn locality's municipality, and `geo.SE.locality[Lund].municipality.region.name`
- A path ending on it is refused, naming the parent's key column and the columns its Lund's region. The parent row of a selected row is fixed as the selection is, so
format reads: `city[Oslo].country` could be `NO` or `Norway`, so the error names `city[Oslo].country.city.name` draws a city of Norway, which may not be Oslo.
`city[Oslo].country.alpha2` and `city[Oslo].country.name`. - A path ending on it is refused at `New`, `NewTemplate` and `Fake` alike, naming the
- A route through another row is not a second spelling of a selection: parent's key column and the parent's format spelled as paths: with a `country` format
`city[Oslo].country.name` and `country[NO].name` both load, as `[1281]` and `[Lund]` do. of `{name} ({alpha2})`, `city[Oslo].country` names `city[Oslo].country.alpha2` and
`{/city[Oslo].country.name} ({/city[Oslo].country.alpha2})`. `List` leaves such a path
out, and a record's link column still holds the key, since it is a column, not a path.
Checked against three simulated template writers from the Audience: all three read the Checked against three simulated template writers from the Audience: all three read the
parent row where a segment followed, and they split between the code and the name where parent row where a segment followed, and they split between the code and the name where
+8 -2
View File
@@ -174,8 +174,10 @@ by a `data-import/` script, as README goal 12 asks.
- Step up from a row to its parent as the decision "A link column after a row steps up - Step up from a row to its parent as the decision "A link column after a row steps up
to the parent row, and a path may not end on it" states: `city[Oslo].country.name` is to the parent row, and a path may not end on it" states: `city[Oslo].country.name` is
a load error today, and `city[Oslo].country` renders the cell `NO`. Correct the a load error today, and `city[Oslo].country` renders the cell `NO`, as
README's `city[Oslo].country` example to match. `locality.municipality` does, which `List` advertises. Replace the README's
`city[Oslo].country` example with `fejkdata -d ./mydata 'city[Oslo].country.name'`,
rendering `Norway`.
- Render selected rows as the decision "A selected row is fixed, not drawn, and an - Render selected rows as the decision "A selected row is fixed, not drawn, and an
unnamed read beside it is refused" states: `New` refuses unnamed read beside it is refused" states: `New` refuses
`{/misc.territory[SE].capital} / {/misc.territory[FI].capital}` today, and a choice `{/misc.territory[SE].capital} / {/misc.territory[FI].capital}` today, and a choice
@@ -225,6 +227,10 @@ by a `data-import/` script, as README goal 12 asks.
### Open questions to settle ### Open questions to settle
- Decide whether a route through another row is a second spelling of one result:
`city[Oslo].country.name` and `country[NO].name` always render `Norway`, and goal 4
refuses a second spelling, while `country[NO]` and `country[Norway]` both select one
row today.
- Decide whether a goal 5 violation joins the comprehension gate's exception list: the - Decide whether a goal 5 violation joins the comprehension gate's exception list: the
`{/sel}|{/sel}` panic waits behind the whole round at 5.9, and `{/sel}|{/sel}` panic waits behind the whole round at 5.9, and
`{/geo.SE.locality}|{/geo.SE.municipality}` mispairs the shipped data meanwhile, though a `{/geo.SE.locality}|{/geo.SE.municipality}` mispairs the shipped data meanwhile, though a