executablebooks / MyST-Parser

An extended commonmark compliant parser, with bridges to docutils/sphinx
https://myst-parser.readthedocs.io
MIT License
759 stars 196 forks source link

Sphinx error when `myst_parser` is combined with `myst_nb` #962

Open padix-key opened 3 months ago

padix-key commented 3 months ago

What version of myst-parser are you using?

4.0.0

What version dependencies are you using?

sphinx 7.4.7
docutils 0.21.2
myst-nb 1.1.1

What operating system are you using?

Mac

Describe the Bug

When I run sphinx_build with both myst_parser and myst_nb I get the following error. This does not happen with myst_parser only enabled.

File ".../python3.10/site-packages/myst_parser/sphinx_ext/main.py", line 49, in setup_sphinx
    app.registry.transforms.remove(SphinxUnreferencedFootnotesDetector)
ValueError: list.remove(x): x not in list

Expected Behavior

No response

To Reproduce

No response

iso2013 commented 3 months ago

Based on the Jupyter Book configuration, it seems like you're only meant to enable myst_nb, not both myst_parser and myst_md. Does this issue occur with just myst_nb listed in the extensions?

padix-key commented 3 months ago

No, then it works, thanks. However, I would prefer a more meaningful exception, as I assume that this mistake might be common.