glossary

package
v0.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package glossary owns glossary records, parsing, and two-layer merge semantics.

Index

Constants

View Source
const MeaningMax = 280

MeaningMax bounds a meaning at roughly two sentences of ordinary prose, counted in runes (ADR-0207 decision 9). It is a fixed constant rather than a config key on purpose: an adopter-raisable threshold is a suppressing value, which this project's severity model does not have. The advisory evaluates the merged set, so this bounds the shipped standard vocabulary as well as authored terms (decision 10); the portability test is the additional guard that awf never ships an over-length term in the first place.

View Source
const (
	// SidecarPath names the authoring surface in every glossary content error.
	SidecarPath = config.DirName + "/docs/glossary.yaml"
)

Variables

This section is empty.

Functions

func SpecializedListDataKeys

func SpecializedListDataKeys(kind, artifact string) []string

SpecializedListDataKeys identifies glossary data that uses identity-aware composition instead of generic same-key catalog-list layering.

Types

type Record

type Record struct {
	Term    string
	Meaning string
	Domains []string
}

Record is one authored term: the term itself, its meaning, and the optional owning domains. Domains resolve against the project's configured domains in checkGlossary, which this render-time path cannot see.

func Merge

func Merge(sc config.Sidecar) ([]Record, error)

Merge is the single home of the two-layer merge: the standard vocabulary awf ships, overlaid by the project's authored terms. An authored record overrides a shipped record whose term matches case-insensitively, which is the only way to remove an unwanted shipped term. A case-insensitive duplicate WITHIN either layer stays a hard error; a duplicate ACROSS layers is the override. Order is not guaranteed; glossaryRows sorts.

func Records

func Records(raw any) ([]Record, error)

Records validates one authored layer into its record list. An absent or null value yields nil, nil (the template's else branch renders the placeholder). A non-list value, a non-mapping element, a missing or wrong-typed field, an unknown record key, or a case-insensitive duplicate term within this layer is a hard error. Domain resolution is checkGlossary's job (it needs the project's domains); this validates shape only.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL