Skip to content

Conversation

@EZoni
Copy link
Member

@EZoni EZoni commented Oct 10, 2024

While reviewing some of our documentation PRs, I noticed that we use the :alt: (alternate text) syntax in a way that might be neither optimal nor consistent with the reStructuredText figure examples:

.. figure:: picture.png
   :scale: 50 %
   :alt: map to buried treasure

   This is the caption of the figure (a simple paragraph).

As a reminder, the reStructuredText image docs describes alternate text as

Alternate text: a short description of the image, displayed by applications that cannot display images, or spoken by applications for visually impaired users

Before this PR, this is the output when an image is displayed:
Screenshot from 2024-10-10 15-16-25

Before this PR, this is the output when an image is not displayed (e.g., due to a typo in the docs):
Screenshot from 2024-10-10 15-20-20

After this PR, I would propose to have this output when an image is not displayed (e.g., due to a typo in the docs):
Screenshot from 2024-10-10 15-34-00

I think this is a better output for both users that read the docs (avoid reading the caption twice) and visually impaired users (avoid hearing the caption twice - the real caption is spoken too).

Note that in some cases we do not yet provide a caption. I believe we should add a caption to all figures, but I left this out of this PR.

@EZoni EZoni added component: documentation Docs, readme and manual cleaning Clean code, improve readability labels Oct 10, 2024
@EZoni EZoni requested a review from ax3l October 10, 2024 23:18
@EZoni EZoni force-pushed the docs_figures branch 2 times, most recently from c20b4e7 to ac671e7 Compare October 10, 2024 23:21
@EZoni EZoni changed the title Docs: fix reStructuredText syntax for figures [WIP] Docs: fix reStructuredText syntax for figures Oct 11, 2024
ax3l pushed a commit that referenced this pull request Oct 11, 2024
Could we do this to make sure that we run the GitHub Actions and Azure
jobs (build, test) only if _at least one file outside the_ `Docs`
_directory_ is modified, i.e., skip those jobs if only files in the
`Docs` directory are modified?

I think it would be safe to do so (and a bit of a waste of resources to
not do so...), but I leave it open for discussion.

If merged, we could test this rebasing #5386 and seeing if the correct
CI jobs are skipped.

Note that this PR leaves the other CI jobs untouched, e.g., `source`,
`docs`, `CodeQL`, etc.
@EZoni EZoni requested review from RemiLehe and removed request for ax3l October 12, 2024 00:57
@EZoni EZoni assigned RemiLehe and unassigned ax3l Oct 12, 2024
@EZoni
Copy link
Member Author

EZoni commented Oct 12, 2024

Need to double check if the skipping of CI build/test jobs (#5387) worked out well and if can do more on it.

@EZoni EZoni changed the title [WIP] Docs: fix reStructuredText syntax for figures Docs: fix reStructuredText syntax for figures Oct 14, 2024
@EZoni EZoni changed the title Docs: fix reStructuredText syntax for figures [WIP] Docs: fix reStructuredText syntax for figures Oct 22, 2024
@EZoni EZoni force-pushed the docs_figures branch 5 times, most recently from 165de5a to 46e6b0d Compare October 22, 2024 18:13
dpgrote pushed a commit to dpgrote/WarpX that referenced this pull request Oct 23, 2024
Could we do this to make sure that we run the GitHub Actions and Azure
jobs (build, test) only if _at least one file outside the_ `Docs`
_directory_ is modified, i.e., skip those jobs if only files in the
`Docs` directory are modified?

I think it would be safe to do so (and a bit of a waste of resources to
not do so...), but I leave it open for discussion.

If merged, we could test this rebasing BLAST-WarpX#5386 and seeing if the correct
CI jobs are skipped.

Note that this PR leaves the other CI jobs untouched, e.g., `source`,
`docs`, `CodeQL`, etc.
@EZoni EZoni changed the title [WIP] Docs: fix reStructuredText syntax for figures Docs: Fix reStructuredText syntax for figures Nov 3, 2025
@EZoni EZoni changed the title Docs: Fix reStructuredText syntax for figures Docs: Fix reStructuredText syntax for figures Nov 3, 2025
@EZoni
Copy link
Member Author

EZoni commented Nov 3, 2025

Ready for review.

@roelof-groenewald
Copy link
Member

@EZoni sorry about this, but after the documentation changes we merged earlier today, this PR has a couple conflicts.

@EZoni
Copy link
Member Author

EZoni commented Nov 4, 2025

@roelof-groenewald

I think I resolved the conflicts. This should be ready to review again.

Copy link
Member

@roelof-groenewald roelof-groenewald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@roelof-groenewald roelof-groenewald merged commit 5c45760 into BLAST-WarpX:development Nov 4, 2025
45 of 46 checks passed
@EZoni EZoni deleted the docs_figures branch November 4, 2025 17:25
dpgrote pushed a commit to dpgrote/WarpX that referenced this pull request Nov 5, 2025
While reviewing some of our documentation PRs, I noticed that we use the
`:alt:` (alternate text) syntax in a way that might be neither optimal
nor consistent with the `reStructuredText` [figure
examples](https://docutils.sourceforge.io/docs/ref/rst/directives.html#figure):

```rst
.. figure:: picture.png
   :scale: 50 %
   :alt: map to buried treasure

   This is the caption of the figure (a simple paragraph).
```


As a reminder, the `reStructuredText` [image
docs](https://docutils.sourceforge.io/docs/ref/rst/directives.html#image)
describes alternate text as

> Alternate text: a short description of the image, displayed by
applications that cannot display images, or spoken by applications for
visually impaired users

_Before_ this PR, this is the output when an image is displayed:
![Screenshot from 2024-10-10
15-16-25](https://github.com/user-attachments/assets/f3b364b3-459f-4092-a350-5c64feedbbda)

_Before_ this PR, this is the output when an image is _not_ displayed
(e.g., due to a typo in the docs):
![Screenshot from 2024-10-10
15-20-20](https://github.com/user-attachments/assets/360a54e3-aded-49da-9d7f-10ae12c2e5d2)

_After_ this PR, I would propose to have this output when an image is
_not_ displayed (e.g., due to a typo in the docs):
![Screenshot from 2024-10-10
15-34-00](https://github.com/user-attachments/assets/bb59612f-f0f2-495b-9e4e-9a7678a215eb)

I think this is a better output for both users that read the docs (avoid
reading the caption twice) and visually impaired users (avoid hearing
the caption twice - the real caption is spoken too).

Note that in some cases we do not yet provide a caption. I believe we
should add a caption to all figures, but I left this out of this PR.
ax3l pushed a commit that referenced this pull request Nov 5, 2025
Follow up to #5386.

@ax3l pointed out that the :alt: text should always provide a concise
description of the image for digital accessibility, even if the caption
is also always accessible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleaning Clean code, improve readability component: documentation Docs, readme and manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants