From 05fd0191443677e16870e638251e52e7f08aa5fa Mon Sep 17 00:00:00 2001
From: "Kenneth G. Franqueiro"
Date: Wed, 15 Jan 2025 13:44:54 -0500
Subject: [PATCH] Add errata to w3c/wcag repo and cross-reference from
informative docs (#4170)
This adds the following:
- Imports the 2.1 and 2.2 errata pages into this repo
- Reorganizes existing 2.1 errata in reverse-chronological order
- Adds date stamps for all existing errata I could trace back to a
commit
- Makes use of variables and Liquid expressions to minimize potential
for copy-paste errors between sections
- Auto-generates table of contents within `CustomLiquid.ts` to avoid
desync when adding versions
- Documents patterns/formats for authoring errata in `errata/README.md`
(with mention in top-level README)
- Adds logic to parse information from errata pages and include relevant
errata within Guideline/SC boxes and term definitions within informative
docs pages
- Errata are only included when building for a specific version (i.e.
not the editor's draft, in which case corrections are expected to
already be inlined)
- Only errata against the latest published version are included in
informative docs
- Updates `publish-w3c` script to also copy relevant errata file for
version being published
- Adds links to errata pages in top-level index used for dev server and
PR builds
---
.eleventyignore | 1 +
11ty/CustomLiquid.ts | 43 +++++++-
11ty/cp-cvs.ts | 6 ++
11ty/guidelines.ts | 122 +++++++++++++++-------
README.md | 8 ++
_includes/understanding/about.html | 27 +++--
eleventy.config.ts | 16 +++
errata/21.html | 158 +++++++++++++++++++++++++++++
errata/22.html | 132 ++++++++++++++++++++++++
errata/README.md | 93 +++++++++++++++++
index.html | 2 +
11 files changed, 555 insertions(+), 53 deletions(-)
create mode 100644 errata/21.html
create mode 100644 errata/22.html
create mode 100644 errata/README.md
diff --git a/.eleventyignore b/.eleventyignore
index 752acaedf1..a9be492c6d 100644
--- a/.eleventyignore
+++ b/.eleventyignore
@@ -1,4 +1,5 @@
*.md
+**/README.md
11ty/
acknowledgements.html
acknowledgements/
diff --git a/11ty/CustomLiquid.ts b/11ty/CustomLiquid.ts
index 948a4847f3..5b19b8e2ab 100644
--- a/11ty/CustomLiquid.ts
+++ b/11ty/CustomLiquid.ts
@@ -92,9 +92,36 @@ export class CustomLiquid extends Liquid {
super(options);
this.termsMap = options.termsMap;
}
+
+ private renderErrata(html: string) {
+ const $ = load(html);
+
+ const $tocList = $("#contents .toc");
+ let $childList: CheerioAnyNode | null = null;
+ $("main section[id]:has(h2:first-child, h3:first-child)").each((_, el) => {
+ const $el = $(el);
+ // Only one of the following queries will match for each section
+ $el.find("> h2:first-child").each((_, h2El) => {
+ $childList = null;
+ $tocList.append(`
The errata are classified as Substantive or Editorial, as classified by the W3C Classes of Changes, and listed in reverse chronological order based on the date of publication to which they are applicable.
+
Each entry has the following information:
+
+
The date it was added to the errata page.
+
The section referred to.
+
A description of the problem and correction if applicable.
+
A rationale for making the change (not required for editorial errata).
No substantive errata have been recorded at present.
+
+
+
Editorial Errata
+
+
+ 2023-04-18:
+ In 4.1.1 Parsing,
+ removing one note and adding two new notes, including: "This Success Criterion should be considered as always satisfied for any content using HTML or XML."
+ ({% gh "#3152" %})
+
+
+ 2022-02-22:
+ In the definition of relative luminance,
+ updating the red threshold from 0.03928 to 0.04045.
+ ({% gh "#1780" %})
+
+ 2019-05-09:
+ In 1.3.4 Orientation,
+ clarifying the note referencing "binary display orientation" to read "content is not necessarily restricted to landscape or portrait display orientation".
+ ({% gh "#724" %})
+
+
+ 2018-08-06:
+ In 1.4.13 Content on Hover or Focus,
+ correcting the word "dismissable" to "dismissible".
+ ({% gh "b043430" %})
+
+
+ 2018-08-06:
+ In 4. Robust, removing repetition of the word "by".
+ ({% gh "6f883b5" %})
+
+
+ 2018-08-06:
+ In 5.2.2 Full pages, removing "New" from the beginning of the third note.
+ ({% gh "5d42e28" %})
+
+
+ 2018-07-11:
+ In the Introduction,
+ correcting several (but not all) "WCAG 2.0" references to "WCAG 2.1".
+ ({% gh "#430" %}, {% gh "#426" %}, {% gh "170c48a" %})
+
+
+ 2018-07-11:
+ In 1.4.10 Reflow,
+ removing a supernumary "Note" indicator from the first note.
+ ({% gh "#429" %})
+
+
+ 2018-07-11:
+ In the definition for keyboard interface,
+ updating the second (of three) notes to be an example of the first note, leaving only two actual notes.
+ ({% gh "#428" %})
+
+
+ 2018-07-11:
+ In the definition for technology,
+ updating the third note to instead be an example.
+ ({% gh "#428" %})
+
+
+ 2018-07-11:
+ In 5.3.1 Required Components of a Conformance Claim,
+ removing the editorial note "In WCAG 2.0 this was a dated URI, which may need to be adjusted when this becomes a Rec."
+ ({% gh "#427" %})
+
+
+ 2018-07-11:
+ In the 0.5.2 Numbering in WCAG 2.1,
+ correcting the words "critera" and "ccriteria" to "criteria".
+ ({% gh "#426" %})
+
In the Status of This Document,
+ removing the first instance of the repeated paragraph beginning "This document has been reviewed by W3C Members...".
+
The errata are classified as Substantive or Editorial, as classified by the W3C Classes of Changes, and listed in reverse chronological order based on the date of publication to which they are applicable.
+
Each entry has the following information:
+
+
The date it was added to the errata page.
+
The section referred to.
+
A description of the problem and correction if applicable.
+
A rationale for making the change (not required for editorial errata).
No substantive errata have been recorded at present.
+
+
+
Editorial Errata
+
+
+ 2024-11-22:
+ Modifying visual presentation for content identified as New
+ ({% gh "#1481" %}, {% gh "#4145" %})
+
+
+ 2024-11-19:
+ Making editorial changes to improve consistent use of the terms
+ "success criteria/criterion", "web", "website", and "web page"
+ ({% gh "#4080" %})
+
+
+ 2024-11-19:
+ In the definition for single pointer,
+ updating to further enumerate interaction types and distinguish input modalities.
+ ({% gh "#4070" %}, {% gh "#3536" %})
+
+ 2024-11-19:
+ In the definition for used in an unusual or restricted way,
+ genericizing WCAG version reference from "2.1" to "2".
+ ({% gh "#3707" %})
+
+ 2024-11-19:
+ In 2.5.8 Target Size (Minimum), updating formatting, grammar, and punctuation of exceptions.
+ ({% gh "#3189" %})
+
+
+ 2024-11-19:
+ Making editorial changes to improve consistent use of definitions in the success criteria ({% gh "#3038" %})
+
+
+
+
+
+
+
diff --git a/errata/README.md b/errata/README.md
new file mode 100644
index 0000000000..59d05ecc12
--- /dev/null
+++ b/errata/README.md
@@ -0,0 +1,93 @@
+# Errata Editing Instructions
+
+Errata are listed in reverse-chronological order, first sectioned by publish date,
+then within each section based on when each erratum was added.
+
+## Sections
+
+The first top-level section under `` corresponds to the latest version / unpinned URL;
+subsequent sections correspond to previous versions / date-stamped URLs.
+
+Each top-level section should be preceded by `trDate` and `trUrl` variable assignments.
+These variables reduce the chance of copy-paste errors within individual errata.
+For sections corresponding to previous versions, assignments should follow this pattern
+(only `YYYY-MM-DD` should need to be replaced):
+
+```
+{%- assign trDate = "YYYY-MM-DD" -%}
+{%- capture trUrl -%}
+ https://www.w3.org/TR/{{ trDate | split: "-" | first }}/REC-WCAG{{ page.fileSlug }}-{{ trDate | replace: "-", "" }}/
+{%- endcapture -%}
+```
+
+The level 2 heading in the top-level section for each previous version should use this code
+(no replacements necessary, making use of the preceding variable reassignments):
+
+```html
+
+```
+
+## Erratum format
+
+Each erratum should be in the following format
+(replacing `YYYY-MM-DD`, `Section Title`, `sectionid`, `details of changes`, and `#NNNN`):
+
+```html
+
+ YYYY-MM-DD:
+ In Section Title,
+ details of changes.
+ ({% gh #NNNN %})
+
+```
+
+Adhering to this format is important, as any entries under the latest published version will also be
+parsed for inclusion within Guideline/SC boxes and Key Terms definitions within Understanding pages.
+(Newlines are insignificant and are suggested for source code readability.)
+
+Each piece of this format is further explained in the subsections below.
+
+### Section reference
+
+When applicable, errata should begin with an indication of the section they relate to, including a link.
+
+Example phrasing when linking to a section, e.g. a success criterion:
+
+```html
+In 2.5.8 Target Size (Minimum)
+```
+
+Example phrasing when linking to a term definition:
+
+```html
+In the definition for single pointer
+```
+
+(Remember that term definition fraagments always begin with `dfn-`.)
+
+It is possible to reference multiple sections/terms from one erratum,
+so long as all of the links remain front-loaded prior to the erratum's details.
+
+### Details of changes
+
+`details of what happened` should be expressed in present progressive tense
+(e.g. "updating", "removing", "adding"), with the desired outcome listed first.
+For example:
+
+- updating the red threshold from ... to ...
+- removing one note and adding two new notes, including ...
+- removing a supernumary "Note" indicator from the first note.
+- correcting the word ... to ...
+
+### GitHub PR or commit
+
+When possible, provide a reference to one or more GitHub pull requests or commit hashes
+at the end of each erratum, in the format `({% gh "..." %})`.
+
+The format breaks down as follows:
+
+- `{% gh "..." %}` is a custom shortcode, which accepts one of the following:
+ - A PR number prefixed with `#`, e.g. `"#4080"` (this is the preferred option when available)
+ - A commit hash of 7 or more characters, with no prefix, e.g. `"b043430"`
+- The quotes around the parameter passed to the `gh` shortcode are necessary for template parsing
+- The outer parentheses exist only for punctuation, and are directly output
diff --git a/index.html b/index.html
index 56183d90c5..466655f759 100644
--- a/index.html
+++ b/index.html
@@ -19,6 +19,8 @@
Web Content Accessibility Guidelines {{ versionDecimal }}