-
Notifications
You must be signed in to change notification settings - Fork 86
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 alt text to API docs #2408
Comments
New Instructions! The linter is now installable using
pip install git+https://github.com/Qiskit/documentation.git#subdirectory=scripts/image-tester
sphinx-alt-text-validator -f [FolderToCheck] where
Example of the output:
This means that the file
|
Images in Qiskit missing alt text: qiskit-missing-alt-text.txt |
Images in Qiskit Runtime missing alt text:
|
Qiskit Runtime updates: Qiskit/qiskit-ibm-runtime#2079 |
Qiskit updates: Qiskit/qiskit#13555 |
PR for OBP addon: Qiskit/qiskit-addon-obp#45 |
PR for Cutting addon Qiskit/qiskit-addon-cutting#725 |
PR for Utils addon: Qiskit/qiskit-addon-utils#64 |
PR for MPF addon: Qiskit/qiskit-addon-mpf#43 |
All repos are done; just waiting for approvals / merges. |
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 (with the new instructions, all APIs can be checked):
The text was updated successfully, but these errors were encountered: