G
YouTube TikTok Games
Skip to content

docs: report reStructuredText errors and fix duplicated image substitutions - #537

Merged
PierreRaybaut merged 1 commit into
releasefrom
docs/521-docutils-errors
Nov 12, 2026
Merged

PierreRaybaut merged 1 commit into
releasefrom
docs/521-docutils-errors

Conversation

@PierreRaybaut

Copy link
Copy Markdown
Contributor

Closes #521

Summary

doc/conf.py suppressed every docutils message (suppress_warnings = ["docutils"]), so reStructuredText errors went unnoticed, even in the strict gettext build (-W). The suppression was added for the duplicate substitution definitions of doc/index.rst and doc/intro/index.rst, defined once for HTML (64px) and once for LaTeX (1cm) in only:: blocks. These duplicates were actually not harmless: docutils keeps the last definition for every builder, before the only:: filtering, so the HTML pages used the LaTeX definitions. On the published site, the funders' logos and the operating mode icons are 1cm wide instead of 64px, get a white background in the dark theme, and the logos open the image instead of the CEA, CODRA and NLnet websites.

Without the suppression, these 6 duplicates were the only docutils errors left (title errors were fixed by #524).

Changes

  • Fix: each image is defined once, with its HTML attributes and a latex-icon class; a doctree-resolved hook of doc/conf.py, size_latex_icons, sizes the images of this class to 1cm in the LaTeX output (the PDF is unchanged, except that the logos are now links)
  • Build: docutils messages are no longer suppressed, with a comment warning against suppressing them or defining a substitution twice
  • Documentation: release note entry (📖 Documentation, 1.4.1) and French translation

Validation

  • Automated:
    • python -m sphinx build doc build/gettext -b gettext -W -E (the CI command) fails with the suppression removed and the duplicates kept (6 "Duplicate substitution definition name" errors), and succeeds with the fix
    • HTML (en, fr) and LaTeX builds with no warning at all
    • HTML: logos and icons at 64px with the dark-light class, logos linking to their websites; LaTeX: \sphinxincludegraphics[width=1cm] for the same images
    • Ruff clean on doc/conf.py
  • Manual: home page and Getting started page checked in English and French, light and dark themes, and the release note entry

Out of scope

Release note: entry in the 📖 Documentation section of DataLab 1.4.1. This PR targets release (1.4.1 maintenance line); the commit will be cherry-picked into develop.

Assisted-by: Claude Opus 5.5

…utions

doc/conf.py suppressed every docutils message so that the duplicate
substitution definitions of doc/index.rst and doc/intro/index.rst,
defined once for HTML and once for LaTeX in `only::` blocks, would not
fail the strict gettext build. Any reStructuredText error went unnoticed
as a result. Moreover, these duplicates were not harmless: docutils keeps
the last definition for every builder, before `only::` filtering, so the
HTML pages used the LaTeX definitions: the funders' logos and the
operating mode icons were 1cm wide instead of 64px, had a white
background in the dark theme, and the logos opened the image instead of
the funders' websites.

- Define each image once, with its HTML attributes and a `latex-icon`
  class, which a `doctree-resolved` hook of doc/conf.py sizes to 1cm in
  the LaTeX output
- Stop suppressing docutils messages
- Release note entry and French translation

Closes #521

Assisted-by: Claude Opus 5.5
@PierreRaybaut PierreRaybaut added this to the v1.4.1 milestone Nov 12, 2026
@PierreRaybaut PierreRaybaut added the documentation Improvements or additions to documentation label Nov 12, 2026
@PierreRaybaut
PierreRaybaut merged commit d587e60 into release Nov 12, 2026
6 checks passed
@PierreRaybaut
PierreRaybaut deleted the docs/521-docutils-errors branch November 12, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant