Skip to content

Commit 5b895ea

Browse files
committed
Add errata and cross-reference from guidelines/SC and key terms
1 parent b034ff5 commit 5b895ea

File tree

6 files changed

+168
-15
lines changed

6 files changed

+168
-15
lines changed

11ty/CustomLiquid.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,15 @@ export class CustomLiquid extends Liquid {
468468
});
469469
for (const name of termNames) {
470470
const term = this.termsMap[name]; // Already verified existence in the earlier loop
471-
$termsList.append(
472-
`<dt id="${term.id}">${term.name}</dt>` +
473-
`<dd><definition>${term.definition}</definition></dd>`
474-
);
471+
let termBody = term.definition;
472+
if (scope.errata[term.id]) {
473+
termBody += `
474+
<p><strong>Errata:</strong></p>
475+
<ul>${scope.errata[term.id].map((erratum) => `<li>${erratum}</li>`)}</ul>
476+
<p><a href="https://www.w3.org/WAI/WCAG${scope.version}/errata/">View all errata</a></p>
477+
`;
478+
}
479+
$termsList.append(`<dt id="${term.id}">${term.name}</dt><dd>${termBody}</dd>`);
475480
}
476481

477482
// Iterate over non-href links once more in now-expanded document to add hrefs

11ty/guidelines.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import type { CheerioAPI } from "cheerio";
33
import { glob } from "glob";
44

55
import { readFile } from "fs/promises";
6-
import { basename } from "path";
6+
import { basename, join } from "path";
77

8-
import { flattenDomFromFile, load, type CheerioAnyNode } from "./cheerio";
8+
import { flattenDomFromFile, load, loadFromFile, type CheerioAnyNode } from "./cheerio";
99
import { generateId } from "./common";
1010

