Skip to content

Commit bb2a1e8

Browse files
committed
Refactor the build system
1 parent 0c4e64d commit bb2a1e8

32 files changed

+60
-29
lines changed

.gitignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ _requirements.installed
88
*~
99

1010
# Ignore built website
11-
site/_build
11+
book/_build
1212

1313
# Ignore auto-generated content
14-
site/lectures
15-
14+
book/_modules

Makefile

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
1-
.PHONY: clean html
1+
.PHONY: clean book
22

33
.DEFAULT_GOAL = book
44

5+
NB_DIR = modules
6+
EXEC_NB_DIR = book/_modules
7+
8+
MARKDOWNS = $(wildcard $(NB_DIR)/*.md)
9+
NOTEBOOKS = $(patsubst $(NB_DIR)/%.md, $(EXEC_NB_DIR)/%.ipynb, $(MARKDOWNS))
10+
511
_requirements.installed:
612
pip install -q -r requirements.txt
713
touch _requirements.installed
814

9-
book: _requirements.installed
15+
$(EXEC_NB_DIR):
16+
mkdir book/_modules
17+
18+
$(EXEC_NB_DIR)/%.ipynb:$(NB_DIR)/%.md $(EXEC_NB_DIR)
19+
@# Jupytext will also catch and print execution errors
20+
@# unless a cell is marked with the `raises-exception` tag
21+
jupytext --execute --to ipynb --output $@ $<
22+
23+
book: _requirements.installed $(NOTEBOOKS)
1024
@export SPHINXOPTS=-W; make -C book html
1125

1226
clean:
13-
rm -rf book/_build
27+
make -C book clean
28+

README.md

+23-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
scikit-image tutorials
2-
======================
1+
# scikit-image tutorials
32

43
A collection of tutorials for the [scikit-image](http://skimage.org) package.
54

@@ -16,8 +15,7 @@ Refer to [the gallery](http://scikit-image.org/docs/dev/auto_examples/) as
1615
well as [scikit-image demos](https://github.com/scikit-image/skimage-demos)
1716
for more examples.
1817

19-
Usage
20-
-----
18+
## Usage
2119

2220
These usage guidelines are based on goodwill. They are not a legal contract.
2321

@@ -42,9 +40,28 @@ For more information on these guidelines, which are sometimes known as
4240
CC0 (+BY), see [this blog post](http://www.dancohen.org/2013/11/26/cc0-by/) by
4341
Dan Cohen.
4442

45-
Contributing
46-
------------
43+
## Contributing
4744

4845
If you make any modifications to these tutorials that you think would benefit
4946
the community at large, please
5047
[create a pull request](http://scikit-image.org/docs/dev/contribute.html)!
48+
49+
The tutorials live at
50+
https://github.com/scikit-image/skimage-tutorials
51+
52+
53+
## Contributor notes
54+
55+
- Notebooks are stored in `modules`; see [modules/00_images_are_arrays.md](modules/00_images_are_arrays.md)
56+
for an example.
57+
- They use the [myst](https://myst-nb.readthedocs.io/en/latest/)
58+
notebook format
59+
- Cells can be tagged with:
60+
`remove-input` : Get rid of the input but display the output
61+
`remove-output` : Show the input but not the output
62+
`raises-exception` : This cell is expected to fail execution, so
63+
don't halt the book build because of it.
64+
65+
To build the book, run `make`. Results appear in `book/_build`.
66+
Notebooks can be edited in your favorite text editor or in Jupyter (as
67+
long as Jupytext is installed).
File renamed without changes.
File renamed without changes.
File renamed without changes.

book/applications.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# scikit-image applications
2+
3+
A collection of tutorials highlighting the use of scikit-image for applications in science.
4+
5+
```{toctree}
6+
---
7+
maxdepth: 1
8+
---
9+
_modules/adv0_chromosomes.md
10+
_modules/adv1_lesion-quantification.md
11+
_modules/adv2_microarray.md
12+
_modules/adv3_panorama_stitching.md
13+
_modules/adv4_warping.md
14+
_modules/adv5_pores.md
15+
```
File renamed without changes.

site/images renamed to book/images

File renamed without changes.
File renamed without changes.

site/introduction.md renamed to book/introduction.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Basic tutorials to prepare you for your journey on scikit-image.
66
---
77
maxdepth: 1
88
---
9-
content/tour_of_skimage
10-
content/00_images_are_arrays
9+
_modules/tour_of_skimage
10+
_modules/00_images_are_arrays
1111
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

site/applications.md

-15
This file was deleted.

0 commit comments

Comments
 (0)