You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JSON generation: Generate techniques field on SCs from data (#4619)
This restores generation of the `techniques` field for success criteria
in `wcag.json`, enabled by the new data representation of associated
techniques created in #4509.
This had been removed in #4301 in the initial effort to re-enable
automatic `wcag.json` generation, and its removal was then raised as an
issue in #4393; see "`techniques` vs. `techniquesHtml`" in
#4393 (comment) for more
background.
## `wcag.json` Changes
The most notable breaking change is that `techniquesHtml` is no longer
present on success criteria, replaced by `techniques`, which brings
`wcag.json` closer to its state prior to #4301.
The rest of this section compares the new state of the `techniques`
field to its state prior to removal in #4301, except where specified
otherwise.
### Breaking
- The top-level `sufficient`, `advisory`, and `failure` keys now exist
on a single object, rather than array of multiple separate objects each
with one key
- Each of these keys will only exist if there are corresponding
techniques
- Technique IDs no longer contain a `TECH:` prefix
- Entries that do not link to an existing technique page no longer have
an `id`
- Previously, these always included an auto-incremented ID which might
not be stable, containing the word `future` which was sometimes
inaccurate/misleading)
- Subsections (e.g. for situations) are now listed directly within the
`sufficient` array, i.e. there is no longer an extra child object in
between
- Top-level entries under `sufficient` will either be all subsections or
all techniques, never a mix of both
- Each subsection entry contains `title`, `techniques`, and optionally
`note`; presence of subsections can be feature-detected by checking for
the `techniques` field in one of the entries
- This is also used for the subsections in 1.4.8: Visual Presentation
which are requirements, not situations; this SC's `sufficient`
techniques had not been included at all prior to #4301
- Conjunction entries containing `and` (instead of `id`/`title`) may
also contain `using`, e.g. in 1.2.4: Captions (Live)
- Titles may contain HTML content
### Additions
- Each technique may include `prefix` and/or `suffix`, indicating
content to display before/after the technique link/title
- May include HTML
- Leading/trailing space is not explicitly included in `prefix` or
`suffix` values, but spaces are implied in between `prefix`, the
link/title, and `suffix`
- `suffix` is sometimes used to describe a `using` relationship, i.e.
those are now better represented in the serialized format
- Techniques which include `id` also include `technology`, allowing
their respective URL to be pieced together (e.g.
`https://www.w3.org/WAI/WCAG22/Techniques/{technology}/{id}`)
- For success criteria with `sufficient`, a `sufficientNote` field may
be included alongside, with HTML content to be displayed at the bottom
of the Sufficient section
- New optional `groups` construct for `sufficient` subsections,
currently only used by 1.1.1: Non-text Content
- Fields: `id`, `title`, `techniques`
- Automatically implies `using` relationship on all `techniques` within
the subsection
### Bugfixes since #4301
These issues had impacted `techniquesHtml` in the previous update. They
are now resolved for any HTML content within fields under `techniques`.
- Relative links to Understanding pages are now properly handled,
avoiding broken relative links
- WCAG 2.1 only: Absolute URLs to techniques are no longer hard-coded to
WCAG22
0 commit comments