1111
export type WcagVersion = "20" | "21" | "22";
@@ -299,3 +299,24 @@ export const getAcknowledgementsForVersion = async (version: WcagVersion) => {
299299
*/
300300
export const getPrinciplesForVersion = async (version: WcagVersion) =>
301301
processPrinciples(await loadRemoteGuidelines(version));
302+
303+
/** Parses errata items from the errata document for the specified WCAG version. */
304+
export const getErrataForVersion = async (version: WcagVersion) => {
305+
const $ = await loadFromFile(join("errata", `${version}.html`));
306+
const aSelector = `a[href^='https://www.w3.org/TR/WCAG${version}/#']`;
307+
const errata: Record<string, string[]> = {};
308+
309+
$(`li:has(${aSelector})`).each((_, el) => {
310+
const $el = $(el);
311+
const $aEl = $el.find(aSelector);
312+
const hash = new URL($aEl.attr("href")!).hash.slice(1);
313+
const erratumHtml = $el
314+
.html()!
315+
.replace(/^.*?<\/a>,?\s*/g, "")
316+
.replace(/^(\w)/, (_, p1) => p1.toUpperCase());
317+
if (hash in errata) errata[hash].push(erratumHtml);
318+
else errata[hash] = [erratumHtml];
319+
});
320+
321+
return errata;
322+
};

_includes/understanding/about.html

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
{%- if guideline.type == "SC" -%}
2-
{% sectionbox "success-criterion" "Success Criterion (SC)" -%}
3-
{{ guideline.content }}
4-
{%- endsectionbox %}
5-
{%- elsif guideline.type == "Guideline" -%}
6-
{% sectionbox "guideline" "Guideline" -%}
7-
{{ guideline.content }}
8-
{%- endsectionbox %}
9-
{%- endif -%}
1+
{%- capture section_id -%}
2+
{%- if guideline.type == "SC" -%}success-criterion{%- else -%}guideline{%- endif -%}
3+
{%- endcapture -%}
4+
{%- capture section_title -%}
5+
{%- if guideline.type == "SC" -%}Success Criterion (SC){%- else -%}Guideline{%- endif -%}
6+
{%- endcapture -%}
7+
{% sectionbox section_id section_title -%}
8+
{{ guideline.content }}
9+
{%- if errata[guideline.id] %}
10+
<h3>Errata</h3>
11+
<ul>
12+
{%- for erratum in errata[guideline.id] %}
13+
<li>{{ erratum }}</li>
14+
{%- endfor -%}
15+
</ul>
16+
<p><a href="https://www.w3.org/WAI/WCAG{{ version }}/errata/">View all errata</a></p>
17+
{% endif -%}
18+
{%- endsectionbox %}

eleventy.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { resolveDecimalVersion } from "11ty/common";
1111
import {
1212
actRules,
1313
assertIsWcagVersion,
14+
getErrataForVersion,
1415
getFlatGuidelines,
1516
getPrinciples,
1617
getPrinciplesForVersion,
@@ -110,6 +111,7 @@ const termsMap = process.env.WCAG_VERSION ? await getTermsMap(version) : await g
110111
const globalData = {
111112
version,
112113
versionDecimal: resolveDecimalVersion(version),
114+
errata: process.env.WCAG_VERSION ? await getErrataForVersion(version) : {},
113115
techniques, // Used for techniques/index.html
114116
technologies, // Used for techniques/index.html
115117
technologyTitles, // Used for techniques/index.html

errata/21.html

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Web Content Accessibility Guidelines (WCAG) 2.1 Errata</title>
5+
<link rel="stylesheet" type="text/css" href="https://www.w3.org/StyleSheets/TR/base.css" />
6+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7+
</head>
8+
<body>
9+
<div class="head">
10+
<p><a href="https://www.w3.org/"><img src="https://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width="72" /></a></p>
11+
<h1 id="title">Web Content Accessibility Guidelines (WCAG) 2.1 Errata</h1>
12+
<p>Last modified: $Date: 2024/02/01 14:32:47 $</p>
13+
<p class="copyright">Copyright © 2024 <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/policies/#disclaimers">liability</a>, <a href="https://www.w3.org/policies/#trademarks">trademark</a> and <a rel="license" href="https://www.w3.org/copyright/document-license/" title="W3C Document License">permissive license</a> rules apply.</p>
14+
</div>
15+
<hr/>
16+
<section id="abstract">
17+
<h2>Abstract</h2>
18+
<p>This document records all known errors in the <a href="https://www.w3.org/TR/WCAG21/">Web Content Accessibility Guidelines (WCAG) 2.1</a> specification.</p>
19+
<p>The errata are numbered, classified as <a href="#substantive">Substantive</a> or <a href="#editorial">Editorial</a>, and listed in reverse chronological order of their date of publication in each category. </p>
20+
<p>Each entry has the following information:</p>
21+
<ul>
22+
<li>A unique entry number</li>
23+
<li>The date it was added to the errata page.</li>
24+
<li>The section referred to.</li>
25+
<li>A description of the problem and correction if applicable.</li>
26+
<li>A rationale for making the change (not required for editorial errata).</li>
27+
</ul>
28+
<p>Substantive corrections are proposed by the <a href="https://www.w3.org/WAI/GL/">Accessibility Guidelines Working Group</a>, which has consensus that they are appropriate; they are not to be considered normative until a new Recommendation is published following the <a href="https://www.w3.org/2018/Process-20180201/#revised-rec">process to revise a Recommendation</a>.</p>
29+
<p>Please view the <a href="/WAI/standards-guidelines/wcag/commenting/">public comment instructions</a> if you would like to comment to the Working Group. Comments submitted are publicly available in the <a href="http://lists.w3.org/Archives/Public/public-agwg-comments/">archive for the Accessibility Guidelines Working Group public comments mailing list</a>.</p>
30+
</section>
31+
<section id="contents">
32+
<h2>Table of Contents</h2>
33+
<ol class="toc">
34+
<li><a href="#substantive">Substantive Errata</a></li>
35+
<li><a href="#editorial">Editorial Errata</a></li>
36+
</ol>
37+
</section>
38+
<hr/>
39+
<main>
40+
<section id="substantive">
41+
<h2>Substantive Errata</h2>
42+
<p>No substantive errata have been recorded at present.</p>
43+
</section>
44+
<section id="editorial">
45+
<h2>Editorial Errata</h2>
46+
<ul>
47+
<li>In the <a href="https://www.w3.org/TR/WCAG21/#sotd">Status of This Document</a> the paragraph beginning "This document has been reviewed by W3C Members..." appears twice. The first instance of this paragraph should be removed.</li>
48+
<li>In the <a href="https://www.w3.org/TR/WCAG21/#intro">Introduction</a>, several (but not all) references to "WCAG 2.0" should be "WCAG 2.1".</li>
49+
<li>In the <a href="https://www.w3.org/TR/WCAG21/#numbering-in-wcag-2-1">0.5.2 Numbering in WCAG 2.1</a>, the words "critera" and "ccriteria" should be "criteria".</li>
50+
<li>In <a href="https://www.w3.org/TR/WCAG21/#reflow">1.4.10 Reflow</a>, the first note had a supernumary "Note" indicator which should be removed.</li>
51+
<li>In <a href="https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus">1.4.13 Content on Hover or Focus</a>, the word "dismissable" should be "dismissible".</li>
52+
<li>In <a href="https://www.w3.org/TR/WCAG21/#robust">4. Robust</a>, the word "by" is repeated but should be present only once.</li>
53+
<li>In <a href="https://www.w3.org/TR/WCAG21/#cc2">5.2.2 Full pages</a>, the third note began with "New" which should be removed.</li>
54+
<li>In <a href="https://www.w3.org/TR/WCAG21/#conformance-required">5.3.1 Required Components of a Conformance Claim</a> 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.</li>
55+
<li>In the definition for <a href="https://www.w3.org/TR/WCAG21/#dfn-keyboard-interface">keyboard interface</a>, the second (of three) note should be an example of the first note, leaving only two actual notes.</li>
56+
<li>In the definition for <a href="https://www.w3.org/TR/WCAG21/#dfn-technologies">technology</a>, the third note should instead be an example.</li>
57+
<li>In <a href="https://www.w3.org/TR/WCAG21/#input-purposes">7. Input Purposes for User Interface Components</a>, the word "county" should be "country".</li>
58+
<li>In <a href="https://www.w3.org/TR/WCAG21/#orientation">1.3.4 Orientation</a>, the note referencing "binary display orientation" has been clarified to read "content is not necessarily restricted to landscape or portrait display orientation".</li>
59+
<li>In <a href="https://www.w3.org/TR/WCAG21/#issue-container-generatedID-43">a note in the definition of accessibility supported</a>, references to "Conformance Criterion" were changed to "Conformance Requirement".</li>
60+
<li>In the <a href="https://www.w3.org/TR/WCAG21/#dfn-relative-luminance">definition of relative luminance</a>, the red threshold was updated from 0.03928 to 0.04045.</li>
61+
<li>In <a href="https://www.w3.org/TR/WCAG21/#parsing">4.1.1 Parsing</a> 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."</li>
62+
</ul>
63+
</section>
64+
</main>
65+
</body>
66+
</html>

errata/22.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Web Content Accessibility Guidelines (WCAG) 2.2 Errata</title>
5+
<link rel="stylesheet" type="text/css" href="https://www.w3.org/StyleSheets/TR/base.css" />
6+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7+
</head>
8+
<body>
9+
<div class="head">
10+
<p><a href="https://www.w3.org/"><img src="https://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width="72" /></a></p>
11+
<h1 id="title">Web Content Accessibility Guidelines (WCAG) 2.2 Errata</h1>
12+
<p>Last modified: $Date: 2023/07/21 18:31:26 $</p>
13+
<p class="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2018 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). <abbr title="World Wide Web Consortium">W3C</abbr><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/copyright-documents" rel="license">document use</a> rules apply. </p>
14+
</div>
15+
<hr />
16+
<section id="abstract">
17+
<h2>Abstract</h2>
18+
<p>This document records all known errors in the <a href="https://www.w3.org/TR/WCAG22/">Web Content Accessibility Guidelines (WCAG) 2.2</a> specification.</p>
19+
<p>The errata are numbered, classified as <a href="#substantive">Substantive</a> or <a href="#editorial">Editorial</a>, and listed in reverse chronological order of their date of publication in each category. </p>
20+
<p>Each entry has the following information:</p>
21+
<ul>
22+
<li>A unique entry number</li>
23+
<li>The date it was added to the errata page.</li>
24+
<li>The section referred to.</li>
25+
<li>A description of the problem and correction if applicable.</li>
26+
<li>A rationale for making the change (not required for editorial errata).</li>
27+
</ul>
28+
<p>Substantive corrections are proposed by the <a href="https://www.w3.org/WAI/GL/">Accessibility Guidelines Working Group</a>, which has consensus that they are appropriate; they are not to be considered normative until a new Recommendation is published following the <a href="https://www.w3.org/2018/Process-20180201/#revised-rec">process to revise a Recommendation</a>.</p>
29+
<p>Please view the <a href="/WAI/standards-guidelines/wcag/commenting/">public comment instructions</a> if you would like to comment to the Working Group. Comments submitted are publicly available in the <a href="http://lists.w3.org/Archives/Public/public-agwg-comments/">archive for the Accessibility Guidelines Working Group public comments mailing list</a>.</p>
30+
</section>
31+
<section id="contents">
32+
<h2>Table of Contents</h2>
33+
<ol class="toc">
34+
<li><a href="#substantive">Substantive Errata</a></li>
35+
<li><a href="#editorial">Editorial Errata</a></li>
36+
</ol>
37+
</section>
38+
<hr />
39+
<main>
40+
<section id="substantive">
41+
<h2>Substantive Errata</h2>
42+
<p>No substantive errata recorded at present.</p>
43+
</section>
44+
<section id="editorial">
45+
<h2>Editorial Errata</h2>
46+
</section>
47+
<p>No editorial errata recorded at present.</p>
48+
</main>
49+
</body>
50+
</html>

0 commit comments

Comments
 (0)