accessibility: add SVG metadata and alt text to wavedrom diagrams#3120
accessibility: add SVG metadata and alt text to wavedrom diagrams#3120Maanvi212006 wants to merge 2 commits into
Conversation
- Update b-immediate.edn, atomic-mem.edn, c-breakpoint-instr.edn with alt text - Add a11y-desc comment to fprs.edn for bytefield diagram - Update docs-resources submodule with wavedrom_a11y.py script
|
I notice the CI is failing due to the script being placed in the docs-resources submodule. Should I move it to a tools/ folder in the main repo instead, or is there a preferred location for this kind of script? |
|
I guess a PR would be sent to docs-resources and then another one to here after the first one is accepted, as this script would help other docs. Bill Traynor (@wmat) Andrew Waterman (@aswaterman) Your opinions? |
|
Agreed, please add the script to docs-resources. As soon as the PR is there, we can update to the latest version of docs-resources and test the accessibility examples. |
|
Alright! I'll open a PR in docs-resources first with the script, and then follow up with a PR here once it's accepted. Will close this one. |
|
Reopening so I can test locally. DO NOT MERGE yet. |
|
So what's the exact test case for this? I have checked out the PR for the accessibility changes to 3 figures, pointed my local source at the latest docs-resources and builts all of the docs with Make. What should happen from an accessibility perspective? I've tried with the Read Aloud chrome extension but don't get any results from the built HTML. |
|
It should actually pick up
But I guess Read Aloud is not able to pick it up. When I searched online, it says that screen readers like NVDA and VoiceOver can give more accurate results. Let me know if this works |
|
Everything is at top of tree now, so you should be able to build and view. |
|
Hi Bill Traynor (@wmat)! Good news — the alt text fix is working.
However I found that Read Aloud still skips the image even with the correct alt text when SVGs are base64 embedded. The only way to make it work is to disable :data-uri: for HTML builds. Two possible approaches:
Which approach would you prefer? |
|
I would suggest to try each solution and see which one works best. Note that you have to consider the PDF as well, not just the HTML. |
Signed-off-by: Maanvi Chetwani <maanvichetwani21@gmail.com>
|
Hi Bill Traynor (@wmat) , just an update!
PDF accessibility is the next step |
PDF Accessibility — Investigation SummaryAs a follow-up to the HTML fix, I investigated whether the same accessibility improvements could be applied to the PDF output. After tracing the full build pipeline, here is what I found. What was investigatedThe WaveDrom diagram pipeline for PDF follows the same path as HTML up to a point: The problem is what happens next. Root causeInspecting the built
A search through the entire What this meansInjecting RecommendationTagged PDF output is not currently supported by
The HTML fix in this PR remains fully working and addresses the accessibility need for the primary format most users interact with online. |

Fixes #1129
This PR adds accessibility improvements to WaveDrom and bytefield diagrams in the HTML output.
Changes:
docs-resources/tools/wavedrom_a11y.py— a script that processes .edn files and injects <title>, , and aria-label into generated SVGs, and also updates the alt text in the [wavedrom, ,svg] block so screen readers can read it when embedded as base64