From d0452a71b3ed6fcda44a9121a6b222408e170ccf Mon Sep 17 00:00:00 2001 From: andrewfulton9 Date: Fri, 19 Jul 2024 22:08:10 +0000 Subject: [PATCH] Add notebooks to the documentation --- .readthedocs.yaml | 2 ++ docs/requirements.txt | 2 ++ docs/source/conf.py | 2 +- docs/source/contributors/index.md | 11 ++++++++++- docs/source/examples/code.nblink | 3 +++ docs/source/examples/commands.nblink | 3 +++ docs/source/examples/errors.nblink | 3 +++ .../Creating Random Arrays with Numpy.nblink | 3 +++ .../examples/generate/Introduction to Sets.nblink | 3 +++ docs/source/examples/generate/index.md | 9 +++++++++ docs/source/examples/images.nblink | 3 +++ docs/source/examples/index.md | 14 ++++++++++++++ docs/source/examples/magics.nblink | 3 +++ docs/source/examples/notebooks.nk | 0 docs/source/examples/sagemaker.nblink | 3 +++ docs/source/index.md | 1 + 16 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 docs/source/examples/code.nblink create mode 100644 docs/source/examples/commands.nblink create mode 100644 docs/source/examples/errors.nblink create mode 100644 docs/source/examples/generate/Creating Random Arrays with Numpy.nblink create mode 100644 docs/source/examples/generate/Introduction to Sets.nblink create mode 100644 docs/source/examples/generate/index.md create mode 100644 docs/source/examples/images.nblink create mode 100644 docs/source/examples/index.md create mode 100644 docs/source/examples/magics.nblink create mode 100644 docs/source/examples/notebooks.nk create mode 100644 docs/source/examples/sagemaker.nblink diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 8654753a1..9a6e8247b 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -8,6 +8,8 @@ build: os: ubuntu-22.04 tools: python: "3.11" + apt_packages: + - pandoc sphinx: configuration: docs/source/conf.py diff --git a/docs/requirements.txt b/docs/requirements.txt index b9c17d5a9..ed8c60de8 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,4 @@ myst_parser pydata_sphinx_theme +nbsphinx +nbsphinx-link diff --git a/docs/source/conf.py b/docs/source/conf.py index bdd277e22..f190b50f5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,7 +13,7 @@ # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration -extensions = ["myst_parser"] +extensions = ["myst_parser", "nbsphinx", "nbsphinx_link"] myst_enable_extensions = ["colon_fence"] templates_path = ["_templates"] diff --git a/docs/source/contributors/index.md b/docs/source/contributors/index.md index a6005433f..a9093e531 100644 --- a/docs/source/contributors/index.md +++ b/docs/source/contributors/index.md @@ -95,7 +95,16 @@ refresh your browser tab. ## Building documentation The `./scripts/install.sh` should automatically install the documentation -dependencies. To build the documentation locally, run +dependencies. You will need to install [pandoc](https://pandoc.org/) as well. You can install [pandoc from the conda-forge channel](https://anaconda.org/conda-forge/pandoc): + +``` +conda install -c conda-forge pandoc +``` + +Otherwise have a look at pandoc's [installation instructions](https://pandoc.org/installing.html). + + +To build the documentation locally, run ``` cd docs/ diff --git a/docs/source/examples/code.nblink b/docs/source/examples/code.nblink new file mode 100644 index 000000000..2042cb28a --- /dev/null +++ b/docs/source/examples/code.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../examples/code.ipynb" +} \ No newline at end of file diff --git a/docs/source/examples/commands.nblink b/docs/source/examples/commands.nblink new file mode 100644 index 000000000..49b6bd2a4 --- /dev/null +++ b/docs/source/examples/commands.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../examples/commands.ipynb" +} \ No newline at end of file diff --git a/docs/source/examples/errors.nblink b/docs/source/examples/errors.nblink new file mode 100644 index 000000000..4677990ea --- /dev/null +++ b/docs/source/examples/errors.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../examples/errors.ipynb" +} \ No newline at end of file diff --git a/docs/source/examples/generate/Creating Random Arrays with Numpy.nblink b/docs/source/examples/generate/Creating Random Arrays with Numpy.nblink new file mode 100644 index 000000000..2651e6e62 --- /dev/null +++ b/docs/source/examples/generate/Creating Random Arrays with Numpy.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../examples/generate/Creating Random Arrays with Numpy.ipynb" +} \ No newline at end of file diff --git a/docs/source/examples/generate/Introduction to Sets.nblink b/docs/source/examples/generate/Introduction to Sets.nblink new file mode 100644 index 000000000..b62f28847 --- /dev/null +++ b/docs/source/examples/generate/Introduction to Sets.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../../examples/generate/Introduction to Sets.ipynb" +} \ No newline at end of file diff --git a/docs/source/examples/generate/index.md b/docs/source/examples/generate/index.md new file mode 100644 index 000000000..3106b3d5d --- /dev/null +++ b/docs/source/examples/generate/index.md @@ -0,0 +1,9 @@ +# Generate + +```{toctree} +--- +maxdepth: 1 +--- +Creating Random Arrays with Numpy +Introduction to Sets +``` \ No newline at end of file diff --git a/docs/source/examples/images.nblink b/docs/source/examples/images.nblink new file mode 100644 index 000000000..6507babc4 --- /dev/null +++ b/docs/source/examples/images.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../examples/images.ipynb" +} \ No newline at end of file diff --git a/docs/source/examples/index.md b/docs/source/examples/index.md new file mode 100644 index 000000000..2401861a1 --- /dev/null +++ b/docs/source/examples/index.md @@ -0,0 +1,14 @@ +# Examples + +```{toctree} +--- +maxdepth: 1 +--- +code +commands +errors +images +magics +sagemaker +generate/index +``` \ No newline at end of file diff --git a/docs/source/examples/magics.nblink b/docs/source/examples/magics.nblink new file mode 100644 index 000000000..2f1cf9793 --- /dev/null +++ b/docs/source/examples/magics.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../examples/magics.ipynb" +} \ No newline at end of file diff --git a/docs/source/examples/notebooks.nk b/docs/source/examples/notebooks.nk new file mode 100644 index 000000000..e69de29bb diff --git a/docs/source/examples/sagemaker.nblink b/docs/source/examples/sagemaker.nblink new file mode 100644 index 000000000..7d5edcda0 --- /dev/null +++ b/docs/source/examples/sagemaker.nblink @@ -0,0 +1,3 @@ +{ + "path": "../../../examples/sagemaker.ipynb" +} \ No newline at end of file diff --git a/docs/source/index.md b/docs/source/index.md index d3d29164e..b2ce5061e 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -35,4 +35,5 @@ maxdepth: 2 users/index contributors/index developers/index +examples/index ```