use case¶
it’s sometimes useful to create a code-cell that is not a first-level object in the flat data model that jupyter lab would consider
for example, you want to create an executable cell within an admonition; your first attempt would be
::::{admonition} I have an included executable cell
some text before
```{code-cell} python
print("I am inside the admonition)
```
some text after
::::kind of works¶
which indeed would work in MyST (as in: the cell is executed):
BUT if you try to open this in JupyterLab, then this time the cell is not executed
the workaround¶
https://
here we try to see if the same holds with, say admonition or grid directives
admonition¶
admonition-start - Unknown Directive
admonition-start - Unknown Directivesome text before
print("I am inside the admonition")The history saving thread hit an unexpected error (OperationalError('attempt to write a readonly database')).History will not be written to the database.I am inside the admonition
admonition-end - Unknown Directive
admonition-end - Unknown Directivesome text after :::