-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when used with Jupyter Book: source_suffix '.ipynb' is already registered #27
Comments
Thanks for reporting. I wonder what should be done for fixing this. We could either use the I guess the second option is best. The end user can override that in their configuration anyway (see https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-source_suffix). So maybe something like try:
app.add_source_suffix(".ipynb", "jupyterlite_notebook")
except ExtensionError:
# Show a warning explaining how to force "jupyterlite_notebook"?
pass |
Yeah, I was wondering if there was a way of looking up already registered source suffixes, other than raising an exception if you try to re-add one, but I can't spot anything from a quick look at the docs. The |
Looking at the Sphinx code, we could probably do: if '.ipynb' not in self.app.registry.source_suffix:
app.add_source_suffix(".ipynb", "jupyterlite_notebook")
else:
# Show a warning explaining how to force "jupyterlite_notebook"?
pass
I guess the side-effect there would be that if you're already using |
We can also probably do just like nbsphinx does https://github.com/spatialaudio/nbsphinx/blob/64cd5a4ddadc8fb03887f3fac821cdfd184d6246/src/nbsphinx.py#L1889-L1890 |
Actually what nbsphinx does does not work and collide with jupyterlite-sphinx, so I guess my proposition above is safer. |
Running this extension with Jupyter Book (a custom sphinx build), which already has
ipynb
registered as a file type, generates an error when building a book:Also described here: jupyter-book/jupyter-book#1344 (comment)
Offending line is presumably:
jupyterlite-sphinx/src/jupyterlite_sphinx.py
Line 274 in f14181a
The text was updated successfully, but these errors were encountered: