Skip to content

Commit

Permalink
tools: add navigation ARIA landmark to generated API ToC
Browse files Browse the repository at this point in the history
As an accessibility improvement, specify the navigation landmark for
the element of our docs that contains the table of contents generated
for the specific API page.

Ref: https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/
Ref: https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA20.html
PR-URL: #49882
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
  • Loading branch information
Trott authored and targos committed Nov 11, 2023
1 parent 337a676 commit 732b566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/doc/html.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export function buildToc({ filename, apilinks }) {
.use(htmlStringify)
.processSync(toc).toString();

file.toc = `<details id="toc" open><summary>Table of contents</summary>${inner}</details>`;
file.toc = `<details role="navigation" id="toc" open><summary>Table of contents</summary>${inner}</details>`;
file.tocPicker = `<div class="toc">${inner}</div>`;
} else {
file.toc = file.tocPicker = '<!-- TOC -->';
Expand Down

0 comments on commit 732b566

Please sign in to comment.