Nest code-cells inside of admonitions and block-level syntax in myst notebooks
Can I nest a code-cell under a dropdown cell? i.e.
````{dropdown} title
text content
```{code-cell}
code content
```
text content
````
There is a warning message
WARNING: Found an unexpected `code-cell` directive. Either this file was not converted to a notebook, because Jupytext header content was missing, or the `code-cell` was not converted, because it is nested.
If this is not possible, is there any way that I can hide/toggle a block of text + executable code?
Thanks for bringing this up - right now it's not possible since we are using a 1-to-1 mapping of myst notebooks onto ipynb files, and ipynb has no concept of "nesting" code cell inside of other things. I know that @jstac and @mmcky have brough this up before as well but I couldn't find where, so I'm updating the title of this to be a bit more descriptive and flagging this as an enhancement request 👍
In the meantime, perhaps you could ask around in the discussion forum to see if anyone has solved this particular issue in some other way?
@choldgraf we discussed this in the context of solutions to exercises in sphinx-exercise extension. Here is some past discussions on identifying an way forward for this: https://github.com/executablebooks/sphinx-exercise/issues/24 but no final approach has been decided and a solution has not yet been implemented.
Hello, I'm looking forward to using the output of an executable code cell to nest it with a csv-table directive. I would like to know if there has been any approach to the solution of this matter. Thank you in advance!
@latourfranco in https://github.com/executablebooks/sphinx-exercise/pull/45 we are working on a gated syntax for directives that would enable code-cell to be executed as it remains as the root level of the document. This approach is useful for admonition style directives.
It sounds like you are looking for a copy and paste style of code-cell such that the output can be used in a table?
https://github.com/executablebooks/jupyter-book/issues/1585
@mmcky yeah that is what i´m looking forward to achieving. I could manage to do it another way using Python to generate the csv file that is read by the csv-table directive. Anyway, it would be great to hear if there is any approach to the issue.
Why is this not listed on the Feature voting board?
Note: this is also discussed here - https://github.com/executablebooks/meta/discussions/159, which I think is supposed to be the main place for discussion?
Why is this not listed on the Feature voting board?
Good spot! There's a bug in our voting logic that we've identified and will look to fixing :)
This is still not listed on Feature voting board...
Yeah, I would love to see this reolved.