From 278fe418cf3cc5b9889bd1f9973a417a3560796f Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Wed, 15 Apr 2026 12:23:25 +0300 Subject: fix: also patch DirectoryHTMLBuilder for WebP priority ReadTheDocs uses a builder that subclasses DirectoryHTMLBuilder, not StandaloneHTMLBuilder. Patch both to ensure WebP is preferred in all HTML build variants. Co-Authored-By: Claude Opus 4.6 (1M context) --- docs/conf.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'docs/conf.py') diff --git a/docs/conf.py b/docs/conf.py index b2c871c5..eacec2c7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -200,11 +200,14 @@ texinfo_documents = [ def setup(app): # Prefer WebP for HTML output; LaTeX keeps its default (PDF/PNG/JPEG) - from sphinx.builders.html import StandaloneHTMLBuilder - StandaloneHTMLBuilder.supported_image_types = [ + webp_types = [ 'image/webp', 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg', - ] \ No newline at end of file + ] + from sphinx.builders.html import StandaloneHTMLBuilder + StandaloneHTMLBuilder.supported_image_types = webp_types + from sphinx.builders.dirhtml import DirectoryHTMLBuilder + DirectoryHTMLBuilder.supported_image_types = webp_types \ No newline at end of file -- cgit v1.2.3