Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

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://mystmd.org/guide/exercises#directive-solution suggests a way to deal with this situation in the context of exercises

here we try to see if the same holds with, say admonition or grid directives

admonition

admonition-start - Unknown Directive
some text before
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
some text after

:::