diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml index 7c7e8b2cc..ac2a96540 100644 --- a/.github/workflows/docbuild.yml +++ b/.github/workflows/docbuild.yml @@ -27,7 +27,7 @@ jobs: XVFB: 1 run: | cd docs - make html + python -m sphinx source build -j 4 - name: Upload docs uses: actions/upload-artifact@v1 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..1abfefe00 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: + - repo: local + hooks: + - id: jupyter-nb-clear-output + name: jupyter-nb-clear-output + files: \.ipynb$ + stages: [commit] + language: system + entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 82427080e..2745aa8bd 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -62,6 +62,7 @@ 'kwargsdocs', 'methodsdocs', 'myst_nb', + 'nbsphinx', ] # Add any paths that contain templates here, relative to this directory. diff --git a/examples/howto_examples/plot_test_nbsphinx.ipynb b/examples/howto_examples/plot_test_nbsphinx.ipynb new file mode 100644 index 000000000..033e9e334 --- /dev/null +++ b/examples/howto_examples/plot_test_nbsphinx.ipynb @@ -0,0 +1,51 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "import numpy as np\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.plot(np.random.rand(10))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "afq", + "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.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/setup.cfg b/setup.cfg index 43f05f9c0..eae3e1f8c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -74,6 +74,7 @@ dev = pydata-sphinx-theme sphinx-design myst-nb + nbsphinx fury = fury==0.8.0 xvfbwrapper==0.2.9