Skip to content

Add standalone ACT Rules glossary on WAI (wcag-act-rules) #2393

@WilcoFiers

Description

@WilcoFiers

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 = glossary key, plus a “Used In Rules” list per term (see act-rules-web/src/pages/glossary.js).
  • Reverse index: _data/glossary-usages.json, generated by build/create-glossary-usages.js from rule + glossary markdown (rule id → list of #key references, including transitive references via links inside glossary entries).
  • Per-rule glossary in Gatsby: act-rules-web/src/components/glossary.js shows 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)

  1. Content source today is still the CG repo: act-rules.github.iopages/glossary/*.md. Publishing a full glossary on WAI may require extending act-tools and/or the wai-build workflow so glossary output is written into wcag-act-rules with appropriate frontmatter and permalinks—or an agreed alternative if authoring moves.

  2. “Used in rules”: Reuse the same idea as act-rules-web’s create-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}.

  3. Jekyll: _config.yml already declares a collection wai-wcag-act-rules-patterns titled “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.

  4. 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.

  5. 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 primary key in 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


Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions