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 6 additions and 16 deletions
Showing only changes of commit 94c8bd229d - Show all commits
+1 -1
View File
@@ -257,7 +257,7 @@ func checkNodeFences(s nodeScope) error {
return err
}
if refs {
if err := s(checkOwnFamilies); err != nil {
if err := s(checkOwnFamily); err != nil {
return err
}
if err := s(fence.checkDraws); err != nil {
-11
View File
@@ -24,17 +24,6 @@ func (f *drawFence) checkDrawGroup(path string, n node) error {
return nil
}
func checkOwnFamilies(path string, n node) error {
t, ok := n.(*template)
if !ok {
return nil
}
if err := checkOwnFamily(t); err != nil {
return fmt.Errorf("%s: %w", path, err)
}
return nil
}
func (f *drawFence) checkDraws(path string, n node) error {
t, ok := n.(*template)
if !ok {
+5 -4
View File
@@ -258,11 +258,12 @@ func checkFamilies(reads []pathRead) error {
// read draws its row without pinning it, so the family would draw apart from the row
// it renders, whichever draws the reaching template holds.
// docs/decisions.md#a-table-never-reaches-its-own-family-by-any-route
func checkOwnFamily(t *template) error {
own := t.site.table
if own == nil {
func checkOwnFamily(path string, n node) error {
t, isTemplate := n.(*template)
if !isTemplate || t.site.table == nil {
return nil
}
own := t.site.table
seen := map[node]bool{}
var find func(n node) (renderEdge, *table, bool)
find = func(n node) (renderEdge, *table, bool) {
@@ -283,7 +284,7 @@ func checkOwnFamily(t *template) error {
return renderEdge{}, nil, false
}
if e, familyTable, found := find(t); found {
return fmt.Errorf("%s reads %s, a table of its own family, which a bare 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(), familyTable.segment, own.segment)
return fmt.Errorf("%s: %s reads %s, a table of its own family, which a bare 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", path, e.reached(), familyTable.segment, own.segment)
}
return nil
}