Open NickleDave opened 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:
Hi ! +1 on this issue.
I think warning about this behaviour should be made more visible, maybe in the https://myst-nb.readthedocs.io/en/latest/quickstart.html
I noticed when googling that there used to be a {warning}
callout but it must have been removed at some point?
From this page: https://myst-nb.readthedocs.io/en/v0.9.0/_sources/use/myst.md.txt
:::{warning}
If you are using MyST-NB in your documentation, do not activate `myst-parser`. It will
be automatically activated by `myst-nb`.
:::
This is more direct (and possibly not the friendliest of language, maybe why it was removed) but still doesn't state directly that activating both will cause an error
@NickleDave If I replace 'myst_parser'
with 'myst_nb'
, in the extensions
variable, while writing in Markdown syntax
source_suffix = {'.md': 'markdown'`}
I get the error
Sphinx error:
Source parser for markdown not registered
make: *** [html] Error 2
It seems to me that the myst_parser is required to write in Markdown.
I have the same issue -- I have non-notebook documentation written in myst-markdown, and wanted to switch from nbsphinx
to myst-nb
for my notebook-driven documentation pages to avoid their pandoc dependency and get fully into the executablebooks ecosystem. However, it seems I cannot have both because of this issue.
FYI -- I have installed myst_nb from the current main
branch, rev 3d6a5d1
, in order to use it with sphinx 6.2.1
I'm new to this and quite confused. Maybe the general idea is to pipe everything via jupytext
into myst_nb
because every .md
file is potentially a Notebook file?
https://docs.readthedocs.io/en/stable/guides/jupyter.html#using-notebooks-in-other-formats suggests:
# conf.py
nb_custom_formats = {
".md": ["jupytext.reads", {"fmt": "mystnb"}],
}
In which case myst-nb
handles both plain .md
files and Notebooks in .md
format? Is there any downside to this (handling .md
via myst-nb
instead of using myst-parser
)?
+1 same issue here 😅 are already workarounds available?
Sounds like the question of whether to specify both myst-nb
and myst-parser
in extension
is confusing in general.
But we're now at a point on this issue where people are chiming in with multiple things that might or might not be related.
@chrisjsewell @choldgraf apologies in advance for adding to your notifications but what do you think about clarifying here and/or adding info in the docs about when and how to use these extensions together?
Describe the bug
Hi, thanks so much for MyST-NB, I am very happy I can include .md notebooks in my build, and switch over from
nbsphinx
fairly painlessly.I am not even sure if this is a bug per se but it is behavior that was a bit surprising so I want to raise an issue about it, since I would guess that other people that switch to
myst-parser
and then addmyst-nb
might run into the same situation.context I added MyST-NB to a project after switching from .rst to MyST parser, because I wanted to additionally execute notebooks during builds, which double as tutorial material in the docs.
This gave me something like the following in my
conf.py
expectation I expected to be able to just build and execute notebooks after this.
bug But instead I get:
(I get the same error when using
sphinx-autobuild
, if it matters.)problem
I think this might be intended behavior, judging from this note in the docs?
But it's still surprising, at least to me.
I would guess one of the following behaviors might be a bit less confusing:
there is no need to add myst_parser when you are using myst_nb, please remove myst_parser from extensions in conf.py
myst_parser
fromextensions
if you addmyst_nb
"Reproduce the bug
I am able to get this to happen with a minimal build so I'm pretty sure it's not something unique to my setup.
extensions
includesmyst_nb
andmyst_parser
index.md
List your environment