{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Ignoring Errors\n", "\n", "Normally, if an exception is raised while executing a notebook, the Sphinx build process is stopped immediately.\n", "\n", "If a notebook contains errors on purpose (or if you are too lazy to fix them now), you can add this to the notebook's JSON metadata:\n", "\n", "```json\n", "\"nbsphinx\": {\n", " \"allow_errors\": true\n", "},\n", "```\n", "\n", "This very notebook is an example for this behavior.\n", "The results of the following code cells are not stored within the notebook, therefore it is executed during the Sphinx build process.\n", "Since the above-mentioned `allow_errors` flag is set in this notebook, all cells are executed although most of them cause an exception." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "nonsense" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "42 / 0" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "print 'Hello, world!'" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "6 ~ 7" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "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.4.4rc1" }, "nbsphinx": { "allow_errors": true } }, "nbformat": 4, "nbformat_minor": 0 }