Skip to content

Commit cfcb3c6

Browse files
andrewfulton9dlqqq
andauthored
Add notebooks to the documentation (#906)
* Add notebooks to the documentation * pin docutils * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: David L. Qiu <[email protected]>
1 parent 69f1d5d commit cfcb3c6

16 files changed

+65
-2
lines changed

.readthedocs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ build:
88
os: ubuntu-22.04
99
tools:
1010
python: "3.11"
11+
apt_packages:
12+
- pandoc
1113

1214
sphinx:
1315
configuration: docs/source/conf.py

docs/requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
# nbsphinx-link requires older version of docutils
2+
docutils==0.20
13
myst_parser
4+
nbsphinx
5+
nbsphinx-link
26
pydata_sphinx_theme

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# -- General configuration ---------------------------------------------------
1414
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1515

16-
extensions = ["myst_parser"]
16+
extensions = ["myst_parser", "nbsphinx", "nbsphinx_link"]
1717
myst_enable_extensions = ["colon_fence"]
1818

1919
templates_path = ["_templates"]

docs/source/contributors/index.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,16 @@ refresh your browser tab.
9595
## Building documentation
9696

9797
The `./scripts/install.sh` should automatically install the documentation
98-
dependencies. To build the documentation locally, run
98+
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):
99+
100+
```
101+
conda install -c conda-forge pandoc
102+
```
103+
104+
Otherwise have a look at pandoc's [installation instructions](https://pandoc.org/installing.html).
105+
106+
107+
To build the documentation locally, run
99108

100109
```
101110
cd docs/

docs/source/examples/code.nblink

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../examples/code.ipynb"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../examples/commands.ipynb"
3+
}

docs/source/examples/errors.nblink

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../examples/errors.ipynb"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../../examples/generate/Creating Random Arrays with Numpy.ipynb"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../../examples/generate/Introduction to Sets.ipynb"
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Generate
2+
3+
```{toctree}
4+
---
5+
maxdepth: 1
6+
---
7+
Creating Random Arrays with Numpy
8+
Introduction to Sets
9+
```

0 commit comments

Comments
 (0)