You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a specific page or problem? Please describe.
We need a way to make sure that
Images have proper attribution
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.
The text was updated successfully, but these errors were encountered:
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.
Is your feature request related to a specific page or problem? Please describe.
We need a way to make sure that
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.
The text was updated successfully, but these errors were encountered: