Closed choldgraf closed 3 years ago
What happens if the button is provided by the theme?
Right now it will purely look for ThebeButtonNode
and if that doesn't exist, it won't load thebe
. I guess the assumption is that if the theme is hard-coding a button then they could also manually load the JS itself? What do you think is a good solution there (other than loading it on every single page regardless of whether there's a button on it)?
Perhaps checking if thebe is configured and there are cells to execute? This seems to be agnostic with respect to the execution method.
@akhmerov I opened up this one to track this: https://github.com/executablebooks/sphinx-thebe/issues/34
I think the main question is "are there cells to execute". e.g., how do you define what that means? (wanna take conversation over to https://github.com/executablebooks/sphinx-thebe/issues/34?)
This conditionally loads thebe so that the JS is only loaded on pages that have a
thebe
button.supercedes https://github.com/executablebooks/sphinx-thebe/pull/14
Also pins our Sphinx lower bound to 3.5 since that is when conditional loading was introduced.