From 2a7946370905855e197ba5f00855d1c41e03f4f7 Mon Sep 17 00:00:00 2001 From: Frankie Robertson Date: Mon, 9 Mar 2026 11:00:15 +0200 Subject: [PATCH] Add an error message when both myst_nb and myst_parser included in extensions --- myst_nb/sphinx_ext.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/myst_nb/sphinx_ext.py b/myst_nb/sphinx_ext.py index 9a7b7996..a7db3e47 100644 --- a/myst_nb/sphinx_ext.py +++ b/myst_nb/sphinx_ext.py @@ -45,6 +45,12 @@ def sphinx_setup(app: Sphinx): # note, for core events overview, see: # https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx-core-events + if "myst_parser" in app.extensions: + raise ValueError( + "Cannot load both myst_nb and myst_parser Sphinx extensions " + "-- load only myst_nb since it includes myst_parser" + ) + # Add myst-parser configuration and transforms (but does not add the parser) setup_myst_parser(app)