Skip to content

Commit cd184ce

Browse files
committed
make responsible for pip installing, other makefile extensions
1 parent 3d91878 commit cd184ce

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

Makefile

+12-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,22 @@ SPHINXOPTS ?= -W --keep-going
33
SOURCEDIR = spec
44
BUILDDIR = _site
55

6-
.PHONY: default clean build
6+
.PHONY: default install clean draft spec
77

8-
default: clean build
8+
default: install clean spec
9+
10+
install:
11+
pip install -e .[doc]
912

1013
clean:
11-
-rm -rf $(BUILDDIR)
12-
-find . -type d -name generated -exec rm -rf {} +
14+
rm -rf $(BUILDDIR)
15+
find . -type d -name generated -exec rm -rf {} +
16+
17+
draft:
18+
mkdir -p $(BUILDDIR)
19+
sphinx-build "$(SOURCEDIR)/draft" "$(BUILDDIR)/draft" $(SPHINXOPTS)
1320

14-
build:
21+
spec:
1522
mkdir -p $(BUILDDIR)
1623
cp "$(SOURCEDIR)/_ghpages/_gitignore.txt" "$(BUILDDIR)/.gitignore"
1724
cp "$(SOURCEDIR)/_ghpages/versions.json" "$(BUILDDIR)/versions.json"

README.md

+20-7
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,23 @@ this array API standard.
1818

1919
## Building docs locally
2020

21+
### Quickstart
22+
23+
Just running `make` at the root of the repository should install the necessary
24+
dependencies and build the whole spec website.
25+
26+
```sh
27+
$ make
28+
$ ls _site/
29+
2021.12/ draft/ index.html latest/ versions.json
30+
```
31+
32+
### The nitty-gritty
33+
2134
The spec website is comprised of multiple Sphinx docs (one for each spec version),
2235
all of which exist in `spec/` and rely on the modules found in `src/` (most
2336
notably `array_api_stubs`). To install these modules and the additional
24-
dependencies of the Sphinx docs, you can use
37+
dependencies of the Sphinx docs, you can use `make install`, which aliases
2538

2639
```sh
2740
$ pip install -e .[doc] # ensure you install the dependencies extra "doc"
@@ -31,18 +44,18 @@ To build specific versions of the spec, run `sphinx-build` on the respective
3144
folder in `spec/`, e.g.
3245

3346
```sh
34-
$ sphinx-build spec/draft/ _site/draft/
47+
$ sphinx-build spec/2012.12/ _site/2012.12/
3548
```
3649

37-
To build the whole website, which includes every version of
38-
the spec, you can utilize the `make` commands defined in `spec/Makefile`; e.g.,
50+
Additionally, `make draft` aliases
3951

4052
```sh
41-
$ make
42-
$ ls _site/
43-
2021.12/ draft/ index.html latest/ versions.json
53+
$ sphinx-build spec/draft/ _site/draft/
4454
```
4555

56+
To build the whole website, which includes every version of the spec, you can
57+
utilize `make spec`.
58+
4659

4760
## Making a spec release
4861

0 commit comments

Comments
 (0)