Skip to content

Commit 97579d6

Browse files
committed
Edit doc build instructions
1 parent be69969 commit 97579d6

File tree

1 file changed

+37
-17
lines changed

1 file changed

+37
-17
lines changed

docs/source/dev_docs.md

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
Building the Documentation
2-
==========================
1+
# Develop and Build Documentation
32

4-
To build the documentation you'll need [Sphinx](http://www.sphinx-doc.org/), [pandoc](http://pandoc.org/)
3+
To build the documentation you'll need [Sphinx](http://www.sphinx-doc.org/)
54
and a few other packages.
65

7-
First create a [conda environment](http://conda.pydata.org/docs/using/envs.html#use-environment-from-file) named `ipywidgets_docs` to install all the necessary packages:
6+
## Setup docs dev environment
87

9-
```bash
10-
# create the environment
11-
conda create -n ipywidgets_docs -c conda-forge python pip
12-
13-
# activate the environment
14-
conda activate ipywidgets_docs # Linux and OS X
15-
activate ipywidgets_docs # Windows
16-
```
8+
### Use pip
179

1810
Alternatively, it is also possible to create a virtual environment and activate it with the following commands:
1911

@@ -31,6 +23,27 @@ In the environment, install the packages:
3123
python -m pip install -r docs/requirements.txt
3224
```
3325

26+
### Use conda
27+
28+
First create a [conda environment](http://conda.pydata.org/docs/using/envs.html#use-environment-from-file) named `ipywidgets_docs` to install all the necessary packages:
29+
30+
```bash
31+
# create the environment
32+
conda create -n ipywidgets_docs -c conda-forge python pip
33+
```
34+
35+
Use conda to install the packages listed in `docs/requirements.txt`.
36+
37+
Then, activate the conda environment.
38+
39+
```bash
40+
# activate the environment
41+
conda activate ipywidgets_docs # Linux and OS X
42+
activate ipywidgets_docs # Windows
43+
```
44+
45+
## Build the documentation
46+
3447
Once you have installed the required packages, you can build the docs with:
3548

3649
```bash
@@ -40,15 +53,22 @@ make html
4053
```
4154

4255
After that, the generated HTML files will be available at
43-
`build/html/index.html`. You may view the docs in your browser.
56+
`build/html/index.html`. You may view the docs in your browser by entering
57+
the following in the terminal: `open build/html/index.html`. Alternatively,
58+
you can start a webserver using `python3 -m http.server` and navigate to
59+
<http://localhost:8000/build/html/index.html>.
4460

4561
Windows users can find `make.bat` in the `docs` folder.
4662

4763
You should also have a look at the [Project Jupyter Documentation Guide](https://jupyter.readthedocs.io/en/latest/contrib_docs/index.html).
4864

49-
### Cleaning notebooks for docs
65+
## Cleaning notebook output for docs
5066

51-
Notebook output and metadata should be stripped with [nbstripoutput](https://github.com/kynan/nbstripout) before commiting. For example:
52-
```
53-
nbstripoutput docs/source/examples/Widget\ List.ipynb
67+
When using notebook source files to generate documentation, it's good practice to strip
68+
notebook output and metadata with [nbstripout](https://github.com/kynan/nbstripout)
69+
before committing the notebook. For example, the following command will strip
70+
all output from a notebook:
71+
72+
```bash
73+
nbstripout docs/source/examples/Widget\ List.ipynb
5474
```

0 commit comments

Comments
 (0)