{ "cells": [ { "cell_type": "markdown", "metadata": { "nbsphinx": "hidden" }, "source": [ "This notebook is part of the `nbsphinx` documentation: https://nbsphinx.readthedocs.io/." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Explicitly Dis-/Enabling Notebook Execution\n", "\n", "If you want to include a notebook without outputs and yet don't want `nbsphinx` to execute it for you, you can explicitly disable this feature.\n", "\n", "You can do this globally by setting the following option in [conf.py](conf.py):\n", "\n", "```python\n", "nbsphinx_execute = 'never'\n", "```\n", "\n", "Or on a per-notebook basis by adding this to the notebook's JSON metadata:\n", "\n", "```\n", "\"nbsphinx\": {\n", " \"execute\": \"never\"\n", "},\n", "```\n", "\n", "There are three possible settings, `\"always\"`, `\"auto\"` and `\"never\"`.\n", "By default (= `\"auto\"`), notebooks with no outputs are executed and notebooks with at least one output are not.\n", "As always, per-notebook settings take precedence over the settings in `conf.py`.\n", "\n", "This very notebook has its metadata set to `\"never\"`, therefore the following cell is not executed:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "6 * 7" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.7" }, "nbsphinx": { "execute": "never" } }, "nbformat": 4, "nbformat_minor": 2 }