[PATCH 4/7] doc: make pdfdocs: Ensure SVG files are converted to PDF before the compilation of *.tex files

Adriano Carvalho adrianocarvalho.pt at gmail.com
Wed Sep 3 03:14:48 CEST 2025


> On Wed, 27 Aug 2025 at 01:23, Tom Rini <trini at konsulko.com> wrote:
> > [...]
> > This is getting closer, yes. Looking at v6.16 in the kernel, it looks
> > like rsvg-convert is a pre-req for pdfdocs there, so we should adopt
> > that (and whatever general updates need to be done) as part of
> > supporting pdfdocs as a target. I was unaware until now just how
> > difficult adding SVG to PDF output was, sorry for the churn here.
> >
> [---]

In Linux, for SVG to PDF conversion they rely on an sphinx-build
extension: Documentation/sphinx/kfigure.py

This extension supports other formats and conversions.

However, for this translation to occur, in *rst files you have to use:

.. kernel-image:: file.svg

Instead of:

.. image:: file.svg

(Also: kernel-figure instead of figure. In U-Boot ".. figure" is never used.)

Funny or not, kfigure.py is present in U-Boot (doc/sphinx/kfigure.py)
and it is already set as a sphinx-build extension.

So, in principle, we "only" need to replace all ".. image" with "..
kernel-image" (65 occurrences / 17 files). However, I did that, and
got:

sphinx.errors.ExtensionError: Handler <bound method
ImageCollector.process_doc of
<sphinx.environment.collectors.asset.ImageCollector object at
0x79380051bbe0>> for event 'doctree-read' threw an exception
(exception: 'uri')

And I still couldn't figure out a solution. I'll keep looking.

Com os melhores cumprimentos. / Best regards.
Adriano Carvalho


More information about the U-Boot mailing list