Skip to content

[docs] Add alt text on images #4028

@jameslamb

Description

@jameslamb

Summary

For every image in LightGBM's documentation, alternative text that describes the image should be added.

Motivation

People with limited vision use screen readers to view web pages. When these screen readers encounter an image, they will only read some placeholder like "IMAGE" by default. However, if the "alt" tag is specified, many screen readers will use that instead.

Adding alt text for images would improve the accessibility of LightGBM's documentation for users who use screen readers.

Description

To help with this issue, submit a pull request that adds alt text for images in LightGBM's documentation. Please limit pull requests to only 1 file, to simplify reviews.

As of this writing, the following documentation files have images (based on git grep -E "\.\. image" docs)

When adding alt text, follow the advice in https://accessibility.psu.edu/images/alttext/.

...include what you might relay over the phone

it should describe the image. It should NOT include information about copyright or any extra information that would be relevant to a seeing audience.

This can be done with the :alt: parameter in Sphinx ..image directives (see the Sphinx docs for details).

For example:

.. image:: ./_static/images/some-image.png
  :alt: A screenshot with build logs from GCC.

References

While working on this, you might also consider some of the recommendations from https://webaim.org/techniques/screenreader/#how. For example, things that should be read out loud as acronyms, like gcc, should be spelled out all in capital letters ("GCC").

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions