Modifying the walk/walkabout methods of a node

36 views
Skip to first unread message

Anton Akhmerov

unread,
Feb 27, 2021, 7:48:00 AM2/27/21
to sphinx-users
Hello everyone,

I would like to render a bundle of outputs generated by Jupyter, all representing the same object. Some outputs are better suited for HTML and some for pdf. So the overall logic that I want to implement is "given this list of different representations of an object, include the one that is best suited to a specific sphinx builder.

Because I want to choose the highest priority node out of a list, the decision cannot be made by examining a single sphinx node. My proposed solution is drafted here. Implement a MimeBundleNode, which modifies the walk and walkabout methods of a node to "pretend" only contained the highest priority child.

While it seems to work™, not being closely familiar with sphinx, I have an uneasy feeling that I'm doing something that I'm not supposed to do. Is there some subtlety that I overlook? Is there a better implementation?

Thanks in advance,
Anton

Komiya Takeshi

unread,
Feb 28, 2021, 12:43:42 AM2/28/21
to sphinx...@googlegroups.com
LGTM!

2021年2月27日(土) 21:48 Anton Akhmerov <i...@antonakhmerov.org>:
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/8ef55217-88a1-4af3-8d36-fd7d0a4bcb79n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages