feat: Add a Chapter on Accessibility in the Rustdoc book#151106
feat: Add a Chapter on Accessibility in the Rustdoc book#151106JayanAXHF wants to merge 9 commits intorust-lang:mainfrom
Conversation
8ded36a to
07d2971
Compare
|
r? @notriddle rustbot has assigned @notriddle. Use |
This comment has been minimized.
This comment has been minimized.
|
@GuillaumeGomez The chapter is (imo) complete and ready for review! |
|
@rustbot r? GuillaumeGomez |
Co-authored-by: Michael Howell <michael@notriddle.com>
|
@rustbot ready |
| 1. `rustdoc` only uses JavaScript to make your experience better, but `rustdoc` works perfectly well without it, meaning that most interactive features should work well without JavaScript. This ensures that no hidden scripts or interactive elements mess with screen readers and other accessibility tools. | ||
| 2. `rustdoc` uses semantic HTML elements wherever possible. | ||
| 1. We use `<details>` instead of checkboxes so text can still be searched in hidden and collapsed content. | ||
| 2. We use the `title` attribute to make your experience better, but `rustdoc` is perfectly usable without them. The **`title`** global attribute contains text representing advisory information related to the element it belongs to.[^4] |
There was a problem hiding this comment.
| 2. We use the `title` attribute to make your experience better, but `rustdoc` is perfectly usable without them. The **`title`** global attribute contains text representing advisory information related to the element it belongs to.[^4] | |
| 2. We use the `title` attribute on HTML elements. The **`title`** attribute contains text representing advisory information related to the element it belongs to.[^4] |
Also it's the only attribute/tag you explain.
There was a problem hiding this comment.
Yeah I need to expand on this a bit more, haven't gotten enough time though rn due to exams and all
There was a problem hiding this comment.
Isn't the whole point of this note to elaborate that title should never be used for vital functionality?
There was a problem hiding this comment.
Yeah iirc that's why it's there. I should make that clearer
| 1. We use `<details>` instead of checkboxes so text can still be searched in hidden and collapsed content. | ||
| 2. We use the `title` attribute to make your experience better, but `rustdoc` is perfectly usable without them. The **`title`** global attribute contains text representing advisory information related to the element it belongs to.[^4] | ||
| 3. All necessary elements are annotated by aria labels, to ensure that all elements have an accessible name[^4] for screen reader compatibility. | ||
| 4. `rustdoc` has expansive support for keyboard navigation, such as keybinds for searching, focusing and interacting with the UI. |
There was a problem hiding this comment.
I don't see how it's related to accessibility.
There was a problem hiding this comment.
The first point? Well some screenreaders have trouble with collapsible sections, and the recommended way to have collapsibles is using the semantic tags. Some sites just use js and random tags for that, so I though it'd be worth mentioning
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
This PR adds a chapter on the accessibility of rustdoc, the accessible practices followed by rustdoc, WCAG 2.1 compliance, and known issues with rustdoc w.r.t. accessibility. Please see #151007 for more information.
Zulip Discussion: #t-rustdoc > A Proposal to Make Rustdoc More Accessible
cc: @GuillaumeGomez