conf.py: use PNG first in EPUB output

SVG directly included in EPUB output has multiple issues,
in particular font size and alignment ones (tested on two
EPUB readers). Instead, using PNG, generated from SVG when available
as the primary format for images. GIF and JPEG are fine too.

(From yocto-docs rev: ff3876ca4910cf61bc25bfeb07e65ad6f6a93b48)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reviewed-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Quentin Schulz <foss@0leil.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Michael Opdenacker 2021-10-06 14:17:46 +02:00 committed by Richard Purdie
parent bca3caeaea
commit 858a9af30f

View File

@ -139,3 +139,7 @@ latex_elements = {
'passoptionstopackages': '\PassOptionsToPackage{bookmarksdepth=5}{hyperref}',
'preamble': '\setcounter{tocdepth}{2}',
}
# Make the EPUB builder prefer PNG to SVG because of issues rendering Inkscape SVG
from sphinx.builders.epub3 import Epub3Builder
Epub3Builder.supported_image_types = ['image/png', 'image/gif', 'image/jpeg']