Using html visit/depart methods for singlehtml builder

12 views
Skip to first unread message

mam...@gmail.com

unread,
Apr 29, 2021, 6:52:16 PM4/29/21
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

unread,
May 2, 2021, 4:45:12 AM5/2/21
to sphin...@googlegroups.com
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.

Thanks,
Takeshi KOMIYA

2021年4月30日(金) 7:52 mam...@gmail.com <mam...@gmail.com>:
> --
> 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 sphinx-dev+...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/sphinx-dev/a70299cf-1cea-44bb-9ff7-c3d6bbdf4157n%40googlegroups.com.

mam...@gmail.com

unread,
May 2, 2021, 5:15:11 AM5/2/21
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
Forward
0 new messages