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 32 additions and 18 deletions
Showing only changes of commit 0b8dea0d04 - Show all commits
+1
View File
@@ -44,6 +44,7 @@ In [docs/decisions.md](docs/decisions.md):
- The CLI reads only the library's public API - The CLI reads only the library's public API
- A template that does not compile is misuse (exit 2), including a reference that resolves to nothing, save a lone reference under the CLI's `--format` until item 129 - A template that does not compile is misuse (exit 2), including a reference that resolves to nothing, save a lone reference under the CLI's `--format` until item 129
- Whitespace around a JSON template is dropped, in `NewTemplate` and on stdin - Whitespace around a JSON template is dropped, in `NewTemplate` and on stdin
- A JSON string stays a template even where its bare text renders alike
- `FakeTemplate` and `NewTemplate` both stay - `FakeTemplate` and `NewTemplate` both stay
- The shipped data is embedded, not discovered - The shipped data is embedded, not discovered
- With only the shipped set, a category loads on the first call reaching it; beside a `--data-path`, every category loads in `New` - With only the shipped set, a category loads on the first call reaching it; beside a `--data-path`, every category loads in `New`
+25 -17
View File
@@ -65,8 +65,7 @@ can never collide with any of those spellings, and the leading `[` or `"` is gat
valid JSON so a stray copied bracket never swallows a tag — it names nothing, and says valid JSON so a stray copied bracket never swallows a tag — it names nothing, and says
so. Reserving the characters whole — though only a leading one so. Reserving the characters whole — though only a leading one
could collide — keeps one simple name rule instead of a leading-position special case. could collide — keeps one simple name rule instead of a leading-position special case.
A JSON string stays a template even where its bare text renders alike, `"x {/a}"` beside A folder-relative `{.name}` or `{..name}` is refused naming
`x {/a}`: its escapes put a tab or a newline on one `echo` line. A folder-relative `{.name}` or `{..name}` is refused naming
`{/name}`, since an inline template sits in no folder. `IsTemplate` exports the rule, so `{/name}`, since an inline template sits in no folder. `IsTemplate` exports the rule, so
struct tags and any other caller read one. struct tags and any other caller read one.
@@ -102,9 +101,9 @@ template per run.
2026-10-07, Lilleman auf Larv. Serves goal 9.6: a CLI carrying your own modules is a few 2026-10-07, Lilleman auf Larv. Serves goal 9.6: a CLI carrying your own modules is a few
lines of Go and works just like `fejkdata`, so `fejkdata`'s own CLI is such a CLI and lines of Go and works just like `fejkdata`, so `fejkdata`'s own CLI is such a CLI and
imports nothing under `internal/`. Where it needs a reading the API does not export yet, imports nothing under `internal/`. It copies one reading the API does not export yet,
it copies it, and a test pins the copy to the grammar it copies: `isPath` in the lone reference: `isPath` and `withoutSelectors` in `cmd/fejkdata`, pinned to the
`cmd/fejkdata`, until `todo.md` item 129 moves the lone reference into the library. grammar by a test, until `todo.md` item 129 moves that reading into the library.
## A template that does not compile is misuse (exit 2), including a reference that resolves to nothing, save a lone reference under the CLI's `--format` until item 129 ## A template that does not compile is misuse (exit 2), including a reference that resolves to nothing, save a lone reference under the CLI's `--format` until item 129
@@ -123,6 +122,14 @@ template that parses as JSON is its JSON, so its padding is dropped, as `encodin
drops it. Goal 5.7 refuses only a spelling that suggests a mistake, and padding around drops it. Goal 5.7 refuses only a spelling that suggests a mistake, and padding around
JSON suggests none. JSON suggests none.
## A JSON string stays a template even where its bare text renders alike
2026-10-07, Lilleman auf Larv. Serves goal 5.7: only an obvious mistake fails to load.
`"x {/a}"` and `x {/a}` render alike on stdin, in `NewTemplate` and in a struct tag. The
quotes are no mistake: inside them `\t` and `\n` write a tab or a newline where the
template is one line of a Go string, a struct tag or a file.
## `FakeTemplate` and `NewTemplate` both stay ## `FakeTemplate` and `NewTemplate` both stay
2026-09-03, Lilleman auf Larv. 2026-09-03, Lilleman auf Larv.
@@ -296,9 +303,9 @@ refuses them there too.
2026-09-24, Lilleman auf Larv; narrowed 2026-10-07. Serves goal 5.7. 2026-09-24, Lilleman auf Larv; narrowed 2026-10-07. Serves goal 5.7.
`int(5,5)` and `float(1,1,2)` draw nothing, which suggests a range typed wrong, so each is `int(5,5)` and `float(1,1,2)` draw nothing, which suggests a range typed wrong, so each is
rejected naming the constant. A default written out, `weight: 1`, `repeat: 1`, rejected naming the constant. A default written out, `weight: 1`, `repeat: 1` or
`separator: ""` or `datatype: "string"`, and a number spelled `+5` or `05`, load as the `separator: ""`, loads wherever it is written, and a number spelled `+5` or `05` loads as
shorter form, as the CLI's `--seed 007` and `--repeat +3` do. `5`, as the CLI's `--seed 007` and `--repeat +3` do.
## Samples say what they emit, transforms what they do ## Samples say what they emit, transforms what they do
@@ -318,8 +325,8 @@ path. The `format` is inert to a record — a record-only template writes `"form
but it is compiled and fenced, so a template that loads renders as whichever shape is but it is compiled and fenced, so a template that loads renders as whichever shape is
asked for. `FakeStruct` takes its columns from a struct instead, because a Go caller has asked for. `FakeStruct` takes its columns from a struct instead, because a Go caller has
already written that schema: the fields name the columns and their types are the already written that schema: the fields name the columns and their types are the
datatypes, so a tag says only what to draw, and a `datatype` in it would be a second datatypes, so a tag says only what to draw: a `datatype` in it loads where it names the
spelling of the type. The Go type is a struct column's one datatype, so its items need one the Go type sets, and is refused where it names another. The Go type is a struct column's one datatype, so its items need
not agree on one among themselves; each must only hold that type. not agree on one among themselves; each must only hold that type.
## A struct's records follow Go's field access, and compile on first use ## A struct's records follow Go's field access, and compile on first use
@@ -367,15 +374,16 @@ to agree.
2026-09-15, Lilleman auf Larv. 2026-09-15, Lilleman auf Larv.
A null is one more outcome of a column's draw, so a choice's weights skew it like any A null is one more outcome of a column's draw, so a choice's weights skew it like any
other; a null-rate option would be a second way to state odds. other; a null-rate option would be a second way to state odds. Outside a record column a
null never renders as null, so it is refused naming `""` (goal 5.7).
## A typed column holds one value, not composed text ## A typed column holds one value, not composed text
2026-09-15, Lilleman auf Larv. 2026-09-15, Lilleman auf Larv.
Its bounds come from a literal or a call's arguments, so a load error names a real Its bounds come from a literal or a call's arguments, so a load error names a real
value, a range check is one comparison, and `1{digits(2)}` is a second spelling of value and a range check is one comparison: `1{digits(2)}` is refused in a typed column,
`{int(100,199)}`. where `{int(100,199)}` states its range.
## A column that only reads one reference or name is the column it reads ## A column that only reads one reference or name is the column it reads
@@ -629,11 +637,11 @@ Table section teaches it.
## A layout is always quoted ## A layout is always quoted
2026-09-18, Lilleman auf Larv. 2026-09-18, Lilleman auf Larv. Serves goal 5.6.
A layout may carry the comma that separates arguments, `'January 2, 2006'`, and one A layout may carry the comma that separates arguments,
spelling for every layout beats a rule about which ones need the quotes, so the bare `'January 2, 2006'`, and a bare `2006-01-02` reads like a third date, so a bare layout is
spelling is refused naming the quoted one. The layout is Go's reference time because the refused naming the quoted one. The layout is Go's reference time because the
library renders with it and a Go caller already knows it; its names are English, and a library renders with it and a Go caller already knows it; its names are English, and a
locale's own month and weekday names are data. locale's own month and weekday names are data.
+6 -1
View File
@@ -6,7 +6,7 @@
`Bar = 9` `Bar = 9`
`Next ID = 160` `Next ID = 161`
| Goal | W | | Goal | W |
|---|---| |---|---|
@@ -119,6 +119,7 @@
| 22 | 0.2.0 | | **Give `url` and `email` a path that draws only domains nobody can register, keeping the wide set as the default.** | 3 | 4 | 7 | 8 | 16 | 14.0 | | 22 | 0.2.0 | | **Give `url` and `email` a path that draws only domains nobody can register, keeping the wide set as the default.** | 3 | 4 | 7 | 8 | 16 | 14.0 |
| 46 | 0.2.0 | | **Report the same error every load for a table with two bad options, and for a folder with two unnamed rows files.** | 2 | 2 | 3 | 7 | 6, 10 | 14.0 | | 46 | 0.2.0 | | **Report the same error every load for a table with two bad options, and for a folder with two unnamed rows files.** | 2 | 2 | 3 | 7 | 6, 10 | 14.0 |
| 158 | 0.2.0 | | **Drop a UTF-8 byte order mark that starts stdin, and say in the README how to stop PowerShell 5.1 sending `Göteborg` as `G?teborg`.** | 2 | 2 | 4 | 5 | 7.2, 5.1 | 13.5 | | 158 | 0.2.0 | | **Drop a UTF-8 byte order mark that starts stdin, and say in the README how to stop PowerShell 5.1 sending `Göteborg` as `G?teborg`.** | 2 | 2 | 4 | 5 | 7.2, 5.1 | 13.5 |
| 160 | 0.2.0 | | **Refuse a sample whose range rounds or formats to one value, `float(1,1.004,2)` or a year-only `date` layout over days of one year, naming the constant.** | 2 | 2 | 3 | 6 | 5.7 | 13.1 |
| 79 | 0.2.0 | decision | **Beside a `--data-path`, load in `New` the user's categories, the shipped ones they override or read, and the shipped ones whose reads reach an overridden one; load the rest on first reach.** | 6 | 6 | 7 | 8 | 13 | 12.9 | | 79 | 0.2.0 | decision | **Beside a `--data-path`, load in `New` the user's categories, the shipped ones they override or read, and the shipped ones whose reads reach an overridden one; load the rest on first reach.** | 6 | 6 | 7 | 8 | 13 | 12.9 |
| 27 | 0.2.0 | | **Merge `en_US.ip` and `sv_SE.ip`, today byte-identical, into one `misc.ip`.** | 3 | 2 | 4 | 6 | 8 | 12.3 | | 27 | 0.2.0 | | **Merge `en_US.ip` and `sv_SE.ip`, today byte-identical, into one `misc.ip`.** | 3 | 2 | 4 | 6 | 8 | 12.3 |
| 107 | 0.2.0 | decision | **Move the template engine into `internal/`, leaving the root the public API and its options.** | 6 | 9 | 3 | 8 | 3.2, 3.4 | 12.2 | | 107 | 0.2.0 | decision | **Move the template engine into `internal/`, leaving the root the public API and its options.** | 6 | 9 | 3 | 8 | 3.2, 3.4 | 12.2 |
@@ -450,6 +451,10 @@ On stdin `42` is refused as "a number", which does not name the text the author
A file a Windows editor saves with a BOM prints an invisible U+FEFF first, and a JSON template with one is read as a format string. PowerShell 5.1 encodes what it pipes to a program by `$OutputEncoding`, ASCII by default. The maintainer chose 0.2.0 on 2026-10-07. A file a Windows editor saves with a BOM prints an invisible U+FEFF first, and a JSON template with one is read as a format string. PowerShell 5.1 encodes what it pipes to a program by `$OutputEncoding`, ASCII by default. The maintainer chose 0.2.0 on 2026-10-07.
### 160. Refuse a sample whose range rounds or formats to one value, `float(1,1.004,2)` or a year-only `date` layout over days of one year, naming the constant.
Goal 5.7's own example, a range with nothing to draw. Today only `lo == hi` and `from == to` are refused. The goals audit of the narrowed goal 5.7 found it.
### 79. Beside a `--data-path`, load in `New` the user's categories, the shipped ones they override or read, and the shipped ones whose reads reach an overridden one; load the rest on first reach. ### 79. Beside a `--data-path`, load in `New` the user's categories, the shipped ones they override or read, and the shipped ones whose reads reach an overridden one; load the rest on first reach.
Needs item 77, which makes an override fail unless it says it replaces. Needs item 77, which makes an override fail unless it says it replaces.