nbsphinx icon indicating copy to clipboard operation
nbsphinx copied to clipboard

Prevent adding a source suffix twice

Open martinRenou opened this issue 3 years ago • 1 comments

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 avatar Mar 09 '22 14:03 martinRenou

I can really see documentation taking advantages of both extensions.

martinRenou avatar Mar 09 '22 14:03 martinRenou