feat(11.1-02): check links, commands, forbidden names and fence policy

- relative links and anchors resolve against the renderer's heading IDs
- summer and ./bin/<app> command names come from the real command
  constructors through docsite.Options.Commands; a nil set is a problem
- consuming-application names fail in page sources and built outputs
- go fences in docs/ pages need src=, callouts are NOTE, TIP or WARNING,
  docs/ headings are plain ASCII
- gate gains --claude and self-test plants for each new rule
This commit is contained in:
Jakub Zych
2026-09-30 21:40:46 +02:00
parent f4605292b5
commit 5d4c1e3046
12 changed files with 808 additions and 14 deletions

View File

@@ -34,6 +34,9 @@ type Options struct {
Out string
// BaseURL overrides site.yaml base_url when non-empty.
BaseURL string
// Commands is the set of summer and application command names pages
// may show. Check and Build report a problem when it is nil.
Commands *Commands
}
// Problem is one finding in the docs source, printed as
@@ -230,7 +233,9 @@ func writeOutputs(out string, files map[string][]byte) error {
}
// checkContent runs the accuracy checkers over every page and the root
// README.md: module identifiers named in code spans.
// README.md: module identifiers, links and anchors, command names,
// consuming-application names in the sources, and the fence, callout and
// heading policy.
func (s *site) checkContent() ([]Problem, error) {
docs, err := s.parseDocs()
if err != nil {
@@ -241,6 +246,18 @@ func (s *site) checkContent() ([]Problem, error) {
return nil, err
}
problems = append(problems, s.checkIdentifiers(idx, docs)...)
problems = append(problems, s.checkLinks(docs)...)
cp, err := s.checkCommands(docs)
if err != nil {
return nil, err
}
problems = append(problems, cp...)
fp, err := s.checkForbiddenSources()
if err != nil {
return nil, err
}
problems = append(problems, fp...)
problems = append(problems, s.checkPolicy(docs)...)
return problems, nil
}