Skip to content

[RFC] Add alt texts to images #16895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2023
Merged

[RFC] Add alt texts to images #16895

merged 1 commit into from
Sep 1, 2023

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Jun 19, 2022

I suddenly realized we didn't offer any alt texts for any of our images/diagrams. This PR adds 2 alt texts, to gather feedback on both if we want this and how we are going to provide alt texts for our diagrams (which can be quite complex to explain in words).

I used https://medium.com/nightingale/writing-alt-text-for-data-visualization-2a218ef43f81 and https://sc.edu/about/offices_and_divisions/digital-accessibility/guides_tutorials/alternative_text/charts-diagrams/index.php as two examples to help me write this text (this is my first time properly thinking about alt texts).

@wouterj
Copy link
Member Author

wouterj commented Jun 19, 2022

cc @symfony/diversity-champions and @symfony/team-symfony-docs I guess both of these teams have very relevant insights and knowledge about this :)

@lsmith77
Copy link
Contributor

good catch!

it might actually make sense to run some automated a11y tools on regular intervals over the docs to catch stuff like this.

AFAIK “screenshot” is so generic that it can left off. if its a specific type of chart it makes sense to include it.

@zanbaldwin
Copy link
Member

Agree with the automated a11y tools, but the alt text you’ve provided is good: detailed and succinct.

@wouterj
Copy link
Member Author

wouterj commented Jun 19, 2022

Good idea with adding some automated testing here. We already use GitHub Actions to render the rst source to a complete HTML project, so I guess it shouldn't be too hard to find a tool that is able to lint the generated HTML?
Is there any open source tool you're familiar with that works like this? (a quick google search mostly shows a11y tools that lint websites instead of source code?)

@artyuum
Copy link
Contributor

artyuum commented Feb 28, 2023

Is there any open source tool you're familiar with that works like this? (a quick google search mostly shows a11y tools that lint websites instead of source code?)

@wouterj this tool seems to be able to validate local HTML files.

@wouterj wouterj force-pushed the image-alt-texts branch 2 times, most recently from 2843c6d to 2ea906a Compare August 29, 2023 11:34
@wouterj wouterj marked this pull request as ready for review August 29, 2023 11:34
@wouterj wouterj requested a review from xabbuh as a code owner August 29, 2023 11:34
@carsonbot carsonbot added this to the 5.4 milestone Aug 29, 2023
@wouterj
Copy link
Member Author

wouterj commented Aug 29, 2023

This PR is now fully revisited and complete:

  • All figures now contain an alt description
  • Based on the feedback, I've made the alt descriptions pretty concise and instead favored tweaking the text surrounding the figure to create a better experience.
  • I've added some documentation standards about alt descriptions, heavily inspired by https://www.med.unc.edu/webguide/accessibility/alt-text/
  • While going over all diagrams, I've found some very old and inconsistent diagram styles. I've upgraded all of them to our own diagram style and fixed some exporting bugs for other diagrams.

Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the SVG's look like they have white backgrounds instead of transparent - is that correct?

@wouterj
Copy link
Member Author

wouterj commented Aug 29, 2023

Some of the SVG's look like they have white backgrounds instead of transparent - is that correct?

Yes, all of them should have white backgrounds. I'm not a dark theme user myself, but it seems like we do not automatically invert diagram colors when switching to the dark theme. This means that without the white background, diagrams will be unreadable because it's black on black.

@wouterj
Copy link
Member Author

wouterj commented Aug 29, 2023

Unfortunately, multi line options aren't supported by the Doctrine rst-parser 0.5. I've contributed this to 0.6, but given it includes a BC break I don't think we can backport the fix to 0.5.
I think effort is better spend to work on the phpDocumentor parser, so I think we'll not upgrade to 0.6 any time soon (note that this is also not officially released yet, as the Doctrine team also focuses on the new parser).

TL;DR: all alt text must be on a single line, bypassing our soft 72 character limit. I guess this will help us push towards concise descriptions 😉

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a colossal contribution 😱 Wouter, you are amazing 🙇🙇🙇

I haven't found any typo or issue in the proposed changes, so I'd say this can be merged.

Wouter, would you be able to merge this yourself? If you can't, please tell me and I'll try to do it myself. Thanks!

@sstok
Copy link
Contributor

sstok commented Sep 1, 2023

I don't know what a .dia file is, but it seems there are some .dia.autosave files, is this correct?

@wouterj wouterj merged commit f7fd300 into symfony:5.4 Sep 1, 2023
@wouterj wouterj deleted the image-alt-texts branch September 1, 2023 17:40
@wouterj
Copy link
Member Author

wouterj commented Sep 1, 2023

Thanks for the reviews! Those autosave files were definitely not intended, I've removed them.

Merge up was without a conflict (surprisingly) 😃

wouterj added a commit that referenced this pull request Sep 1, 2023
wouterj added a commit that referenced this pull request Sep 1, 2023
wouterj added a commit that referenced this pull request Sep 1, 2023
* 5.4:
  [#16895] Remove last center align
wouterj added a commit that referenced this pull request Sep 1, 2023
* 6.3:
  Remove 5.x versionadded directives
  [#16895] Remove last center align
wouterj added a commit that referenced this pull request Sep 1, 2023
* 6.4:
  Remove 5.x versionadded directives
  [#16895] Remove last center align
  [#16895] Add alt description to new images
@OskarStark
Copy link
Contributor

Thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants