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 14 additions and 3 deletions
Showing only changes of commit 1c358d7b16 - Show all commits
+1
View File
@@ -41,6 +41,7 @@ In [docs/decisions.md](docs/decisions.md):
- Flags follow getopt_long - Flags follow getopt_long
- A struct tag is a template by its shape - A struct tag is a template by its shape
- The CLI renders exactly the template on its stdin, and adds nothing - The CLI renders exactly the template on its stdin, and adds nothing
- 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
- `FakeTemplate` and `NewTemplate` both stay - `FakeTemplate` and `NewTemplate` both stay
+4 -2
View File
@@ -908,8 +908,10 @@ Where the project is heading; the sections before Audience document what ships t
5. `[SE]` selects one row of a table, and means that row wherever you write it. 5. `[SE]` selects one row of a table, and means that row wherever you write it.
6. If two people could read a template differently, loading it fails, and the 6. If two people could read a template differently, loading it fails, and the
error shows how to write each meaning. error shows how to write each meaning.
7. A spelling that suggests you meant something else — such as a range with nothing 7. A spelling that suggests you meant something else fails to load, and the error
to draw, `int(5,5)` — fails to load, and the error shows what to write. shows what to write. Such a spelling holds a part that does nothing where it is
written, such as a range with nothing to draw, `int(5,5)`; a default written out
is not one.
8. When a clearer name turns up, it replaces the old one, even if that needs a new 8. When a clearer name turns up, it replaces the old one, even if that needs a new
major version. major version.
9. Everything fejkdata renders is written as a template: on the command line, in a 9. Everything fejkdata renders is written as a template: on the command line, in a
+9 -1
View File
@@ -85,7 +85,7 @@ adding one: a rule a user states in one sentence, at the cost of `printf` or a
A JSON template is its JSON, so the whitespace around it is no part of the template, per A JSON template is its JSON, so the whitespace around it is no part of the template, per
the decision "Whitespace around a JSON template is dropped, in `NewTemplate` and on the decision "Whitespace around a JSON template is dropped, in `NewTemplate` and on
stdin". Stdin holding only whitespace is misuse, since an unset variable sends just a stdin". Stdin holding only whitespace is misuse, since an unset variable sends just a
newline. newline, and so is stdin holding only `null`, which `jq` prints for a missing key.
A lone reference, `{/users}` or `"{/users}"`, names the record `users` under `--format`, A lone reference, `{/users}` or `"{/users}"`, names the record `users` under `--format`,
one newline after it allowed, with `users` the default `--table`; one to nothing there one newline after it allowed, with `users` the default `--table`; one to nothing there
@@ -98,6 +98,14 @@ piped in otherwise; so is a terminal with nothing piped in, which would otherwis
typed input. `--list` prints paths, each read as `{/path}`. Valid while the CLI reads one typed input. `--list` prints paths, each read as `{/path}`. Valid while the CLI reads one
template per run. template per run.
## The CLI reads only the library's public API
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
imports nothing under `internal/`. Where it needs a reading the API does not export yet,
it copies it, and a test pins the copy to the grammar it copies: `isPath` in
`cmd/fejkdata`, until `todo.md` item 129 moves the lone reference 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
2026-09-24, Lilleman auf Larv. 2026-09-24, Lilleman auf Larv.