-
Notifications
You must be signed in to change notification settings - Fork 83
Description
Summary
Add a standalone glossary to the WAI ACT Rules area, comparable to the glossary on the former ACT Rules community site: a single place with all definitions, stable fragment IDs for deep linking, correct internal links, and for each term a list of rules that use that definition.
This is an additional resource. It must not replace or remove the existing Glossary section on individual rule pages (those stay so each rule remains self-contained).
Reference implementation (former public site)
The behaviour to match comes from the Gatsby site in act-rules-web. Useful pointers:
- Glossary page: renders full glossary markdown as HTML, one block per term with
id= glossarykey, plus a “Used In Rules” list per term (seeact-rules-web/src/pages/glossary.js). - Reverse index:
_data/glossary-usages.json, generated bybuild/create-glossary-usages.jsfrom rule + glossary markdown (rule id → list of#keyreferences, including transitive references via links inside glossary entries). - Per-rule glossary in Gatsby:
act-rules-web/src/components/glossary.jsshows only the terms relevant to that rule, but still uses full rendered HTML for each term.
Full definition content vs what appears in WAI rule files today
act-tools (used when generating content/rules/*/proposed.md for WAI) truncates inlined glossary bodies: it keeps only content before the first ## heading in each glossary source file (see get-glossary.ts / getDefinitionBody in act-tools). Anything after that—e.g. Examples, extra sections—is omitted from the glossary block on the rule page.
Requirement for this issue: the standalone WAI glossary must show the complete definition from source (including everything after the first ##), not the act-tools truncation used for per-rule embeds.
Scope and non-goals
- In scope: New glossary index (and/or per-term pages), navigation entry, working anchors and links on WAI, “used in rules” lists with correct WAI rule URLs, full definition bodies as above.
- Explicit non-goal: Do not remove or replace the existing per-rule Glossary section in published rules. Optional future work (separate decision): whether to add more cross-links from rules to the global glossary; that does not change keeping the inline glossary.
Implementation notes (suggestions)
-
Content source today is still the CG repo:
act-rules.github.io→pages/glossary/*.md. Publishing a full glossary on WAI may require extending act-tools and/or the wai-build workflow so glossary output is written intowcag-act-ruleswith appropriate frontmatter and permalinks—or an agreed alternative if authoring moves. -
“Used in rules”: Reuse the same idea as
act-rules-web’screate-glossary-usages.js: build-time map from rule → glossary#key(direct + transitive where applicable), then invert for display. Rule links must use WAI paths (e.g./standards-guidelines/act/rules/{id}/proposed/), not Gatsby’s/rules/{id}. -
Jekyll:
_config.ymlalready declares a collectionwai-wcag-act-rules-patternstitled “Glossary” but without content; that may be a hook, or use another pattern consistent with WAI theme requirements. Confirm any main WAI site config sync if your deployment requires it. -
Link hygiene: Replace or avoid depending on
https://act-rules.github.io/...for primary navigation where WAI URLs exist; fix remaining references in glossary-related content as needed. -
Edge cases: Rules use non-glossary anchors (e.g.
#ruleid:hidden); reverse-index logic should only count keys that correspond to real glossary entries. Glossary pages may define extra<dfn id="...">sub-ids; the primarykeyin frontmatter remains the main stable id unless you document otherwise.
Acceptance criteria
- Public glossary on WAI under the ACT Rules area, listing all terms with stable
#key(or equivalent) anchors. - Each term shows the full source definition, including sections not present in act-tools-inlined rule glossaries.
- Internal and example links work in the WAI context.
- Each term lists all rules that use it (same notion of “use” as the reference: direct + transitive glossary references where applicable).
- ACT standalone nav includes a link to the glossary.
- Per-rule Glossary sections on rule pages remain unchanged in purpose and continue to be generated as today.
Related repositories
- w3c/wcag-act-rules — WAI Jekyll site
- act-rules/act-tools — rule + glossary transform (
--glossaryDir,get-glossarytruncation) - act-rules/act-rules.github.io — glossary source markdown,
wai-build, tests - act-rules-web (Gatsby) — reference UX for glossary page +
glossary-usagesgeneration