feat(11.1-02): check module identifiers in docs and READMEs

- go/parser index of every modules/ package and sub-package, with methods,
  fields, interface methods and promoted members
- code spans in docs pages, module READMEs and the root README fail
  Check and docs:build when the named identifier does not exist
- scripts/check-phase11.1.sh with preconditions, deps, docs, forbidden,
  go and a self-test that plants one violation per rule
This commit is contained in:
Jakub Zych
2026-09-30 21:35:56 +02:00
parent 9dcc101776
commit f4605292b5
6 changed files with 757 additions and 0 deletions

View File

@@ -253,6 +253,13 @@ func (s *site) parsePage(md goldmark.Markdown, p *Page) (ast.Node, *pageContext)
return doc, pctx
}
// parseRaw parses a Markdown body with the renderer's parser and slug IDs
// but no page context, so link destinations stay as written.
func (s *site) parseRaw(md goldmark.Markdown, body []byte) ast.Node {
ctx := parser.NewContext(parser.WithIDs(newSlugIDs()))
return md.Parser().Parse(text.NewReader(body), parser.WithContext(ctx))
}
// renderPage parses and renders a page body to HTML.
func (s *site) renderPage(md goldmark.Markdown, p *Page) (renderedPage, error) {
doc, pctx := s.parsePage(md, p)