You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering if it is possible (not even sure if it should be) to create directives with 4 or more backticks or with a special key so that it spans multiple cells.
The main use case I have in mind is having notebooks that can be written sequentially and can have cached execution where a tabbed directive contains some explanation plus a code cell within it.
Example
Here is how you would get MCMC samples:
````{tabbed} PyMC3
:multicell: true
```{code-cell} ipython
<some pymc3 code>
```
Maybe some comment about PyMC3 specifics
````
````{tabbed} Stan
:multicell: true
```{code-cell} ipython
<some stan code>
```
Maybe some comment about Stan specifics
````
Describe alternatives you've considered
I know I can write the exact same thing in myst and use ipython directives to get the code executed automatically but there are 2 reasons that still make me wish this was possible.
The first is to use that when writing guides of some time intensive features (i.e. in my case generally mcmc sampling) where having cached/manual execution would be great. Even with very simplified code, if I want to compare approaches and have multiple guides and pages in the docs, the execution times gets a bit over the top. As far as I know there is no caching for ipython directives.
The second and less important is being able to see real time the outputs of the code. I can write the code in an ide/notebook seeing the outputs real-time and then copy the source to a myst/sphinx compatible file. But I think there is no harm in dreaming, and maybe someone else has other usecases in mind.
Does it make sense to want something like this to work?
The text was updated successfully, but these errors were encountered:
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
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).
I fear, this would not be compatible with the myst-nb underlying design choices (see discussion in executablebooks/meta#143). You could consider https://github.com/jupyter/jupyter-sphinx (NB: I'm an author), but it's completely oblivious of the myst-nb execution model, and a lot less feature-complete.
I was wondering if it is possible (not even sure if it should be) to create directives with 4 or more backticks or with a special key so that it spans multiple cells.
The main use case I have in mind is having notebooks that can be written sequentially and can have cached execution where a
tabbed
directive contains some explanation plus a code cell within it.Example
Describe alternatives you've considered
I know I can write the exact same thing in myst and use
ipython
directives to get the code executed automatically but there are 2 reasons that still make me wish this was possible.The first is to use that when writing guides of some time intensive features (i.e. in my case generally mcmc sampling) where having cached/manual execution would be great. Even with very simplified code, if I want to compare approaches and have multiple guides and pages in the docs, the execution times gets a bit over the top. As far as I know there is no caching for ipython directives.
The second and less important is being able to see real time the outputs of the code. I can write the code in an ide/notebook seeing the outputs real-time and then copy the source to a myst/sphinx compatible file. But I think there is no harm in dreaming, and maybe someone else has other usecases in mind.
Does it make sense to want something like this to work?
The text was updated successfully, but these errors were encountered: