{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Jupyter notebook page\n", "This is a raw Jupyter notebook page, in `.ipynb` format." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Usage" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Basic code execution works:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!hostname\n", "print(sum(range(10)))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Directives work as well, since it is recursively executed by the same parser as normal Markdown files. Of course, Sphinx directives won't be interperted within Jupyter itself, but that is probably OK for development purposes:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```{challenge}\n", "\n", "This is a challenge block\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can learn more about this at the [myst-nb docs](https://myst-nb.readthedocs.io/en/latest/use/execute.html). Most this applies equally to the `.md` files." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Configuration\n", "\n", "The `jupyter_execute_notebooks` variable in conf.py controls execution. Currently, we don't set a default for this, which makes it `auto`. You can read more about this [upstream](https://myst-nb.readthedocs.io/en/latest/use/execute.html). Possible values include:\n", "\n", "* `off`: don't execute\n", "* `auto`: exceute *only if there are missing outputs\n", "* `force`: always re-execute\n", "* `cache`: always execute, but cache the output. Don't re-execute if the input is unchanged." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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.7.3" } }, "nbformat": 4, "nbformat_minor": 4 }