spatialaudio / nbsphinx

:ledger: Sphinx source parser for Jupyter notebooks
https://nbsphinx.readthedocs.io/
MIT License
451 stars 130 forks source link

Prevent adding a source suffix twice #637

Closed martinRenou closed 2 years ago

martinRenou commented 2 years ago

PR coupled with https://github.com/jupyterlite/jupyterlite-sphinx/pull/28

This prevents collisions between nbsphinx and jupyterlite-sphinx which both add the ".ipynb" source prefix: if app.registry.source_suffix already contains "ipynb", then do nothing.

The behavior will then be the following:

conf.py

# nbsphinx will handle .ipynb files and jupyterlite-sphinx won't
extensions = [
    'nbsphinx',
    'jupyterlite_sphinx',
]

# jupyterlite-sphinx will handle .ipynb files and nbsphinx won't
extensions = [
    'jupyterlite_sphinx',
    'nbsphinx',
]
martinRenou commented 2 years ago

I can really see documentation taking advantages of both extensions.