Skip to content

Add alt text to figures on authoring pages - #2138

Draft
cwickham wants to merge 1 commit into
mainfrom
fix/image-alt-authoring
Draft

Add alt text to figures on authoring pages#2138
cwickham wants to merge 1 commit into
mainfrom
fix/image-alt-authoring

Conversation

@cwickham

@cwickham cwickham commented Aug 7, 2026

Copy link
Copy Markdown
Member

Fixes 12 image-alt violations (critical, WCAG 2.0 A, SC 1.1.1) that the axe site audit found on docs/authoring/ pages. Each was an image with no alt attribute.

Changes

File Fix
article-layout.qmd fig-alt on four knitr cells (six figures)
cross-references.qmd fig-alt on the identifier-only subtable screenshot
_cross-references-listings.qmd fig-alt on the fig-plot cell
contents.qmd fig-alt on the contents shortcode screenshot
cross-references-divs.qmd fig-alt on the image used as a table
penguins-qmd.qmd fig-alt on fig-size-scatter, which notebook-embed.qmd embeds
cell-alignment.html alt on the placeholder image in the cell alignment demo

Three cells in article-layout.qmd use echo: fenced, so the new fig-alt option is visible in the rendered code. This also shows readers how to use the option.

Not fixed: placeholder.qmd

The two images on placeholder.qmd keep no alt text. They come from the {{< placeholder >}} shortcode, which returns pandoc.Image({}, result) with an empty alt and accepts no alt argument. An author can work around this with ![alt text]({{< placeholder 600 400 >}}), but this page documents the shortcode itself. A change to its examples changes what the page teaches. A fix belongs upstream in quarto-cli.

Freeze notes

article-layout, cross-references, penguins-qmd, and tables are frozen. Each was rendered from the repository root with R 4.5.2, which is the R version that renv.lock records. Every package used matches renv.lock exactly (0 version mismatches across all 165 locked packages).

Two results in this PR need an explanation:

  1. Figure PNGs change. These are not version drift. A render in the exact locked environment reproduces the bytes in this PR, so the copies on main were stale relative to renv.lock. This PR brings them into line.
  2. leaflet-binding-2.2.3 and htmltools-fill-0.5.9 are new. renv.lock pins leaflet 2.2.3 and htmltools 0.5.9, so these paths are correct. The freeze on main still pointed at 2.2.1 and 0.5.8.1. The older directories stay because docs/presentations/revealjs/demo still references them.

The penguins-qmd freeze holds two results, html.json and ipynb.json. On main these two had different hashes, and the stale ipynb.json was the reason the embedded figure lost its alt text. Both now share the same hash.

Verification

No image lacks an alt attribute on any edited page:

grep -o '<img [^>]*>' _site/docs/authoring/<page>.html | grep -v 'alt='

article-layout, contents, cross-references, cross-references-divs, notebook-embed, penguins-qmd, and tables all return nothing. placeholder still returns its two images.

@github-actions
github-actions Bot temporarily deployed to pull request August 7, 2026 21:03 Inactive
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@cwickham
cwickham marked this pull request as draft August 7, 2026 21:20
Fixes 12 `image-alt` violations (WCAG 2.0 A, SC 1.1.1) found by the axe
site audit. Each was an image with no `alt` attribute.

- `article-layout.qmd`: `fig-alt` on four knitr cells (six figures)
- `cross-references.qmd`: `fig-alt` on a subtable screenshot
- `_cross-references-listings.qmd`: `fig-alt` on the `fig-plot` cell
- `contents.qmd` and `cross-references-divs.qmd`: `fig-alt` on two images
- `penguins-qmd.qmd`: `fig-alt` on `fig-size-scatter`, which
  `notebook-embed.qmd` embeds
- `cell-alignment.html`: `alt` on the placeholder image used by
  `tables.qmd`

The two images on `placeholder.qmd` stay as they are. They come from the
`{{< placeholder >}}` shortcode, which emits no alt and accepts no alt
argument.
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant