Skip to content

Commit 57cdc91

Browse files
patrickhlaukeiadawnkfranqueiro
authored
Rename "Key Terms" to "Glossary" in understanding and add intro paragraph (#5413)
Renames "Key Terms" to "Glossary" in understanding (to match the actual normative specification) and adds a bit of introductory context to the start of the disclosure widget. Hopefully this reinforces the idea that these are not just informative made-up things from understanding, but actual references to normative / specification definitions Closes #5409 Preview: open any understanding doc in https://deploy-preview-5413--wcag2.netlify.app/understanding/ and see the "Key Terms" section there --------- Co-authored-by: Kevin White <kevin@w3.org> Co-authored-by: Kenneth G. Franqueiro <kfranqueiro@users.noreply.github.com>
1 parent ffdb3ba commit 57cdc91

7 files changed

Lines changed: 23 additions & 30 deletions

File tree

‎11ty/CustomLiquid.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ export class CustomLiquid extends Liquid {
311311
// Expand techniques links to always include title
312312
$(understandingToTechniqueLinkSelector).each((_, el) => expandTechniqueLink($(el)));
313313

314-
// Add key terms and references by default, to be removed in #parse if not needed
315-
$body.append(generateIncludeWithParams("dl-section", { title: "Key Terms" }));
314+
// Add glossary and references by default, to be removed in #parse if not needed
315+
$body.append(generateIncludeWithParams("dl-section", { title: "Glossary", intro: "<p>This page references the following definitions from the specification:</p>" }));
316316
$body.append(generateIncludeWithParams("dl-section", { title: "References" }));
317317
}
318318

@@ -464,7 +464,7 @@ export class CustomLiquid extends Liquid {
464464
console.warn(`${inputPath}: Term not found: ${name}`);
465465
return;
466466
}
467-
// Return standardized name for Key Terms definition lists
467+
// Return standardized name for Glossary definition lists
468468
return term.name;
469469
};
470470

@@ -477,7 +477,7 @@ export class CustomLiquid extends Liquid {
477477
.attr("target", "terms");
478478
});
479479
} else if (scope.isUnderstanding) {
480-
const $termsList = $("section#key-terms dl");
480+
const $glossaryList = $("section#glossary dl");
481481
const extractTermNames = ($links: CheerioAnyNode) =>
482482
compact(uniq($links.toArray().map((el) => extractTermName($(el)))));
483483

@@ -497,7 +497,7 @@ export class CustomLiquid extends Liquid {
497497
}
498498
}
499499

500-
// Iterate over sorted names to populate alphabetized Key Terms definition list
500+
// Iterate over sorted names to populate alphabetized Glossary definition list
501501
termNames.sort((a, b) => {
502502
if (a.toLowerCase() < b.toLowerCase()) return -1;
503503
if (a.toLowerCase() > b.toLowerCase()) return 1;
@@ -513,7 +513,7 @@ export class CustomLiquid extends Liquid {
513513
<p><a href="https://www.w3.org/WAI/WCAG${scope.version}/errata/">View all errata</a></p>
514514
`;
515515
}
516-
$termsList.append(`\n <dt id="${term.id}">${term.name}</dt><dd>${termBody}</dd>`);
516+
$glossaryList.append(`\n <dt id="${term.id}">${term.name}</dt><dd>${termBody}</dd>`);
517517
}
518518

519519
// Iterate over non-href links once more in now-expanded document to add hrefs
@@ -523,7 +523,7 @@ export class CustomLiquid extends Liquid {
523523
});
524524
} else {
525525
// No terms: remove skeleton that was placed in #parse
526-
$("section#key-terms").remove();
526+
$("section#glossary").remove();
527527
}
528528
}
529529

@@ -539,8 +539,8 @@ export class CustomLiquid extends Liquid {
539539
.remove();
540540

541541
// Prepend guidelines base URL to non-dfn anchor links in guidelines-derived content
542-
// (including both the guideline/SC box at the top and Key Terms at the bottom)
543-
$("#guideline, #success-criterion, #key-terms")
542+
// (including both the guideline/SC box at the top and Glossary at the bottom)
543+
$("#guideline, #success-criterion, #glossary")
544544
.find("a[href^='#']:not([href^='#dfn-'])")
545545
.each((_, el) => {
546546
el.attribs.href = scope.guidelinesUrl + el.attribs.href;
@@ -569,14 +569,14 @@ export class CustomLiquid extends Liquid {
569569
</div>`);
570570
});
571571

572-
// Add header to example sections in Key Terms (aside) and Conformance (div)
572+
// Add header to example sections in Glossary (aside) and Conformance (div)
573573
$("aside.example, div.example").each((_, el) => {
574574
const $el = $(el);
575575
$el.prepend(`<p class="example-title marker">Example</p>`);
576576
});
577577

578578
// Perform second pass over notes/examples, to number when there are multiple in one section or dd
579-
$("#key-terms dd, #success-criterion").each((_, containerEl) => {
579+
$("#glossary dd, #success-criterion").each((_, containerEl) => {
580580
for (const selector of [".example-title", ".note-title"]) {
581581
const $titles = $(containerEl).find(selector);
582582
if ($titles.length > 1) {

‎_includes/dl-section.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<section id="{{ title | slugify }}">
22
<details>
33
<summary><h2>{{ title }}</h2></summary>
4+
{{ intro }}
45
<dl></dl>
56
</details>
67
</section>

‎css/additional.css‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ ol.enumur {
6262
list-style-type: upper-roman;
6363
}
6464

65-
div.div2 dl, dl.keyterms {
66-
margin-left: 1.5em;
67-
}
68-
6965
p, td {
7066
line-height: 1.4;
7167
margin-left: .5em;

‎errata/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Each erratum should be in the following format
4242
```
4343

4444
Adhering to this format is important, as any entries under the latest published version will also be
45-
parsed for inclusion within Guideline/SC boxes and Key Terms definitions within Understanding pages.
45+
parsed for inclusion within Guideline/SC boxes and Glossary definitions within Understanding pages.
4646
(Newlines are insignificant and are suggested for source code readability.)
4747

4848
Each piece of this format is further explained in the subsections below.

‎understanding/about.html‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ <h3>Structure of the Documents</h3>
5656
</ul>
5757
<p><em>Understanding <strong>Success Criterion</strong></em> pages include:</p>
5858
<ul>
59-
<li> The success criterion wording from WCAG</li>
60-
<li> Intent of the success criterion </li>
61-
<li> Benefits, how it helps people with disabilities</li>
62-
<li> Examples </li>
63-
<li> Related resources</li>
59+
<li>The success criterion wording from WCAG</li>
60+
<li>Intent of the success criterion</li>
61+
<li>Benefits, how it helps people with disabilities</li>
62+
<li>Examples</li>
63+
<li>Related resources</li>
6464
<li>Techniques
6565
<ul>
66-
<li> Sufficient techniques</li>
67-
<li> Advisory techniques</li>
68-
<li> Failures</li>
66+
<li>Sufficient techniques</li>
67+
<li>Advisory techniques</li>
68+
<li>Failures</li>
6969
</ul>
7070
</li>
71-
<li> Key terms for this success criterion, from the WCAG Glossary </li>
71+
<li>Glossary for this success criterion, from the WCAG Glossary </li>
7272
</ul>
7373
</section>
7474
</section>

‎understanding/intro.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ <h1>Introduction to Understanding WCAG {{ versionDecimal }}</h1>
3535
<p>Additional advisory techniques that go beyond what is required to meet the success criterion but can be used to make some or all types of content more accessible. Use of advisory techniques does not impact the level of conformance claimed. </p>
3636
</li>
3737
<li>
38-
<p>Key terms for this success criterion (taken from the WCAG {{ versionDecimal }} Glossary)</p>
38+
<p>Glossary for this success criterion (taken from the WCAG {{ versionDecimal }} Glossary)</p>
3939
</li>
4040
</ul>
4141
<p>Links are provided from each Guideline in WCAG {{ versionDecimal }} directly to each <em>Understanding Guideline X.X</em> in this document. Similarly, there is a link from each success criterion in WCAG {{ versionDecimal }} to the <em>Understanding Success Criterion X.X.X</em> section in this document. </p>

‎understanding/understanding.css‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ ol.enumur {
6161
list-style-type: upper-roman;
6262
}
6363

64-
div.div2 dl, dl.keyterms {
65-
margin-left: 1.5em;
66-
}
67-
6864
p, td {
6965
line-height: 1.4;
7066
margin-left: .5em;

0 commit comments

Comments
 (0)