This notebook is part of the nbsphinx
documentation: https://nbsphinx.readthedocs.io/.
Normally, if an exception is raised while executing a notebook, the Sphinx build process is stopped immediately.
If a notebook contains errors on purpose (or if you are too lazy to fix them right now), you have four options:
Manually execute the notebook in question and save the results, see the pre-executed example notebook.
Allow errors in all notebooks by setting this option in conf.py:
nbsphinx_allow_errors = True
Allow errors on a per-notebook basis by adding this to the notebook's JSON metadata:
"nbsphinx": {
"allow_errors": true
},
Allow errors on a per-cell basis using the raises-exception
tag, see Ignoring Errors on a Cell-by-Cell Basis.
This very notebook is an example for the third option.
The results of the following code cells are not stored within the notebook, therefore it is executed during the Sphinx build process.
Since the above-mentioned allow_errors
flag is set in this notebook's metadata, all cells are executed although most of them cause an exception.
In [ ]:
nonsense
In [ ]:
42 / 0
In [ ]:
print 'Hello, world!'
In [ ]:
6 ~ 7
In [ ]:
6 * 7