Skip to content

Commit b5f83fa

Browse files
authored
Merge pull request #66 from martinRenou/optional_ipynb_source_binding
Make .ipynb source binding an opt-out
2 parents 250a1a4 + 83a8730 commit b5f83fa

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/configuration.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,15 @@ Then you should be able to show Notebooks working with bqplot!
5959
.. retrolite:: bqplot.ipynb
6060
6161
.. retrolite:: bqplot.ipynb
62+
63+
Disable the ``.ipynb`` docs source binding
64+
------------------------------------------
65+
66+
By default, jupyterlite-sphinx binds the ``.ipynb`` source suffix so that it renders Notebooks included in the doctree with JupyterLite.
67+
This is known to bring warnings with plugins like sphinx-gallery, or to conflict with nbsphinx.
68+
69+
You can disable this behavior by setting the following config:
70+
71+
.. code-block:: python
72+
73+
jupyterlite_bind_ipynb_suffix = False

src/jupyterlite_sphinx.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ def inited(app: Sphinx, config):
253253
os.makedirs(os.path.join(app.srcdir, CONTENT_DIR), exist_ok=True)
254254

255255
if (
256-
".ipynb" not in config.source_suffix
256+
config.jupyterlite_bind_ipynb_suffix
257+
and ".ipynb" not in config.source_suffix
257258
and ".ipynb" not in app.registry.source_suffix
258259
):
259260
app.add_source_suffix(".ipynb", "jupyterlite_notebook")
@@ -334,6 +335,7 @@ def setup(app):
334335
app.add_config_value("jupyterlite_config", None, rebuild="html")
335336
app.add_config_value("jupyterlite_dir", None, rebuild="html")
336337
app.add_config_value("jupyterlite_contents", None, rebuild="html")
338+
app.add_config_value("jupyterlite_bind_ipynb_suffix", True, rebuild="html")
337339

338340
# Initialize RetroLite and JupyterLite directives
339341
app.add_node(

0 commit comments

Comments
 (0)