{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# nbsphinx\n", "\n", "* Homepage: https://github.com/spatialaudio/nbsphinx/\n", "* Documentation: https://nbsphinx.readthedocs.io/\n", "\n", "`nbsphinx` allows you to publish Jupyter notebooks as documentation pages.\n", "\n", "\n", "## Example\n", "\n", "\n", "This whole page is written in a Jupyter Notebook (see [Show Source](https://sphinx-extensions.readthedocs.io/en/latest/_sources/nbsphinx.ipynb.txt))." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datetime\n", "datetime.datetime.now()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Data for plotting:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "t = np.arange(0.0, 2.0, 0.01)\n", "s = 1 + np.sin(2 * np.pi * t)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fig, ax = plt.subplots()\n", "ax.plot(t, s)\n", "ax.set(\n", " xlabel='time (s)',\n", " ylabel='voltage (mV)',\n", " title='About as simple as it gets, folks',\n", ")\n", "ax.grid()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Installation\n", "\n", "```\n", "pip install nbsphinx\n", "```\n", "\n", "\n", "## Configuration\n", "\n", "```python\n", "# conf.py\n", "extensions = [\n", " '...',\n", " 'nbsphinx',\n", "]\n", "```" ] } ], "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.8.1" } }, "nbformat": 4, "nbformat_minor": 4 }