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
6 changed files with 14 additions and 17 deletions
Showing only changes of commit 8312b44a43 - Show all commits
-1
View File
@@ -71,7 +71,6 @@ In [docs/decisions.md](docs/decisions.md):
- A selector is bracketed, and a dot inside it is literal - A selector is bracketed, and a dot inside it is literal
- `parent` names the link column and the table alike - `parent` names the link column and the table alike
- After a row, a path names a column or a linked table - After a row, a path names a column or a linked table
- A table read into is pinned; a table read whole draws afresh
- Every reference path into one family selects the same rows, per render and group - Every reference path into one family selects the same rows, per render and group
- A parent row with no child row is a load error - A parent row with no child row is a load error
- The choice-of-rows fence guards a data file's root, and requires string fields - The choice-of-rows fence guards a data file's root, and requires string fields
+3 -3
View File
@@ -546,9 +546,9 @@ table another path in the group selects a row of, `{/city.name}` beside
also refuses a link cell that is no key of the parent, a parent row no child links also refuses a link cell that is no key of the parent, a parent row no child links
to, a chain of parents that closes, a table named like a column of any table above to, a chain of parents that closes, a table named like a column of any table above
it, and a cell or format of a table that references a table of its own family, through it, and a cell or format of a table that references a table of its own family, through
any template, a `repeat` or a `drawGroup` included, since a row rendered whole would any template, a `repeat` or a `drawGroup` included, since a whole read of the table
draw the family apart from itself: read the family from a template beside it, or add would draw the family apart from the row it renders: read the family from a template
the value as a column. A cell's reads are the render's too; which pairs are weighed beside it, or add the value as a column. A cell's reads are the render's too; which pairs are weighed
against each other is under [Decisions](docs/decisions.md#the-rows-of-a-table-are-alternatives). against each other is under [Decisions](docs/decisions.md#the-rows-of-a-table-are-alternatives).
### Options and fields ### Options and fields
-8
View File
@@ -359,14 +359,6 @@ folder or another column name would be asking for a second spelling.
today; admitting it later is additive, since a refused spelling gains a meaning and no today; admitting it later is additive, since a refused spelling gains a meaning and no
accepted one changes, so the door stays open for the address records the plan describes. accepted one changes, so the door stays open for the address records the plan describes.
## A table read into is pinned; a table read whole draws afresh
A path into a table pins its row for the render and group, as a reference path pins its
level, and a bare `{/city}` draws a row each time and pins no row of its family, as a
bare reference does; so a bare table beside a path into its family is refused like a
bare reference beside a path into it. A bare table reference still counts as a read for
a `drawGroup`, since the group is what draws it apart from the family's pins.
## Every reference path into one family selects the same rows, per render and group ## Every reference path into one family selects the same rows, per render and group
A selector pins rows for the render, and a read that draws freely before it could pin a A selector pins rows for the render, and a read that draws freely before it could pin a
+5 -5
View File
@@ -145,7 +145,7 @@ func (r *tableRead) replay(d *pinSet) error {
// checkFamilyPair refuses a table read whole beside a path into its family, and a // checkFamilyPair refuses a table read whole beside a path into its family, and a
// table one read draws that the other pins, since which token renders first would // table one read draws that the other pins, since which token renders first would
// then decide the row. // then decide the row.
// docs/decisions.md#a-table-read-into-is-pinned-a-table-read-whole-draws-afresh // docs/decisions.md#a-bare-reference-draws-each-time-a-reference-path-is-held
func checkFamilyPair(a, b pathRead) error { func checkFamilyPair(a, b pathRead) error {
for _, pair := range [][2]pathRead{{a, b}, {b, a}} { for _, pair := range [][2]pathRead{{a, b}, {b, a}} {
x, y := pair[0], pair[1] x, y := pair[0], pair[1]
@@ -180,9 +180,9 @@ func (r *tableRead) drawnOf(pins *pinSet) *table {
} }
// checkOwnFamily refuses a table's format or cell that reads, however many templates // checkOwnFamily refuses a table's format or cell that reads, however many templates
// away and through a repeat or a draw group too, a table of its own family: a row // away and through a repeat or a draw group too, a table of its own family: a whole
// rendered whole draws its row without pinning it, so the family would draw apart // read draws its row without pinning it, so the family would draw apart from the row
// from the row being rendered, whichever draws the reaching template holds. // it renders, whichever draws the reaching template holds.
// docs/decisions.md#a-table-never-reaches-its-own-family-by-any-route // docs/decisions.md#a-table-never-reaches-its-own-family-by-any-route
func checkOwnFamily(t *template) error { func checkOwnFamily(t *template) error {
own := t.table own := t.table
@@ -212,7 +212,7 @@ func checkOwnFamily(t *template) error {
return renderEdge{}, nil, false return renderEdge{}, nil, false
} }
if e, head, found := find(t); found { if e, head, found := find(t); found {
return fmt.Errorf("%s reads %s, a table of its own family, which a row of %s rendered whole would draw apart from; read the family from a template beside it, or add the value as a column", e.reached(), head.category, own.category) return fmt.Errorf("%s reads %s, a table of its own family, which a whole read of %s would draw apart from the row it renders; read the family from a template beside it, or add the value as a column", e.reached(), head.category, own.category)
} }
return nil return nil
} }
+1
View File
@@ -8,6 +8,7 @@ import (
"testing" "testing"
) )
// docs/decisions.md#one-name-one-meaning
func TestNoFunctionSpellsAMethod(t *testing.T) { func TestNoFunctionSpellsAMethod(t *testing.T) {
funcs, methods := declaredCalls(namespaceFiles(t)) funcs, methods := declaredCalls(namespaceFiles(t))
names := make([]string, 0, len(funcs)) names := make([]string, 0, len(funcs))
+5
View File
@@ -47,6 +47,11 @@ This round, in order:
where `NewTemplate` and `NewRecordTemplate` do not, and `List` claims to be every where `NewTemplate` and `NewRecordTemplate` do not, and `List` claims to be every
path `Fake` accepts, which a selector is too. Delete the dead `table.descends` and path `Fake` accepts, which a selector is too. Delete the dead `table.descends` and
the redundant `string(key)` in `checkNoRepeatedItem`. the redundant `string(key)` in `checkNoRepeatedItem`.
- Keep only the standing choice in the decision "The rows of a table are alternatives",
a choice's items refused as alternatives, and give it the goal it serves: the rest
defines `alternatives`, which its comment in `family.go` already does, and the README's
"which pairs are weighed against each other" sends a reader to the log for that
definition.
- Run the nine-seat panel again and file what it names here. - Run the nine-seat panel again and file what it names here.
### Data ### Data