MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

Configure the parser when called through the `include` directive

Open maximlt opened this issue 2 years ago • 1 comments

Describe the bug

Unless I missed it I do not think it is possible to configure the myst_nb.docutils_ when used to include a notebook in another document via the include directive. I tried both at the global level with nb_execution_mode = 'off' in the conf.py and at the file level with execution_mode set to "off" in the notebook metadata.

Reproduce the bug

Create a notebook foo.ipynb and a document bar.md that contains the following content:

# Markdown file

Blah

## Notebook content

.. include:: foo.ipynb
   :parser: myst_nb.docutils_

Add nb_execution_mode = 'off' in the conf.py and build the docs. The notebook will be executed while, I think, one would expect it not to be executed.

List your environment

# Name                    Version                   Build  Channel
docutils                  0.19             py39h6e9494a_1    conda-forge
myst-nb                   0.17.1                   pypi_0    pypi
myst-parser               0.18.1                   pypi_0    pypi
sphinx                    5.3.0                    pypi_0    pypi

maximlt avatar Jan 31 '23 22:01 maximlt

Just noticed this issue and now I see that it's more than 2 years old and apparently no advances were made :(

Gabriel-p avatar Apr 01 '25 20:04 Gabriel-p