Ensure zundler runs last when building with sphinx

This commit is contained in:
Adrian Vollmer 2024-04-29 10:14:34 +02:00
parent 8338cb62f7
commit 8f14aef403

View File

@ -26,9 +26,7 @@ class ZundlerBuilder(StandaloneHTMLBuilder):
self.app.original_outdir
)
def finish(self):
super().finish()
def run_zundler(self):
from zundler.embed import embed_assets
root_doc = self.config.zundler_root_doc
@ -54,6 +52,10 @@ class ZundlerBuilder(StandaloneHTMLBuilder):
)
def run_zundler(app, exception):
app.builder.run_zundler()
def setup(app):
# Fix the outdir. We want to build the files into $builddir/html first,
# then $builddir/$target second.
@ -94,6 +96,10 @@ def setup(app):
app.add_builder(ZundlerBuilder)
# This should run as the last function in the build-finished event
# Set a high priority and hope nothing is higher
app.connect("build-finished", run_zundler, priority=2**32)
return {
"version": "0.1",
"parallel_read_safe": True,