Skip to content

Commit cfcb3c6

Browse files
andrewfulton9dlqqq
andauthored
Add notebooks to the documentation (jupyterlab#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

+2
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

+4
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

+1-1
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

+10-1
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

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../examples/code.ipynb"
3+
}

docs/source/examples/commands.nblink

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../examples/commands.ipynb"
3+
}

docs/source/examples/errors.nblink

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../examples/errors.ipynb"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../../examples/generate/Creating Random Arrays with Numpy.ipynb"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../../examples/generate/Introduction to Sets.ipynb"
3+
}
+9
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+
```

docs/source/examples/images.nblink

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../examples/images.ipynb"
3+
}

docs/source/examples/index.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Examples
2+
3+
```{toctree}
4+
---
5+
maxdepth: 1
6+
---
7+
code
8+
commands
9+
errors
10+
images
11+
magics
12+
sagemaker
13+
generate/index
14+
```

docs/source/examples/magics.nblink

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../examples/magics.ipynb"
3+
}

docs/source/examples/notebooks.nk

Whitespace-only changes.

docs/source/examples/sagemaker.nblink

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "../../../examples/sagemaker.ipynb"
3+
}

docs/source/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ maxdepth: 2
3535
users/index
3636
contributors/index
3737
developers/index
38+
examples/index
3839
```

0 commit comments

Comments
 (0)