Closed HTenkanen closed 3 years ago
Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:
Jupyter book ingests notebooks so you may use that option for authoring. About marking specific cells as executable: isn't the typical use case to have all cells executable? What is the use case for the selectivity?
f I have understood correctly, the current approaches require that I need to use MyST or RST syntax for writing my code as well.
Not if you use https://github.com/executablebooks/MyST-NB π
this looks to be related to https://github.com/executablebooks/jupyter-book/issues/833
Note that already in myst-nb, if you set the enable-thebe
metadata tag, then this is stored in the HTML as a class tag_enable-thebe
on a div
around the code block.
So this may be useful for thebe? (I haven't properly looked into the working of thebe yet)
Thanks for your quick replies! π
@akhmerov : We have actually been using a setup running as a Sphinx project without Jupyterbook (mainly due to historical reasons), i.e. we build our pages with MyST-NB
and sphinx-book-theme
. This setup has worked nicely, but do I understand correctly that getting the interactivity to work as described in the Jupyterbook docs is not currently possible to do with "pure" Sphinx project? If so, then perhaps we need to consider changing our setup to Jupyterbook. Indeed there is no particular reason for us to be able to select specific cells to be executable with Thebelab.
@chrisjsewell
Note that already in myst-nb, if you set the enable-thebe metadata tag, then this is stored in the HTML as a class tag_enable-thebe on a div around the code block. So this may be useful for thebe? (I haven't properly looked into the working of thebe yet)
Okay, this is good to know! Sounds useful and I guess this could be a workaround but indeed I am not too familiar with these libraries so requires some more investigation.
Indeed there is no particular reason for us to be able to select specific cells to be executable with Thebelab.
But in that case the out of the box behavior when all cells are thebelab-ed should work just fine for you, or am I missing something?
If you don't want to use myst at all (as opposed to rst), there's https://jupyter-sphinx.readthedocs.io/
Right now it's much more barebones, but I'd like to take over all myst-agnostic parts from myst.
@akhmerov Okay we managed to figure it out and everything is working. πͺ It was just about getting the configuration correctly: we needed to use the path_to_docs
parameter for Binder to correctly find our notebooks and use thebe: True
instead of thebelab: True
(some old configuration probably from my previous tests in the past). Sorry for bothering and thanks for help! This issue can be closed as solved from our side.
Hi guys, and thanks for the great work that you're doing!
I've been playing around with the idea to use sphinx-thebe / jupyter-sphinx to allow interactive code cells in our book and teaching materials. Correct me if I am wrong, but it seems that neither of these projects allow tagging the code-blocks that the user wants to be executable with thebelab by using a cell-tag? If I have understood correctly, the current approaches require that I need to use MyST or RST syntax for writing my code as well.
An ideal approach for me would be that for the code blocks, I could use the Jupyter Notebook code cells as usual and e.g. see the outputs while I'm programming and developing the materials, and then I could just add e.g. something like
enable-thebe
tag to the metadata of the given cell (or to the whole notebook) and then during the building of the pages, these tags would be identified and processed so that my html pages would have those "Activate" buttons etc. in place. Hence, this would work in a bit similar manner as when allowing errors in the codes with theraises-exception
tag.Does this sound like something that could be implemented or is there actually something like this already in place (didn't find)?
Thanks!