-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add a linter to check the images' alt text #41
Conversation
Pull Request Test Coverage Report for Build 12259315108Details
💛 - Coveralls |
In order to meet the [IBM Accessibility Requirements](https://www.ibm.com/able/requirements/requirements) for the API docs, we need to ensure that all images have appropriate alt text so that users can understand any meaningful visuals. The alt text should serve the same purpose as the images on the page, conveying the same meaning rather than describing visual characteristics. In addition, if an image contains important words for understanding the content, the alt text should include those words as well. This PR adds a linter to check that all images have alt text. The current invalid images, if any, have been included in an allowlist that will help us to not break CI before the text is added. If the script detects an image without alt text, it will show an error indicating the file where the image is located and the line where we are using a sphinx directive like `.. image::` or `.. plot::` that generates an image. Example: ``` 💔 Some images are missing the alt text Errors found in qiskit_ibm_runtime/fake_provider/__init__.py: - Error in line 34: .. plot:: Alt text is crucial for making documentation accessible to all users. It should serve the same purpose as the images on the page, conveying the same meaning rather than describing visual characteristics. When an image contains words that are important to understanding the content, the alt text should include those words as well. ``` To fix the error, the `:alt: [Your text here]` option must be added under the lines indicated in the error messages. However, If the `.. plot::` directive is used, but no image is generated, you can use the option `:nofigs:`. (cherry picked from commit 94454ee)
I don't understand this. If all current images can be left as-is without any alt text, is this a high priority or not? Given the state of it now, please open an issue (or a PR) to ensure that alt text does get added to the currently allow-listed images. Without a tracking issue, I don't see anyone coming back to this in the future. |
Hey @mrossinek , pardon me merging before you intended! It is high priority to fix - Becky has been making good progress on ensuring all 9 APIs on docs.quantum.ibm.com have alt text. She hasn't gotten to this repo yet, but plans to as part of Qiskit/documentation#2408. It's a top priority for the docs team. *We wanted to land this in the meantime for two reasons:
|
No worries at all, I'm glad this is moving along while I'm busy elsewhere and did not have time to review 👍 Simply wanted to follow-up on this, as it caught my eye and I didn't see any discussion around potential follow-ups 👍 |
In order to meet the [IBM Accessibility Requirements](https://www.ibm.com/able/requirements/requirements) for the API docs, we need to ensure that all images have appropriate alt text so that users can understand any meaningful visuals. The alt text should serve the same purpose as the images on the page, conveying the same meaning rather than describing visual characteristics. In addition, if an image contains important words for understanding the content, the alt text should include those words as well. This PR adds a linter to check that all images have alt text. The current invalid images, if any, have been included in an allowlist that will help us to not break CI before the text is added. If the script detects an image without alt text, it will show an error indicating the file where the image is located and the line where we are using a sphinx directive like `.. image::` or `.. plot::` that generates an image. Example: ``` 💔 Some images are missing the alt text Errors found in qiskit_ibm_runtime/fake_provider/__init__.py: - Error in line 34: .. plot:: Alt text is crucial for making documentation accessible to all users. It should serve the same purpose as the images on the page, conveying the same meaning rather than describing visual characteristics. When an image contains words that are important to understanding the content, the alt text should include those words as well. ``` To fix the error, the `:alt: [Your text here]` option must be added under the lines indicated in the error messages. However, If the `.. plot::` directive is used, but no image is generated, you can use the option `:nofigs:`. (cherry picked from commit 94454ee) Co-authored-by: Arnau Casau <[email protected]>
In order to meet the IBM Accessibility Requirements for the API docs, we need to ensure that all images have appropriate alt text so that users can understand any meaningful visuals. The alt text should serve the same purpose as the images on the page, conveying the same meaning rather than describing visual characteristics. In addition, if an image contains important words for understanding the content, the alt text should include those words as well.
This PR adds a linter to check that all images have alt text. The current invalid images, if any, have been included in an allowlist that will help us to not break CI before the text is added.
If the script detects an image without alt text, it will show an error indicating the file where the image is located and the line where we are using a sphinx directive like
.. image::
or.. plot::
that generates an image. Example:To fix the error, the
:alt: [Your text here]
option must be added under the lines indicated in the error messages. However, If the.. plot::
directive is used, but no image is generated, you can use the option:nofigs:
.