Closed MomoInSpace closed 2 years ago
Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
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).
Welcome to the EBP community! :tada:
Heya, I believe this is a limitation of sphinx, which only stores filenames without their extensions, which means that it cannot discriminate
This works with nbsphinx
I imagine this only because nbsphinx does not incorporate a Mardown file reader. If you used e.g. nbsphinx + myst_parser
you would have the same problem.
If you don't want any .md
files to be parsed, I think you may be able to set: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-source_suffix, to not include it, e.g.
source_suffix = {
'.rst': 'restructuredtext',
'.ipynb': 'myst-nb',
}
or you can store the paired files in different folders, with https://jupytext.readthedocs.io/en/latest/config.html
[formats]
"notebooks/" = "ipynb"
"markdown/" = "myst"
TLTR:
If there are two files with the same name but different endings, say
file.md
andfile.ipynb
, how can one prioritize to render the output of the.ipynb
instead of the empty output of the.md
files?Describe the bug
I'm working in a sphinx project where we want to use myst-nb with paired notebooks. That means that we have folders with files with the same name but different endings:
We now want to exclude the Markdown files for building the sphinx site by using the following option in the conf.py file:
This works with nbsphinx, but apparently myst-nb still uses the
.md
files instead of the.ipynb
files, as sphinx doesn't generate output this way. When you delete all paired markdown files we have output. Is there another way to tell myst-nb to prefer one filetype over the other when you have the same filename, just different types? Otherwise it should use the exclude patterns and ignore the files in said array.Reproduce the bug
Create a sphinx project, eg with
Modify the
index.rst
(see below). Then create a paired notebook with the nameneat_example
in the foldersome_folder
, it should have a header and some output. Finally, modify theconfig.py
as seen below. If you now switch betweennbsphinx
andmyst_nb
in the extensions, you will see, that after building the project, you have an output with nbsphinx, whereas it is missing when using the myst_nb extension.config.py
index.rst:
List your environment
myst-nb 0.13.2 jupytext_version 1.13.8 python 3.8.3 sphinx 4.5.0