Skip to content
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

How should we handle images? (accessibility and attribution) #51

Open
peytondmurray opened this issue Oct 24, 2023 · 1 comment
Open

Comments

@peytondmurray
Copy link
Collaborator

Is your feature request related to a specific page or problem? Please describe.
We need a way to make sure that

  1. Images have proper attribution
  2. Images have alt text, for reasons of accessibility

Describe the solution you'd like
Automated checks for both of these would be ideal (CI). There's an alt text hook here that we could run in src/_build/html/ when a PR is made that could work. We'd probably need something custom - either something at the sphinx level (hard) or a custom pre-commit hook (easy-medium) to parse images and look for attribution metadata.

Describe alternatives you've considered
If we don't have automated checks we'll probably make mistakes with respect to these things. It might sound draconian to enforce rules like this, but I'm trying to be realistic as well.

@nenb
Copy link

nenb commented Jan 29, 2024

Hello 👋

Is this issue still open, and of interest? I'd be happy to pick it up if so.

Current thoughts

  • Use a custom Sphinx extension to implement the logic.
  • The logic for the alt text should be straightforward (similar to the pre-commit hook you shared)
  • For attribution metadata, perhaps we could have a convention that all image attribution uses a "image-attrib" class name in the HTML? Then, the logic could be to parse the code for all <img> tags and check that there is a nested container with the "image-attrib" class name? I'm not sure if this is i) what you are looking for or ii) very robust.
  • An optional (but probably flaky and unnecessary) step could be to post the image and the image attribution metadata to a free multi-modal LLM provider (ie something that accepts text and images) to see if the attribution is appropriate for the image.

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

No branches or pull requests

2 participants