jupyter / jupyter-sphinx

Sphinx extension for rendering of Jupyter interactive widgets.
https://jupyter-sphinx.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
188 stars 65 forks source link

Feature request: allow temporarily suppressing execution of cells #177

Open slavoutich opened 3 years ago

slavoutich commented 3 years ago

Problem that I would like to solve is to avoid cells compilation, that can be quite slow, when it is not needed. For example, one wants to build Sphinx documentation to check if cross-referencing between classes/functions is done right. Checking this does not require Jupyter cell execution, but this task can easily take on the order of several minutes, depending on how heavily jupyter-sphinx is used.

I propose to make jupyter-sphinx compilation to be suppressable by some environment variable, for example:

make JUPYTER_SPHINX_SUPPRESS=true html

In this case, outputs of jupyter-sphinx can be replaced by some dummy output instead of actually executed results, which should speed up compilation a lot.

hagenw commented 3 years ago

That's exactly what I was looking for as well. E.g. when running link checking with sphinx it would be great to disable execution of Jupyter cells.

One solution would be to add a config option, which can be used to disable execution of cells globally and which can then be easily set when running sphinx on the command line.