mbox series

[RFC,0/3] fix epub and latexpdf targets not finding glob images

Message ID 20251030-fix-make-multi-target-v1-0-213616ed1f0a@cherry.de
Headers show
Series fix epub and latexpdf targets not finding glob images | expand

Message

Quentin Schulz Oct. 30, 2025, 3:17 p.m. UTC
Currently the `make all` target simply doesn't work, it'll fail the epub
build because of missing images (the ones listed in image or figure
directives with glob patterns).

The same can be reproduced with `make html epub` or `make html
latexpdf`. This is due to how Sphinx caches the output of the parsing
step and the way we generate the PDFs and PNGs from SVGs for the epub
and latexpdf targets (which are run after the html target).

This migrates us from this Makefile logic to
sphinxcontrib-svg2pdfconverter, or rather an in-tree fork of it.

Marked as RFC because
1) The source code of the plugin is licensed under BSD-3-Clause and
   IANAL so I don't know if it's fine for us,
2) I would rather use upstream and add sphinxcontrib-svg2pdfconverter to
   Pipfile and the docs building instructions, but we need the MR[1] to
   be merged and a new release made before we can do that. Once upstream
   merges it, we likely will need to add a recipe for it in OE-Core to
   be able to still build the docs with the docs toolchain I believe?

See the last patch in the series for a description of the actual
problem, a dive-in Sphinx cache and why I believe this is the proper
fix.

[1] https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter/pull/31

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
Quentin Schulz (3):
      sphinx: import sphinxcontrib.rsvgconverter sphinx plugin in-tree
      sphinx: rsvgconverter: add support for PNG output
      convert SVGs to PDF and PNG using rsvgconverter plugin

 documentation/Makefile                |  26 +--------
 documentation/conf.py                 |   5 ++
 documentation/sphinx/rsvgconverter.py | 106 ++++++++++++++++++++++++++++++++++
 3 files changed, 114 insertions(+), 23 deletions(-)
---
base-commit: 8b85245490ae0b19a9c3880ec31e55b42e19d094
change-id: 20251029-fix-make-multi-target-d2de9d4ff7ec

Best regards,