Skip to content

Commit 9079207

Browse files
rossbarbsipocz
andauthored
Update contributor guide for JB2 (numpy#285)
* DOC: Rm bit about myst-nb and jupytext - different toolchain. * DOC: rm bit about why notebooks. Too much info for contrib landing page, and description of tooling is out-of-date. * DOC: Add quickstart for using jb2. * DOC: Same changes in readme. --------- Co-authored-by: Brigitta Sipőcz <b.sipocz@gmail.com>
1 parent 32f6d5b commit 9079207

File tree

2 files changed

+53
-45
lines changed

2 files changed

+53
-45
lines changed

README.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,40 @@ Images and real-life data make text more engaging and powerful, but be sure what
4040
you use is appropriately licensed and available. Here again, even a rough idea
4141
for artwork can be polished by others.
4242

43-
The NumPy tutorials are a curated collection of
44-
[MyST-NB](https://myst-nb.readthedocs.io/) notebooks. These notebooks are used
45-
to produce static websites and can be opened as notebooks in Jupyter using
46-
[Jupytext](https://jupytext.readthedocs.io).
43+
### Building the website
4744

48-
> __Note:__ You should use [CommonMark](https://commonmark.org) markdown
49-
> cells. Jupyter only renders CommonMark.
45+
```{note}
46+
The NumPy tutorials are powered by [`jupyter-book`][jb-docs] and the
47+
[`MyST` document engine][mystmd].
48+
See the linked documentation for further details.
49+
```
50+
51+
[jb-docs]: https://jupyterbook.org/stable/
52+
[mystmd]: https://mystmd.org/
5053

51-
### Why Jupyter Notebooks?
54+
#### Quickstart
5255

53-
The choice of Jupyter Notebook in this repo instead of the usual format
54-
([reStructuredText, through Sphinx](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html))
55-
used in the main NumPy documentation has two reasons:
56+
Set up a development environment with the dependencies listed in
57+
`requirements.txt` and `site/requirements.txt`.
58+
For example, using the built-in [`venv`][venv] module:
5659

57-
* Jupyter notebooks are a common format for communicating scientific
58-
information.
59-
* Jupyter notebooks can be launched in [Binder](https://www.mybinder.org), so that users can interact
60-
with tutorials
61-
* rST may present a barrier for some people who might otherwise be very
62-
interested in contributing tutorial material.
60+
```bash
61+
python -m venv np-tutorials
62+
source np-tutorials/bin/activate
63+
python -m pip install -r requirements.txt -r site/requirements.txt
64+
```
6365

64-
#### Note
66+
[venv]: https://docs.python.org/3/library/venv.html
6567

66-
You may notice our content is in markdown format (`.md` files). We review and
67-
host notebooks in the [MyST-NB](https://myst-nb.readthedocs.io/) format. We
68-
accept both Jupyter notebooks (`.ipynb`) and MyST-NB notebooks (`.md`).
69-
If you want to author `MyST` notebooks in jupyterlab, check out the
70-
[jupyterlab_myst](https://mystmd.org/guide/quickstart-jupyter-lab-myst) extension!
68+
The site can then be built with:
69+
70+
```bash
71+
jupyter-book start --execute
72+
```
7173

74+
This will execute all the notebooks and start a web server to view the rendered
75+
content locally.
76+
View the rendered site by opening the ``localhost:30xy`` in your preferred browser (the exact port number will be printed in your terminal).
7277

7378
### Adding your own tutorials
7479

site/contributing.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,40 @@ Images and real-life data make text more engaging and powerful, but be sure what
1212
you use is appropriately licensed and available. Here again, even a rough idea
1313
for artwork can be polished by others.
1414

15-
The NumPy tutorials are a curated collection of
16-
[MyST-NB](https://myst-nb.readthedocs.io/) notebooks. These notebooks are used
17-
to produce static websites and can be opened as notebooks in Jupyter using
18-
[Jupytext](https://jupytext.readthedocs.io).
15+
## Building the website
1916

20-
> __Note:__ You should use [CommonMark](https://commonmark.org) markdown
21-
> cells. Jupyter only renders CommonMark.
17+
```{note}
18+
The NumPy tutorials are powered by [`jupyter-book`][jb-docs] and the
19+
[`MyST` document engine][mystmd].
20+
See the linked documentation for further details.
21+
```
2222

23-
## Why Jupyter Notebooks?
23+
[jb-docs]: https://jupyterbook.org/stable/
24+
[mystmd]: https://mystmd.org/
2425

25-
The choice of Jupyter Notebook in this repo instead of the usual format
26-
([reStructuredText][rst])
27-
used in the main NumPy documentation has two reasons:
26+
### Quickstart
2827

28+
Set up a development environment with the dependencies listed in
29+
`requirements.txt` and `site/requirements.txt`.
30+
For example, using the built-in [`venv`][venv] module:
2931

30-
* Jupyter notebooks are a common format for communicating scientific
31-
information.
32-
* Jupyter notebooks can be launched in [Binder](https://mybinder.org), so that users can interact
33-
with tutorials
34-
* rST may present a barrier for some people who might otherwise be very
35-
interested in contributing tutorial material.
32+
```bash
33+
python -m venv np-tutorials
34+
source np-tutorials/bin/activate
35+
python -m pip install -r requirements.txt -r site/requirements.txt
36+
```
3637

37-
[rst]: https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html
38+
[venv]: https://docs.python.org/3/library/venv.html
3839

39-
### Note
40+
The site can then be built with:
4041

41-
You may notice our content is in markdown format (`.md` files). We review and
42-
host notebooks in the [MyST-NB](https://myst-nb.readthedocs.io/) format. We
43-
accept both Jupyter notebooks (`.ipynb`) and MyST-NB notebooks (`.md`).
44-
If you want to author `MyST` notebooks in jupyterlab, check out the
45-
[jupyterlab_myst](https://mystmd.org/guide/quickstart-jupyter-lab-myst) extension!
42+
```bash
43+
jupyter-book start --execute
44+
```
45+
46+
This will execute all the notebooks and start a web server to view the rendered
47+
content locally.
48+
View the rendered site by opening the ``localhost:30xy`` in your preferred browser (the exact port number will be printed in your terminal).
4649

4750
## Adding your own tutorials
4851

0 commit comments

Comments
 (0)