Documentation
¶
Overview ¶
Package glossary derives the brief glossary's own index from the term files.
`.abcd/development/brief/glossary/` is the project's one canonical glossary: one Markdown file per term, grouped by bounded context, each carrying the frontmatter the `GL002` forbidden-synonym rule reads (`internal/core/lint`). Its README used to enumerate the contexts and the terms by hand, which is a second copy of what the directory already states — this package makes the directory the source and the README a render of it, so a term file that lands without an index row fails the build instead of going unlisted.
It is transport-agnostic like the rest of `core/`: it reads the working tree and returns strings; nothing here writes to stdout or to the README.
Index ¶
Constants ¶
const ( // DirRelPath is the canonical glossary's repo-relative home (adr-30). DirRelPath = ".abcd/development/brief/glossary" // READMERelPath is the index page that carries the rendered blocks. READMERelPath = DirRelPath + "/README.md" // LayoutMarkerBegin and LayoutMarkerEnd delimit the rendered directory // layout inside the glossary README. LayoutMarkerBegin = "<!-- BEGIN GENERATED: glossary-layout -->" LayoutMarkerEnd = "<!-- END GENERATED: glossary-layout -->" // IndexMarkerBegin and IndexMarkerEnd delimit the rendered term index // inside the glossary README. IndexMarkerBegin = "<!-- BEGIN GENERATED: glossary-index -->" IndexMarkerEnd = "<!-- END GENERATED: glossary-index -->" )
Variables ¶
This section is empty.
Functions ¶
func RenderIndex ¶
RenderIndex returns the term index — one subsection and table per bounded context — exactly as it appears between the index markers in the README.
func RenderLayout ¶
RenderLayout returns the glossary's directory layout as a fenced tree, exactly as it appears between the layout markers in the glossary README.
Types ¶
type Context ¶
type Context struct {
// Name is the directory name, which every member's `bounded_context` matches.
Name string
// Files are the context directory's Markdown files, sorted — term files and
// the context README alike, so the rendered layout matches the directory.
Files []string
// Terms are the context's term files, sorted by file name.
Terms []Term
}
Context is one bounded context: a directory of term files.
type Glossary ¶
type Glossary struct {
// RootFiles are the Markdown files at the glossary root (the README and the
// term template), sorted.
RootFiles []string
// Contexts are the bounded-context directories, sorted by name.
Contexts []Context
}
Glossary is the whole glossary as the directory states it.
type Term ¶
type Term struct {
// Name is the canonical term, from the `term` field.
Name string
// File is the term file's name within its context directory.
File string
// Status is the `status` field (draft, stable, or deprecated).
Status string
// Definition is the `definition` field, verbatim.
Definition string
}
Term is one term file's index-bearing frontmatter.