From 5b895ea6417b6287cbb8911a5a42ba1186821ed7 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Thu, 14 Nov 2024 15:11:42 -0500 Subject: [PATCH 01/17] Add errata and cross-reference from guidelines/SC and key terms --- 11ty/CustomLiquid.ts | 13 ++++-- 11ty/guidelines.ts | 25 ++++++++++- _includes/understanding/about.html | 27 ++++++++---- eleventy.config.ts | 2 + errata/21.html | 66 ++++++++++++++++++++++++++++++ errata/22.html | 50 ++++++++++++++++++++++ 6 files changed, 168 insertions(+), 15 deletions(-) create mode 100644 errata/21.html create mode 100644 errata/22.html diff --git a/11ty/CustomLiquid.ts b/11ty/CustomLiquid.ts index 948a4847f3..aece1e81f2 100644 --- a/11ty/CustomLiquid.ts +++ b/11ty/CustomLiquid.ts @@ -468,10 +468,15 @@ export class CustomLiquid extends Liquid { }); for (const name of termNames) { const term = this.termsMap[name]; // Already verified existence in the earlier loop - $termsList.append( - `
${term.name}
` + - `
${term.definition}
` - ); + let termBody = term.definition; + if (scope.errata[term.id]) { + termBody += ` +

Errata:

+ +

View all errata

+ `; + } + $termsList.append(`
${term.name}
${termBody}
`); } // Iterate over non-href links once more in now-expanded document to add hrefs diff --git a/11ty/guidelines.ts b/11ty/guidelines.ts index 27cc3fd8ff..57616822be 100644 --- a/11ty/guidelines.ts +++ b/11ty/guidelines.ts @@ -3,9 +3,9 @@ import type { CheerioAPI } from "cheerio"; import { glob } from "glob"; import { readFile } from "fs/promises"; -import { basename } from "path"; +import { basename, join } from "path"; -import { flattenDomFromFile, load, type CheerioAnyNode } from "./cheerio"; +import { flattenDomFromFile, load, loadFromFile, type CheerioAnyNode } from "./cheerio"; import { generateId } from "./common"; export type WcagVersion = "20" | "21" | "22"; @@ -299,3 +299,24 @@ export const getAcknowledgementsForVersion = async (version: WcagVersion) => { */ export const getPrinciplesForVersion = async (version: WcagVersion) => processPrinciples(await loadRemoteGuidelines(version)); + +/** Parses errata items from the errata document for the specified WCAG version. */ +export const getErrataForVersion = async (version: WcagVersion) => { + const $ = await loadFromFile(join("errata", `${version}.html`)); + const aSelector = `a[href^='https://www.w3.org/TR/WCAG${version}/#']`; + const errata: Record = {}; + + $(`li:has(${aSelector})`).each((_, el) => { + const $el = $(el); + const $aEl = $el.find(aSelector); + const hash = new URL($aEl.attr("href")!).hash.slice(1); + const erratumHtml = $el + .html()! + .replace(/^.*?<\/a>,?\s*/g, "") + .replace(/^(\w)/, (_, p1) => p1.toUpperCase()); + if (hash in errata) errata[hash].push(erratumHtml); + else errata[hash] = [erratumHtml]; + }); + + return errata; +}; diff --git a/_includes/understanding/about.html b/_includes/understanding/about.html index 098d0b9997..efcc2b298e 100644 --- a/_includes/understanding/about.html +++ b/_includes/understanding/about.html @@ -1,9 +1,18 @@ -{%- if guideline.type == "SC" -%} - {% sectionbox "success-criterion" "Success Criterion (SC)" -%} - {{ guideline.content }} - {%- endsectionbox %} -{%- elsif guideline.type == "Guideline" -%} - {% sectionbox "guideline" "Guideline" -%} - {{ guideline.content }} - {%- endsectionbox %} -{%- endif -%} +{%- capture section_id -%} + {%- if guideline.type == "SC" -%}success-criterion{%- else -%}guideline{%- endif -%} +{%- endcapture -%} +{%- capture section_title -%} + {%- if guideline.type == "SC" -%}Success Criterion (SC){%- else -%}Guideline{%- endif -%} +{%- endcapture -%} +{% sectionbox section_id section_title -%} + {{ guideline.content }} + {%- if errata[guideline.id] %} +

Errata

+ +

View all errata

+ {% endif -%} +{%- endsectionbox %} diff --git a/eleventy.config.ts b/eleventy.config.ts index d579a657ff..3823ad2e72 100644 --- a/eleventy.config.ts +++ b/eleventy.config.ts @@ -11,6 +11,7 @@ import { resolveDecimalVersion } from "11ty/common"; import { actRules, assertIsWcagVersion, + getErrataForVersion, getFlatGuidelines, getPrinciples, getPrinciplesForVersion, @@ -110,6 +111,7 @@ const termsMap = process.env.WCAG_VERSION ? await getTermsMap(version) : await g const globalData = { version, versionDecimal: resolveDecimalVersion(version), + errata: process.env.WCAG_VERSION ? await getErrataForVersion(version) : {}, techniques, // Used for techniques/index.html technologies, // Used for techniques/index.html technologyTitles, // Used for techniques/index.html diff --git a/errata/21.html b/errata/21.html new file mode 100644 index 0000000000..c297b3871e --- /dev/null +++ b/errata/21.html @@ -0,0 +1,66 @@ + + + + Web Content Accessibility Guidelines (WCAG) 2.1 Errata + + + + +
+

W3C

+

Web Content Accessibility Guidelines (WCAG) 2.1 Errata

+

Last modified: $Date: 2024/02/01 14:32:47 $

+ +
+
+
+

Abstract

+

This document records all known errors in the Web Content Accessibility Guidelines (WCAG) 2.1 specification.

+

The errata are numbered, classified as Substantive or Editorial, and listed in reverse chronological order of their date of publication in each category.

+

Each entry has the following information:

+
    +
  • A unique entry number
  • +
  • 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).
  • +
+

Substantive corrections are proposed by the Accessibility Guidelines Working Group, which has consensus that they are appropriate; they are not to be considered normative until a new Recommendation is published following the process to revise a Recommendation.

+

Please view the public comment instructions if you would like to comment to the Working Group. Comments submitted are publicly available in the archive for the Accessibility Guidelines Working Group public comments mailing list.

+
+
+

Table of Contents

+
    +
  1. Substantive Errata
  2. +
  3. Editorial Errata
  4. +
+
+
+
+
+

Substantive Errata

+

No substantive errata have been recorded at present.

+
+
+

Editorial Errata

+ +
+
+ + diff --git a/errata/22.html b/errata/22.html new file mode 100644 index 0000000000..8e8b0974ad --- /dev/null +++ b/errata/22.html @@ -0,0 +1,50 @@ + + + + Web Content Accessibility Guidelines (WCAG) 2.2 Errata + + + + +
+

W3C

+

Web Content Accessibility Guidelines (WCAG) 2.2 Errata

+

Last modified: $Date: 2023/07/21 18:31:26 $

+ +
+
+
+

Abstract

+

This document records all known errors in the Web Content Accessibility Guidelines (WCAG) 2.2 specification.

+

The errata are numbered, classified as Substantive or Editorial, and listed in reverse chronological order of their date of publication in each category.

+

Each entry has the following information:

+
    +
  • A unique entry number
  • +
  • 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).
  • +
+

Substantive corrections are proposed by the Accessibility Guidelines Working Group, which has consensus that they are appropriate; they are not to be considered normative until a new Recommendation is published following the process to revise a Recommendation.

+

Please view the public comment instructions if you would like to comment to the Working Group. Comments submitted are publicly available in the archive for the Accessibility Guidelines Working Group public comments mailing list.

+
+
+

Table of Contents

+
    +
  1. Substantive Errata
  2. +
  3. Editorial Errata
  4. +
+
+
+
+
+

Substantive Errata

+

No substantive errata recorded at present.

+
+
+

Editorial Errata

+
+

No editorial errata recorded at present.

+
+ + From 485da7ac8f58bdb28b511f8d732eab14c3a7126e Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Thu, 5 Dec 2024 13:44:11 -0500 Subject: [PATCH 02/17] Reorganize errata by publication date, and auto-generate TOC --- 11ty/CustomLiquid.ts | 30 +++++++++++++++++- errata/21.html | 72 +++++++++++++++++++++++++++----------------- errata/22.html | 28 +++++++++-------- 3 files changed, 88 insertions(+), 42 deletions(-) diff --git a/11ty/CustomLiquid.ts b/11ty/CustomLiquid.ts index aece1e81f2..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(`
  • ${$(h2El).text()}
  • `); + }); + $el.find("> h3:first-child").each((_, h3El) => { + if (!$childList) $childList = $(`
      `).appendTo($tocList); + $childList.append(`
    1. ${$(h3El).text()}
    2. `); + }); + }); + + return $.html(); + } + public parse(html: string, filepath?: string) { // Filter out Liquid calls for computed data and includes themselves - if (filepath && !filepath.includes("_includes/") && isHtmlFileContent(html)) { + if ( + filepath && + !filepath.includes("_includes/") && + !filepath.includes("errata/") && + isHtmlFileContent(html) + ) { const isIndex = indexPattern.test(filepath); const isTechniques = techniquesPattern.test(filepath); const isUnderstanding = understandingPattern.test(filepath); @@ -309,6 +336,7 @@ export class CustomLiquid extends Liquid { // html contains markup after Liquid tags/includes have been processed const html = (await super.render(templates, scope, options)).toString(); if (!isHtmlFileContent(html) || !scope || scope.page.url === false) return html; + if (scope.page.inputPath.includes("errata/")) return this.renderErrata(html); const $ = load(html); diff --git a/errata/21.html b/errata/21.html index c297b3871e..8f0b1085c3 100644 --- a/errata/21.html +++ b/errata/21.html @@ -16,50 +16,66 @@

      Web Content Accessibility Guidelines (WCAG) 2.1 Errata

      Abstract

      This document records all known errors in the Web Content Accessibility Guidelines (WCAG) 2.1 specification.

      -

      The errata are numbered, classified as Substantive or Editorial, and listed in reverse chronological order of their date of publication in each category.

      +

      The errata are classified as Substantive or Editorial, and listed in chronological order based on the date of publication to which they are applicable.

      Each entry has the following information:

        -
      • A unique entry number
      • -
      • 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).

      Substantive corrections are proposed by the Accessibility Guidelines Working Group, which has consensus that they are appropriate; they are not to be considered normative until a new Recommendation is published following the process to revise a Recommendation.

      -

      Please view the public comment instructions if you would like to comment to the Working Group. Comments submitted are publicly available in the archive for the Accessibility Guidelines Working Group public comments mailing list.

      +

      Please view the public comment instructions if you would like to comment to the Working Group. Comments submitted are publicly available in the archive for the Accessibility Guidelines Working Group public comments mailing list.

      Table of Contents

        -
      1. Substantive Errata
      2. -
      3. Editorial Errata
      4. + {%- # Leave this empty - populated during the build process -%}

      -
      -

      Substantive Errata

      -

      No substantive errata have been recorded at present.

      + {%- assign trDate = "2018-06-05" -%} + {%- capture trUrl -%}https://www.w3.org/TR/2018/REC-WCAG21-{{ trDate | replace: "-", "" }}/{%- endcapture -%} +
      +

      Errata since {{ trDate | date: "%d %B %Y" }} Publication

      +
      +

      Substantive Errata

      +

      No substantive errata have been recorded at present.

      +
      +
      +

      Editorial Errata

      + +
      -
      -

      Editorial Errata

      - + + {%- assign trDate = "current" -%} + {%- assign trUrl = "https://www.w3.org/TR/WCAG21/" -%} +
      +

      Errata since Current Publication

      +
      +

      Substantive Errata

      +

      No substantive errata have been recorded at present.

      +
      +
      +

      Editorial Errata

      +

      No editorial errata have been recorded at present.

      +
      diff --git a/errata/22.html b/errata/22.html index 8e8b0974ad..b794aafc58 100644 --- a/errata/22.html +++ b/errata/22.html @@ -16,35 +16,37 @@

      Web Content Accessibility Guidelines (WCAG) 2.2 Errata

      Abstract

      This document records all known errors in the Web Content Accessibility Guidelines (WCAG) 2.2 specification.

      -

      The errata are numbered, classified as Substantive or Editorial, and listed in reverse chronological order of their date of publication in each category.

      +

      The errata are classified as Substantive or Editorial, and listed in chronological order based on the date of publication to which they are applicable.

      Each entry has the following information:

        -
      • A unique entry number
      • -
      • 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).

      Substantive corrections are proposed by the Accessibility Guidelines Working Group, which has consensus that they are appropriate; they are not to be considered normative until a new Recommendation is published following the process to revise a Recommendation.

      -

      Please view the public comment instructions if you would like to comment to the Working Group. Comments submitted are publicly available in the archive for the Accessibility Guidelines Working Group public comments mailing list.

      +

      Please view the public comment instructions if you would like to comment to the Working Group. Comments submitted are publicly available in the archive for the Accessibility Guidelines Working Group public comments mailing list.

      Table of Contents

        -
      1. Substantive Errata
      2. -
      3. Editorial Errata
      4. + {%- # Leave this empty - populated during the build process -%}

      -
      -

      Substantive Errata

      -

      No substantive errata recorded at present.

      + {%- assign trDate = "current" -%} + {%- assign trUrl = "https://www.w3.org/TR/WCAG22/" -%} +
      +

      Errata since Current Publication

      +
      +

      Substantive Errata

      +

      No substantive errata recorded at present.

      +
      +
      +

      Editorial Errata

      +

      No editorial errata recorded at present.

      +
      -
      -

      Editorial Errata

      -
      -

      No editorial errata recorded at present.

      From 6d594a6281a01732010304bc8a0acbd9254704d8 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Thu, 5 Dec 2024 16:03:10 -0500 Subject: [PATCH 03/17] Update getErrataForVersion for template format and resolve note links --- 11ty/guidelines.ts | 115 ++++++++++++++++++++++++++------------------- 1 file changed, 66 insertions(+), 49 deletions(-) diff --git a/11ty/guidelines.ts b/11ty/guidelines.ts index 57616822be..5f45632fde 100644 --- a/11ty/guidelines.ts +++ b/11ty/guidelines.ts @@ -233,50 +233,52 @@ export async function getTermsMap(version?: WcagVersion) { // Version-specific APIs -const remoteGuidelines$: Partial> = {}; +const guidelinesCache: Partial> = {}; /** Loads guidelines from TR space for specific version, caching for future calls. */ -const loadRemoteGuidelines = async (version: WcagVersion) => { - if (!remoteGuidelines$[version]) { - const $ = load( - (await axios.get(`https://www.w3.org/TR/WCAG${version}/`, { responseType: "text" })).data - ); - - // Re-collapse definition links and notes, to be processed by this build system - $("a.internalDFN").removeAttr("class data-link-type id href title"); - $("[role='note'] .marker").remove(); - $("[role='note']").find("> div, > p").addClass("note").unwrap(); - - // Convert data-plurals (present in publications) to data-lt - $("dfn[data-plurals]").each((_, el) => { - el.attribs["data-lt"] = (el.attribs["data-lt"] || "") - .split("|") - .concat(el.attribs["data-plurals"].split("|")) - .join("|"); - delete el.attribs["data-plurals"]; - }); +const loadRemoteGuidelines = async (version: WcagVersion, stripRespec = true) => { + const html = + guidelinesCache[version] || + (guidelinesCache[version] = ( + await axios.get(`https://www.w3.org/TR/WCAG${version}/`, { responseType: "text" }) + ).data); + + const $ = load(html); + if (!stripRespec) return $; + + // Re-collapse definition links and notes, to be processed by this build system + $("a.internalDFN").removeAttr("class data-link-type id href title"); + $("[role='note'] .marker").remove(); + $("[role='note']").find("> div, > p").addClass("note").unwrap(); + + // Convert data-plurals (present in publications) to data-lt + $("dfn[data-plurals]").each((_, el) => { + el.attribs["data-lt"] = (el.attribs["data-lt"] || "") + .split("|") + .concat(el.attribs["data-plurals"].split("|")) + .join("|"); + delete el.attribs["data-plurals"]; + }); - // Un-process bibliography references, to be processed by CustomLiquid - $("cite:has(a.bibref:only-child)").each((_, el) => { - const $el = $(el); - $el.replaceWith(`[${$el.find("a.bibref").html()}]`); - }); + // Un-process bibliography references, to be processed by CustomLiquid + $("cite:has(a.bibref:only-child)").each((_, el) => { + const $el = $(el); + $el.replaceWith(`[${$el.find("a.bibref").html()}]`); + }); - // Remove generated IDs and markers from examples - $(".example[id]").removeAttr("id"); - $(".example > .marker").remove(); + // Remove generated IDs and markers from examples + $(".example[id]").removeAttr("id"); + $(".example > .marker").remove(); - // Remove extra markup from headings so they can be parsed for names - $("bdi").remove(); + // Remove extra markup from headings so they can be parsed for names + $("bdi").remove(); - // Remove abbr elements which exist only in TR, not in informative docs - $("#acknowledgements li abbr, #glossary abbr").each((_, abbrEl) => { - $(abbrEl).replaceWith($(abbrEl).text()); - }); + // Remove abbr elements which exist only in TR, not in informative docs + $("#acknowledgements li abbr, #glossary abbr").each((_, abbrEl) => { + $(abbrEl).replaceWith($(abbrEl).text()); + }); - remoteGuidelines$[version] = $; - } - return remoteGuidelines$[version]!; + return $; }; /** @@ -303,20 +305,35 @@ export const getPrinciplesForVersion = async (version: WcagVersion) => /** Parses errata items from the errata document for the specified WCAG version. */ export const getErrataForVersion = async (version: WcagVersion) => { const $ = await loadFromFile(join("errata", `${version}.html`)); - const aSelector = `a[href^='https://www.w3.org/TR/WCAG${version}/#']`; + const $guidelines = await loadRemoteGuidelines(version, false); + const aSelector = `a[href*='#']:first-of-type`; const errata: Record = {}; - $(`li:has(${aSelector})`).each((_, el) => { - const $el = $(el); - const $aEl = $el.find(aSelector); - const hash = new URL($aEl.attr("href")!).hash.slice(1); - const erratumHtml = $el - .html()! - .replace(/^.*?<\/a>,?\s*/g, "") - .replace(/^(\w)/, (_, p1) => p1.toUpperCase()); - if (hash in errata) errata[hash].push(erratumHtml); - else errata[hash] = [erratumHtml]; - }); + $("main > section[id]") + .last() + .find(`li:has(${aSelector})`) + .each((_, el) => { + const $el = $(el); + const $aEl = $el.find(aSelector); + let hash: string | undefined = $aEl.attr("href")!.replace(/^.*#/, ""); + + // Check whether hash pertains to a guideline/SC section or term definition; + // if it doesn't, attempt to resolve it to one + const $hashEl = $guidelines(`#${hash}`); + if (!$hashEl.is("section.guideline, #terms dfn")) { + const $closest = $hashEl.closest("#terms dd, section.guideline"); + if ($closest.is("#terms dd")) hash = $closest.prev().find("dfn[id]").attr("id"); + else hash = $closest.attr("id"); + } + if (!hash) return; + + const erratumHtml = $el + .html()! + .replace(/^.*?<\/a>,?\s*/g, "") + .replace(/^(\w)/, (_, p1) => p1.toUpperCase()); + if (hash in errata) errata[hash].push(erratumHtml); + else errata[hash] = [erratumHtml]; + }); return errata; }; From 617980805e2d8877ed4cdd53c801411aa666ce92 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Mon, 9 Dec 2024 14:04:04 -0500 Subject: [PATCH 04/17] Add missing date stamps to errata (Except for one that I could not find in commit history at all) --- errata/21.html | 29 +++++++++++++++-------------- errata/22.html | 1 + 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/errata/21.html b/errata/21.html index 8f0b1085c3..6ac563b73a 100644 --- a/errata/21.html +++ b/errata/21.html @@ -19,6 +19,7 @@

      Abstract

      The errata are classified as Substantive or Editorial, and listed in 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).
      • @@ -46,20 +47,20 @@

        Substantive Errata

        Editorial Errata

        • In the Status of This Document the paragraph beginning "This document has been reviewed by W3C Members..." appears twice. The first instance of this paragraph should be removed.
        • -
        • In the Introduction, several (but not all) references to "WCAG 2.0" should be "WCAG 2.1".
        • -
        • In the 0.5.2 Numbering in WCAG 2.1, the words "critera" and "ccriteria" should be "criteria".
        • -
        • In 1.4.10 Reflow, the first note had a supernumary "Note" indicator which should be removed.
        • -
        • In 1.4.13 Content on Hover or Focus, the word "dismissable" should be "dismissible".
        • -
        • In 4. Robust, the word "by" is repeated but should be present only once.
        • -
        • In 5.2.2 Full pages, the third note began with "New" which should be removed.
        • -
        • In 5.3.1 Required Components of a Conformance Claim the editorial note "In WCAG 2.0 this was a dated URI, which may need to be adjusted when this becomes a Rec." should be removed.
        • -
        • In the definition for keyboard interface, the second (of three) note should be an example of the first note, leaving only two actual notes.
        • -
        • In the definition for technology, the third note should instead be an example.
        • -
        • In 7. Input Purposes for User Interface Components, the word "county" should be "country".
        • -
        • In 1.3.4 Orientation, the note referencing "binary display orientation" has been clarified to read "content is not necessarily restricted to landscape or portrait display orientation".
        • -
        • In a note in the definition of accessibility supported, references to "Conformance Criterion" were changed to "Conformance Requirement".
        • -
        • In the definition of relative luminance, the red threshold was updated from 0.03928 to 0.04045.
        • -
        • In 4.1.1 Parsing one note should be deleted, and two notes added, including: "This Success Criterion should be considered as always satisfied for any content using HTML or XML."
        • +
        • 2018-07-11: In the Introduction, several (but not all) references to "WCAG 2.0" should be "WCAG 2.1".
        • +
        • 2018-07-11: In the 0.5.2 Numbering in WCAG 2.1, the words "critera" and "ccriteria" should be "criteria".
        • +
        • 2018-07-11: In 1.4.10 Reflow, the first note had a supernumary "Note" indicator which should be removed.
        • +
        • 2018-08-06: In 1.4.13 Content on Hover or Focus, the word "dismissable" should be "dismissible".
        • +
        • 2018-08-06: In 4. Robust, the word "by" is repeated but should be present only once.
        • +
        • 2018-08-06: In 5.2.2 Full pages, the third note began with "New" which should be removed.
        • +
        • 2018-07-11: In 5.3.1 Required Components of a Conformance Claim the editorial note "In WCAG 2.0 this was a dated URI, which may need to be adjusted when this becomes a Rec." should be removed.
        • +
        • 2018-07-11: In the definition for keyboard interface, the second (of three) note should be an example of the first note, leaving only two actual notes.
        • +
        • 2018-07-11: In the definition for technology, the third note should instead be an example.
        • +
        • 2018-06-08: In 7. Input Purposes for User Interface Components, the word "county" should be "country".
        • +
        • 2019-05-09: In 1.3.4 Orientation, the note referencing "binary display orientation" has been clarified to read "content is not necessarily restricted to landscape or portrait display orientation".
        • +
        • 2022-02-02: In a note in the definition of accessibility supported, references to "Conformance Criterion" were changed to "Conformance Requirement".
        • +
        • 2022-02-22: In the definition of relative luminance, the red threshold was updated from 0.03928 to 0.04045.
        • +
        • 2023-04-18: In 4.1.1 Parsing one note should be deleted, and two notes added, including: "This Success Criterion should be considered as always satisfied for any content using HTML or XML."
        diff --git a/errata/22.html b/errata/22.html index b794aafc58..0129326f3e 100644 --- a/errata/22.html +++ b/errata/22.html @@ -19,6 +19,7 @@

        Abstract

        The errata are classified as Substantive or Editorial, and listed in 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).
        • From ef54156dacf4a0e7c15144e774362ab6a5f2715b Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Wed, 11 Dec 2024 14:33:16 -0500 Subject: [PATCH 05/17] Switch to reverse-chron + improve template + document format --- .eleventyignore | 1 + 11ty/guidelines.ts | 2 +- errata/21.html | 53 +++++++++++++++++++++++++--------------------- errata/22.html | 5 ++++- errata/README.md | 36 +++++++++++++++++++++++++++++++ 5 files changed, 71 insertions(+), 26 deletions(-) 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/guidelines.ts b/11ty/guidelines.ts index 5f45632fde..05fce1849f 100644 --- a/11ty/guidelines.ts +++ b/11ty/guidelines.ts @@ -310,7 +310,7 @@ export const getErrataForVersion = async (version: WcagVersion) => { const errata: Record = {}; $("main > section[id]") - .last() + .first() .find(`li:has(${aSelector})`) .each((_, el) => { const $el = $(el); diff --git a/errata/21.html b/errata/21.html index 6ac563b73a..dfb9014cda 100644 --- a/errata/21.html +++ b/errata/21.html @@ -1,3 +1,5 @@ +{%- # PLEASE READ errata/README.md BEFORE EDITING -%} + @@ -16,7 +18,7 @@

          Web Content Accessibility Guidelines (WCAG) 2.1 Errata

          Abstract

          This document records all known errors in the Web Content Accessibility Guidelines (WCAG) 2.1 specification.

          -

          The errata are classified as Substantive or Editorial, and listed in chronological order based on the date of publication to which they are applicable.

          +

          The errata are classified as Substantive or Editorial, 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.
          • @@ -26,6 +28,7 @@

            Abstract

          Substantive corrections are proposed by the Accessibility Guidelines Working Group, which has consensus that they are appropriate; they are not to be considered normative until a new Recommendation is published following the process to revise a Recommendation.

          Please view the public comment instructions if you would like to comment to the Working Group. Comments submitted are publicly available in the archive for the Accessibility Guidelines Working Group public comments mailing list.

          +

          The full commit history can be viewed on GitHub.

          Table of Contents

          @@ -35,8 +38,24 @@

          Table of Contents


          + {%- assign trDate = "current" -%} + {%- assign trUrl = "https://www.w3.org/TR/WCAG21/" -%} +
          +

          Errata since Current Publication

          +
          +

          Substantive Errata

          +

          No substantive errata have been recorded at present.

          +
          +
          +

          Editorial Errata

          +

          No editorial errata have been recorded at present.

          +
          +
          + {%- assign trDate = "2018-06-05" -%} - {%- capture trUrl -%}https://www.w3.org/TR/2018/REC-WCAG21-{{ trDate | replace: "-", "" }}/{%- endcapture -%} + {%- capture trUrl -%} + https://www.w3.org/TR/{{ trDate | split: "-" | first }}/REC-WCAG21-{{ trDate | replace: "-", "" }}/ + {%- endcapture -%}

          Errata since {{ trDate | date: "%d %B %Y" }} Publication

          @@ -46,38 +65,24 @@

          Substantive Errata

          Editorial Errata

            -
          • In the Status of This Document the paragraph beginning "This document has been reviewed by W3C Members..." appears twice. The first instance of this paragraph should be removed.
          • -
          • 2018-07-11: In the Introduction, several (but not all) references to "WCAG 2.0" should be "WCAG 2.1".
          • -
          • 2018-07-11: In the 0.5.2 Numbering in WCAG 2.1, the words "critera" and "ccriteria" should be "criteria".
          • -
          • 2018-07-11: In 1.4.10 Reflow, the first note had a supernumary "Note" indicator which should be removed.
          • +
          • 2023-04-18: In 4.1.1 Parsing one note should be deleted, and two notes added, including: "This Success Criterion should be considered as always satisfied for any content using HTML or XML."
          • +
          • 2022-02-02: In a note in the definition of accessibility supported, references to "Conformance Criterion" were changed to "Conformance Requirement".
          • +
          • 2022-02-22: In the definition of relative luminance, the red threshold was updated from 0.03928 to 0.04045.
          • +
          • 2019-05-09: In 1.3.4 Orientation, the note referencing "binary display orientation" has been clarified to read "content is not necessarily restricted to landscape or portrait display orientation".
          • 2018-08-06: In 1.4.13 Content on Hover or Focus, the word "dismissable" should be "dismissible".
          • 2018-08-06: In 4. Robust, the word "by" is repeated but should be present only once.
          • 2018-08-06: In 5.2.2 Full pages, the third note began with "New" which should be removed.
          • +
          • 2018-07-11: In the Introduction, several (but not all) references to "WCAG 2.0" should be "WCAG 2.1".
          • +
          • 2018-07-11: In the 0.5.2 Numbering in WCAG 2.1, the words "critera" and "ccriteria" should be "criteria".
          • +
          • 2018-07-11: In 1.4.10 Reflow, the first note had a supernumary "Note" indicator which should be removed.
          • 2018-07-11: In 5.3.1 Required Components of a Conformance Claim the editorial note "In WCAG 2.0 this was a dated URI, which may need to be adjusted when this becomes a Rec." should be removed.
          • 2018-07-11: In the definition for keyboard interface, the second (of three) note should be an example of the first note, leaving only two actual notes.
          • 2018-07-11: In the definition for technology, the third note should instead be an example.
          • 2018-06-08: In 7. Input Purposes for User Interface Components, the word "county" should be "country".
          • -
          • 2019-05-09: In 1.3.4 Orientation, the note referencing "binary display orientation" has been clarified to read "content is not necessarily restricted to landscape or portrait display orientation".
          • -
          • 2022-02-02: In a note in the definition of accessibility supported, references to "Conformance Criterion" were changed to "Conformance Requirement".
          • -
          • 2022-02-22: In the definition of relative luminance, the red threshold was updated from 0.03928 to 0.04045.
          • -
          • 2023-04-18: In 4.1.1 Parsing one note should be deleted, and two notes added, including: "This Success Criterion should be considered as always satisfied for any content using HTML or XML."
          • +
          • In the Status of This Document the paragraph beginning "This document has been reviewed by W3C Members..." appears twice. The first instance of this paragraph should be removed.
          - - {%- assign trDate = "current" -%} - {%- assign trUrl = "https://www.w3.org/TR/WCAG21/" -%} -
          -

          Errata since Current Publication

          -
          -

          Substantive Errata

          -

          No substantive errata have been recorded at present.

          -
          -
          -

          Editorial Errata

          -

          No editorial errata have been recorded at present.

          -
          -
          diff --git a/errata/22.html b/errata/22.html index 0129326f3e..7291aed8eb 100644 --- a/errata/22.html +++ b/errata/22.html @@ -1,3 +1,5 @@ +{%- # PLEASE READ errata/README.md BEFORE EDITING -%} + @@ -16,7 +18,7 @@

          Web Content Accessibility Guidelines (WCAG) 2.2 Errata

          Abstract

          This document records all known errors in the Web Content Accessibility Guidelines (WCAG) 2.2 specification.

          -

          The errata are classified as Substantive or Editorial, and listed in chronological order based on the date of publication to which they are applicable.

          +

          The errata are classified as Substantive or Editorial, 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.
          • @@ -26,6 +28,7 @@

            Abstract

          Substantive corrections are proposed by the Accessibility Guidelines Working Group, which has consensus that they are appropriate; they are not to be considered normative until a new Recommendation is published following the process to revise a Recommendation.

          Please view the public comment instructions if you would like to comment to the Working Group. Comments submitted are publicly available in the archive for the Accessibility Guidelines Working Group public comments mailing list.

          +

          The full commit history can be viewed on GitHub.

          Table of Contents

          diff --git a/errata/README.md b/errata/README.md new file mode 100644 index 0000000000..3c15686b76 --- /dev/null +++ b/errata/README.md @@ -0,0 +1,36 @@ +# 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. + +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-WCAG21-{{ 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 +

          Errata since {{ trDate | date: "%d %B %Y" }} Publication

          +``` + +Each erratum should be in the following format +(replacing `YYYY-MM-DD`, `Section Title`, and `details of what happened`): + +```html +
        • YYYY-MM-DD: In Section Title, details of what happened.
        • +``` + +Adhering to this format is important, as any entries under the latest version will also be +parsed for inclusion within Guideline/SC boxes and Key Terms definitions within Understanding pages. From f41bf826cea59caecc2f5a51e20a1d5d24f92f43 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Wed, 11 Dec 2024 15:50:31 -0500 Subject: [PATCH 06/17] Copy relevant errata file for publish-w3c runs --- 11ty/cp-cvs.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/11ty/cp-cvs.ts b/11ty/cp-cvs.ts index 3adf39bb7c..46938b2dd9 100644 --- a/11ty/cp-cvs.ts +++ b/11ty/cp-cvs.ts @@ -51,3 +51,9 @@ for (const [srcDir, destDir] of Object.entries(dirs)) { await copyFile(srcPath, destPath); } } + +await mkdirp(join(wcagBase, "errata")); +await copyFile( + join(outputBase, "errata", `${wcagVersion}.html`), + join(wcagBase, "errata", "Overview.html") +); From d7cad70b1987bf84e910cced5e46c86141a6579a Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Wed, 11 Dec 2024 16:09:17 -0500 Subject: [PATCH 07/17] Prevent date drift in errata due to timezone --- eleventy.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/eleventy.config.ts b/eleventy.config.ts index 3823ad2e72..d23ed1feeb 100644 --- a/eleventy.config.ts +++ b/eleventy.config.ts @@ -279,6 +279,7 @@ export default function (eleventyConfig: any) { root: ["_includes", "."], jsTruthy: true, strictFilters: true, + timezoneOffset: 0, // Avoid off-by-one YYYY-MM-DD date stamp conversions termsMap, }) ); From e27e07c5021766e03cd304efc4fdb9e0612ec988 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Wed, 11 Dec 2024 17:39:52 -0500 Subject: [PATCH 08/17] Add errata pages to dev index.html --- index.html | 2 ++ 1 file changed, 2 insertions(+) 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 }}

          {%- endif %}
            +
          • Errata for 2.1 +
          • Errata for 2.2 {% if includeGuidelines -%}
          • Guidelines
          • {%- endif %} From 6449897cb2ffc2b150b027e72310d9d6d7b3670c Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Wed, 11 Dec 2024 17:40:05 -0500 Subject: [PATCH 09/17] Add errata section to top-level README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 66c59c52de..7ecd29e4fa 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,14 @@ To create a working example: * Reference working examples from techniques using the rawgit URI to the example in its development branch, e.g., `https://rawgit.com/w3c/wcag/main/working-examples/alt-attribute/`. Editors will update links when examples are approved. * When the example is complete and functional, submit a pull request into the main branch. +## Errata + +The errata documents for WCAG 2.1 and 2.2 are now maintained in this repository. +See the [Errata README](errata/README.md) for authoring details. + +**Note:** The errata for both versions are maintained on the `main` branch for use in builds. +Direct edits to the guidelines for WCAG 2.1 must be performed under `guidelines/` on the `WCAG-2.1` branch. + ## Translations WCAG 2.2 is ready for translation. To translate WCAG 2.2, follow instructions at [How to Translate WCAG 2](https://www.w3.org/WAI/about/translating/wcag/). From 7b2218e2339c11002c2f03058857c6024becd454 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Mon, 16 Dec 2024 13:06:59 -0500 Subject: [PATCH 10/17] Update errata format based on discussion with Mike/Alastair/Bruce --- errata/21.html | 32 ++++++++++++++++---------------- errata/22.html | 2 +- errata/README.md | 11 ++++++++++- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/errata/21.html b/errata/21.html index dfb9014cda..fb12f864ec 100644 --- a/errata/21.html +++ b/errata/21.html @@ -18,7 +18,7 @@

            Web Content Accessibility Guidelines (WCAG) 2.1 Errata

            Abstract

            This document records all known errors in the Web Content Accessibility Guidelines (WCAG) 2.1 specification.

            -

            The errata are classified as Substantive or Editorial, and listed in reverse chronological order based on the date of publication to which they are applicable.

            +

            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.
            • @@ -65,21 +65,21 @@

              Substantive Errata

              Editorial Errata

                -
              • 2023-04-18: In 4.1.1 Parsing one note should be deleted, and two notes added, including: "This Success Criterion should be considered as always satisfied for any content using HTML or XML."
              • -
              • 2022-02-02: In a note in the definition of accessibility supported, references to "Conformance Criterion" were changed to "Conformance Requirement".
              • -
              • 2022-02-22: In the definition of relative luminance, the red threshold was updated from 0.03928 to 0.04045.
              • -
              • 2019-05-09: In 1.3.4 Orientation, the note referencing "binary display orientation" has been clarified to read "content is not necessarily restricted to landscape or portrait display orientation".
              • -
              • 2018-08-06: In 1.4.13 Content on Hover or Focus, the word "dismissable" should be "dismissible".
              • -
              • 2018-08-06: In 4. Robust, the word "by" is repeated but should be present only once.
              • -
              • 2018-08-06: In 5.2.2 Full pages, the third note began with "New" which should be removed.
              • -
              • 2018-07-11: In the Introduction, several (but not all) references to "WCAG 2.0" should be "WCAG 2.1".
              • -
              • 2018-07-11: In the 0.5.2 Numbering in WCAG 2.1, the words "critera" and "ccriteria" should be "criteria".
              • -
              • 2018-07-11: In 1.4.10 Reflow, the first note had a supernumary "Note" indicator which should be removed.
              • -
              • 2018-07-11: In 5.3.1 Required Components of a Conformance Claim the editorial note "In WCAG 2.0 this was a dated URI, which may need to be adjusted when this becomes a Rec." should be removed.
              • -
              • 2018-07-11: In the definition for keyboard interface, the second (of three) note should be an example of the first note, leaving only two actual notes.
              • -
              • 2018-07-11: In the definition for technology, the third note should instead be an example.
              • -
              • 2018-06-08: In 7. Input Purposes for User Interface Components, the word "county" should be "country".
              • -
              • In the Status of This Document the paragraph beginning "This document has been reviewed by W3C Members..." appears twice. The first instance of this paragraph should be removed.
              • +
              • 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."
              • +
              • 2022-02-02: In a note in the definition of accessibility supported, updating "Conformance Criterion" references to "Conformance Requirement".
              • +
              • 2022-02-22: In the definition of relative luminance, updating the red threshold from 0.03928 to 0.04045.
              • +
              • 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".
              • +
              • 2018-08-06: In 1.4.13 Content on Hover or Focus, correcting the word "dismissable" to "dismissible".
              • +
              • 2018-08-06: In 4. Robust, removing repetition of the word "by".
              • +
              • 2018-08-06: In 5.2.2 Full pages, removing "New" from the beginning of the third note.
              • +
              • 2018-07-11: In the Introduction, correcting several (but not all) "WCAG 2.0" references to "WCAG 2.1".
              • +
              • 2018-07-11: In the 0.5.2 Numbering in WCAG 2.1, correcting the words "critera" and "ccriteria" to "criteria".
              • +
              • 2018-07-11: In 1.4.10 Reflow, removing a supernumary "Note" indicator from the first note.
              • +
              • 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."
              • +
              • 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.
              • +
              • 2018-07-11: In the definition for technology, updating the third note to instead be an example.
              • +
              • 2018-06-08: In 7. Input Purposes for User Interface Components, correcting the word "county" to "country".
              • +
              • In the Status of This Document removing the first instance of the repeated paragraph beginning "This document has been reviewed by W3C Members...".
            diff --git a/errata/22.html b/errata/22.html index 7291aed8eb..06375a3b75 100644 --- a/errata/22.html +++ b/errata/22.html @@ -18,7 +18,7 @@

            Web Content Accessibility Guidelines (WCAG) 2.2 Errata

            Abstract

            This document records all known errors in the Web Content Accessibility Guidelines (WCAG) 2.2 specification.

            -

            The errata are classified as Substantive or Editorial, and listed in reverse chronological order based on the date of publication to which they are applicable.

            +

            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.
            • diff --git a/errata/README.md b/errata/README.md index 3c15686b76..f6b5e47b1b 100644 --- a/errata/README.md +++ b/errata/README.md @@ -32,5 +32,14 @@ Each erratum should be in the following format
            • YYYY-MM-DD: In Section Title, details of what happened.
            • ``` -Adhering to this format is important, as any entries under the latest version will also be +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. + +`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 ... From 71809d71c9273e6f1dfc337c9881605bd5d332b8 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Tue, 17 Dec 2024 17:19:44 -0500 Subject: [PATCH 11/17] Errata: Add support for multiple "subject" links in one item --- 11ty/guidelines.ts | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/11ty/guidelines.ts b/11ty/guidelines.ts index 05fce1849f..4e198c37d6 100644 --- a/11ty/guidelines.ts +++ b/11ty/guidelines.ts @@ -306,7 +306,7 @@ export const getPrinciplesForVersion = async (version: WcagVersion) => export const getErrataForVersion = async (version: WcagVersion) => { const $ = await loadFromFile(join("errata", `${version}.html`)); const $guidelines = await loadRemoteGuidelines(version, false); - const aSelector = `a[href*='#']:first-of-type`; + const aSelector = `a[href*='}}#']:first-of-type`; const errata: Record = {}; $("main > section[id]") @@ -314,25 +314,31 @@ export const getErrataForVersion = async (version: WcagVersion) => { .find(`li:has(${aSelector})`) .each((_, el) => { const $el = $(el); - const $aEl = $el.find(aSelector); - let hash: string | undefined = $aEl.attr("href")!.replace(/^.*#/, ""); - - // Check whether hash pertains to a guideline/SC section or term definition; - // if it doesn't, attempt to resolve it to one - const $hashEl = $guidelines(`#${hash}`); - if (!$hashEl.is("section.guideline, #terms dfn")) { - const $closest = $hashEl.closest("#terms dd, section.guideline"); - if ($closest.is("#terms dd")) hash = $closest.prev().find("dfn[id]").attr("id"); - else hash = $closest.attr("id"); - } - if (!hash) return; - const erratumHtml = $el - .html()! - .replace(/^.*?<\/a>,?\s*/g, "") - .replace(/^(\w)/, (_, p1) => p1.toUpperCase()); - if (hash in errata) errata[hash].push(erratumHtml); - else errata[hash] = [erratumHtml]; + .html()! + // Remove everything before and including the final TR link + .replace(/^[\s\S]*href="\{\{\s*\w+\s*\}\}#[\s\S]*?<\/a>,?\s*/, "") + // Remove parenthetical github references (still in Liquid syntax) + .replace(/\(\{%.*%\}\)\s*$/, "") + .replace(/^(\w)/, (_, p1) => p1.toUpperCase()); + + $el.find(aSelector).each((_, aEl) => { + const $aEl = $(aEl); + let hash: string | undefined = $aEl.attr("href")!.replace(/^.*#/, ""); + + // Check whether hash pertains to a guideline/SC section or term definition; + // if it doesn't, attempt to resolve it to one + const $hashEl = $guidelines(`#${hash}`); + if (!$hashEl.is("section.guideline, #terms dfn")) { + const $closest = $hashEl.closest("#terms dd, section.guideline"); + if ($closest.is("#terms dd")) hash = $closest.prev().find("dfn[id]").attr("id"); + else hash = $closest.attr("id"); + } + if (!hash) return; + + if (hash in errata) errata[hash].push(erratumHtml); + else errata[hash] = [erratumHtml]; + }); }); return errata; From d2a0f1452e898885bc5f514a53556aac6436ec28 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Tue, 17 Dec 2024 17:19:58 -0500 Subject: [PATCH 12/17] Add gh shortcode for linking to github PRs or commit hashes --- eleventy.config.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/eleventy.config.ts b/eleventy.config.ts index d23ed1feeb..7b438dbc5e 100644 --- a/eleventy.config.ts +++ b/eleventy.config.ts @@ -385,6 +385,19 @@ export default function (eleventyConfig: any) { } ); + // Renders a link to a GitHub commit or pull request, in parentheses + eleventyConfig.addShortcode("gh", (id: string) => { + if (/^#\d+$/.test(id)) { + const num = id.slice(1); + return `${id}` + } + else if (/^[0-9a-f]{7,}$/.test(id)) { + const sha = id.slice(0, 7); // Truncate in case full SHA was passed + return `${sha}` + } + else throw new Error(`Invalid SHA or PR ID passed to gh tag: ${id}`); + }); + // Renders a section box (used for About this Technique and Guideline / SC) eleventyConfig.addPairedShortcode( "sectionbox", From bf26476645caf52467e2e1c162219a931015f8af Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Tue, 17 Dec 2024 17:36:18 -0500 Subject: [PATCH 13/17] Update template for trUrl capture; add README sections --- errata/21.html | 2 +- errata/README.md | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/errata/21.html b/errata/21.html index fb12f864ec..b6841518e6 100644 --- a/errata/21.html +++ b/errata/21.html @@ -54,7 +54,7 @@

              Editorial Errata

              {%- assign trDate = "2018-06-05" -%} {%- capture trUrl -%} - https://www.w3.org/TR/{{ trDate | split: "-" | first }}/REC-WCAG21-{{ trDate | replace: "-", "" }}/ + https://www.w3.org/TR/{{ trDate | split: "-" | first }}/REC-WCAG{{ page.fileSlug }}-{{ trDate | replace: "-", "" }}/ {%- endcapture -%}

              Errata since {{ trDate | date: "%d %B %Y" }} Publication

              diff --git a/errata/README.md b/errata/README.md index f6b5e47b1b..d47c862787 100644 --- a/errata/README.md +++ b/errata/README.md @@ -3,6 +3,8 @@ 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. @@ -14,7 +16,7 @@ For sections corresponding to previous versions, assignments should follow this ``` {%- assign trDate = "YYYY-MM-DD" -%} {%- capture trUrl -%} - https://www.w3.org/TR/{{ trDate | split: "-" | first }}/REC-WCAG21-{{ trDate | replace: "-", "" }}/ + https://www.w3.org/TR/{{ trDate | split: "-" | first }}/REC-WCAG{{ page.fileSlug }}-{{ trDate | replace: "-", "" }}/ {%- endcapture -%} ``` @@ -25,6 +27,8 @@ The level 2 heading in the top-level section for each previous version should us

              Errata since {{ trDate | date: "%d %B %Y" }} Publication

              ``` +## Erratum format + Each erratum should be in the following format (replacing `YYYY-MM-DD`, `Section Title`, and `details of what happened`): From ab58e5ffd416f8d20b6427a407824b2291a99f98 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Tue, 17 Dec 2024 17:36:57 -0500 Subject: [PATCH 14/17] Document errata since original 2.2 publication --- errata/22.html | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/errata/22.html b/errata/22.html index 06375a3b75..3cfbe2f4bd 100644 --- a/errata/22.html +++ b/errata/22.html @@ -51,6 +51,82 @@

              Editorial Errata

              No editorial errata recorded at present.

            + + {%- assign trDate = "2023-10-05" -%} + {%- capture trUrl -%} + https://www.w3.org/TR/{{ trDate | split: "-" | first }}/REC-WCAG{{ page.fileSlug }}-{{ trDate | replace: "-", "" }}/ + {%- endcapture -%} +
            +

            Errata since {{ trDate | date: "%d %B %Y" }} Publication

            +
            +

            Substantive 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 7. Input Purposes for User Interface Components, + correcting the word "dissement" to "arrondissement". + ({% gh "#4034" %}) +
            • +
            • + 2024-11-19: + In the definition for cognitive function test, + updating the term from uppercase to lowercase. + ({% gh "#3943" %}) +
            • +
            • + 2024-11-19: + In Abstract, modifying language regarding devices. + ({% gh "#3776" %}) +
            • +
            • + 2024-11-19: + In 3.3.8 Accessible Authentication (Minimum) + and the definitions for change of context, + general flash and red flash thresholds, and + structure, changing ordered lists to unordered lists when no order is intended. + ({% gh "#3756" %}) +
            • +
            • + 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: Removing the defunct "encloses" definition. ({% gh "#3636" %})
            • +
            • + 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" %}) +
            • +
            +
            +
          From 66f0f1b577f3af40c17b16c83d5ff8799cb39dd8 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Tue, 17 Dec 2024 17:37:18 -0500 Subject: [PATCH 15/17] Expand errata authoring docs --- errata/README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/errata/README.md b/errata/README.md index d47c862787..33b0776776 100644 --- a/errata/README.md +++ b/errata/README.md @@ -30,14 +30,45 @@ The level 2 heading in the top-level section for each previous version should us ## Erratum format Each erratum should be in the following format -(replacing `YYYY-MM-DD`, `Section Title`, and `details of what happened`): +(replacing `YYYY-MM-DD`, `Section Title`, `details of changes`, and `#NNNN`): ```html -
        • YYYY-MM-DD: In Section Title, details of what happened.
        • +
        • + 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. @@ -47,3 +78,16 @@ For example: - 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 From ee70fe5b14eea726f4cc3c086e1249fa44c91ac1 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Tue, 17 Dec 2024 18:06:56 -0500 Subject: [PATCH 16/17] Add github links to 2.1 errata and fix ordering --- errata/21.html | 100 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 85 insertions(+), 15 deletions(-) diff --git a/errata/21.html b/errata/21.html index b6841518e6..0335ead4d0 100644 --- a/errata/21.html +++ b/errata/21.html @@ -65,21 +65,91 @@

          Substantive Errata

          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."
          • -
          • 2022-02-02: In a note in the definition of accessibility supported, updating "Conformance Criterion" references to "Conformance Requirement".
          • -
          • 2022-02-22: In the definition of relative luminance, updating the red threshold from 0.03928 to 0.04045.
          • -
          • 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".
          • -
          • 2018-08-06: In 1.4.13 Content on Hover or Focus, correcting the word "dismissable" to "dismissible".
          • -
          • 2018-08-06: In 4. Robust, removing repetition of the word "by".
          • -
          • 2018-08-06: In 5.2.2 Full pages, removing "New" from the beginning of the third note.
          • -
          • 2018-07-11: In the Introduction, correcting several (but not all) "WCAG 2.0" references to "WCAG 2.1".
          • -
          • 2018-07-11: In the 0.5.2 Numbering in WCAG 2.1, correcting the words "critera" and "ccriteria" to "criteria".
          • -
          • 2018-07-11: In 1.4.10 Reflow, removing a supernumary "Note" indicator from the first note.
          • -
          • 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."
          • -
          • 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.
          • -
          • 2018-07-11: In the definition for technology, updating the third note to instead be an example.
          • -
          • 2018-06-08: In 7. Input Purposes for User Interface Components, correcting the word "county" to "country".
          • -
          • In the Status of This Document removing the first instance of the repeated paragraph beginning "This document has been reviewed by W3C Members...".
          • +
          • + 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" %}) +
          • +
          • + 2022-02-02: + In a note in the definition of accessibility supported, + updating "Conformance Criterion" references to "Conformance Requirement". + ({% gh "#1777" %}) +
          • +
          • + 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" %}) +
          • +
          • + 2018-06-08: + In 7. Input Purposes for User Interface Components, + correcting the word "county" to "country". + ({% gh "426e131" %}) +
          • +
          • In the Status of This Document, + removing the first instance of the repeated paragraph beginning "This document has been reviewed by W3C Members...". +
          From 659629152242a176a1288470adfdf34bb5c9c144 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Wed, 15 Jan 2025 13:25:32 -0500 Subject: [PATCH 17/17] Documentation fixes --- eleventy.config.ts | 2 +- errata/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eleventy.config.ts b/eleventy.config.ts index 7b438dbc5e..95d973b5c1 100644 --- a/eleventy.config.ts +++ b/eleventy.config.ts @@ -385,7 +385,7 @@ export default function (eleventyConfig: any) { } ); - // Renders a link to a GitHub commit or pull request, in parentheses + // Renders a link to a GitHub commit or pull request eleventyConfig.addShortcode("gh", (id: string) => { if (/^#\d+$/.test(id)) { const num = id.slice(1); diff --git a/errata/README.md b/errata/README.md index 33b0776776..59d05ecc12 100644 --- a/errata/README.md +++ b/errata/README.md @@ -30,7 +30,7 @@ The level 2 heading in the top-level section for each previous version should us ## Erratum format Each erratum should be in the following format -(replacing `YYYY-MM-DD`, `Section Title`, `details of changes`, and `#NNNN`): +(replacing `YYYY-MM-DD`, `Section Title`, `sectionid`, `details of changes`, and `#NNNN`): ```html