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
The API docs don't have alt text for their images, and we need to add it by modifying the Python files in the 9 APIs repos. Each repo has a linter that can be used to verify how many images fail to provide an alternative text.
Each repo's linter has an allowlist defined at the beginning of the script with a list of all the current files that contain an image without alt text. The linter can be found at tools/verify_image.py.
Instructions
Go to the tools/verify_image.py script in each of the 9 APIs.
Look at the ALLOWLIST_MISSING_ALT_TEXT list to find all the files with images without alt text.
Remove the file you want to fix from the ALLOWLIST_MISSING_ALT_TEXT list.
Open a terminal and go to the top-level folder of the repo.
Run the script by executing python tools/verify_image.py to get all the images without alt text in the file.
Example of the output:
💔 Some images are missing the alt text
Errors found in qiskit_ibm_runtime/fake_provider/example.py:
- Error in line 34: .. plot::
- Error in line 55: .. image::
- Error in line 63: .. 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.
This means that the file qiskit_ibm_runtime/fake_provider/example.py has images defined in lines 34, 55, and 63 without alt text.
Find the code lines in the file and add the option :alt: [your alt text] under the directive .. image:: or .. plot:: found in each line. The .. plot:: directive is sometimes used to run code that doesn't generate an image. In those cases the option :nofigs: should be added instead of :alt: [your alt text].
Remove the filename from the ALLOWLIST_MISSING_ALT_TEXT list if all the images are fixed.
Issue
The API docs don't have alt text for their images, and we need to add it by modifying the Python files in the 9 APIs repos. Each repo has a linter that can be used to verify how many images fail to provide an alternative text.
Each repo's linter has an allowlist defined at the beginning of the script with a list of all the current files that contain an image without alt text. The linter can be found at
tools/verify_image.py
.Instructions
tools/verify_image.py
script in each of the 9 APIs.ALLOWLIST_MISSING_ALT_TEXT
list to find all the files with images without alt text.ALLOWLIST_MISSING_ALT_TEXT
list.python tools/verify_image.py
to get all the images without alt text in the file.Example of the output:
This means that the file
qiskit_ibm_runtime/fake_provider/example.py
has images defined in lines 34, 55, and 63 without alt text.:alt: [your alt text]
under the directive.. image::
or.. plot::
found in each line. The.. plot::
directive is sometimes used to run code that doesn't generate an image. In those cases the option:nofigs:
should be added instead of:alt: [your alt text]
.ALLOWLIST_MISSING_ALT_TEXT
list if all the images are fixed.List of the API repos to check:
The text was updated successfully, but these errors were encountered: