Using html visit/depart methods for singlehtml builder

Skip to first unread message

Apr 29, 2021, 6:52:16 PMApr 29
to sphinx-dev
It seems like there are a lot of sphinx extensions that don't add support for the `singlehtml` builder when using `add_node` in their respective setups. It seems to me that many nodes that get added for the `html` builder would use the same `visit` and `depart` methods for the `singlehtml` builder as they both target html but just in a different structure.  

Looking at the sphinx application it looks like it would be possible to transfer these methods

However I am not an html expert so looking for feedback if this would be worth setting up for Sphinx. Any package that does define a specific singlehtml translator_asset would take precedence.

The downside to automatic assignment of visit/depart methods is the author of the extension may not have intended it to be used for `singlehtml` but in most cases I have come across they share methods for both builders and it is often an oversight when setting up the extension.

Alternatively does anyone know a way this can be done? I guess the other alternative is to keep opening PR's on any extension that doesn't support singlehtml. 

Komiya Takeshi

May 2, 2021, 4:45:12 AMMay 2
Good point. Absolutely, it's difficult to list up all of the variety
of HTML builders. So it would be better to apply the handlers to the
HTML-family builders. Could you file an issue to GitHub please? Then,
I'll consider changing the behavior.

Takeshi KOMIYA

2021年4月30日(金) 7:52 <>:
> --
> You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> To view this discussion on the web, visit

May 2, 2021, 5:15:11 AMMay 2
to sphinx-dev

Thanks Takeshi -- I will setup a GitHub issue with this request and I might try and take a stab at this via a PR as well. 
Reply all
Reply to author
0 new messages