Skip to content

Commit 5385fa5

Browse files
core-manweiji14seismanMeghan Jones
authored
Improve the targets in doc/Makefile (#1014)
- Remove useless "linkcheck" and "doctest" targets - Improve the "clean" target - Improve the verbose messages of "api" and "server" targets - Rename the "serve" target to "server" Co-authored-by: Wei Ji <[email protected]> Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Meghan Jones <[email protected]>
1 parent dc75785 commit 5385fa5

File tree

1 file changed

+25
-36
lines changed

1 file changed

+25
-36
lines changed

doc/Makefile

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,25 @@ SPHINXAUTOGEN = sphinx-autogen
77
BUILDDIR = _build
88

99
# Internal variables.
10-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
10+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
1111

12-
.PHONY: help clean html linkcheck doctest api
13-
14-
all: html
12+
.PHONY: help all api html server clean
1513

1614
help:
17-
@echo "Please use \`make <target>' where <target> is one of"
18-
@echo " all generate the complete webpage"
19-
@echo " html make only the HTML files from the existing rst sources"
20-
@echo " linkcheck check all external links for integrity"
21-
@echo " doctest run all doctests embedded in the documentation (if enabled)"
15+
@echo "Please use 'make <target>' where <target> is one of"
16+
@echo " all build the HTML files from the existing rst sources"
17+
@echo " api generate rst source files of API documentation"
18+
@echo " html build the HTML files from the existing rst sources"
19+
@echo " server make a local HTTP server for previewing the built documentation"
20+
@echo " clean clean up built and generated files"
2221

23-
clean:
24-
rm -rf $(BUILDDIR)/html
25-
rm -rf $(BUILDDIR)/doctrees
26-
rm -rf $(BUILDDIR)/linkcheck
27-
rm -rf modules
28-
rm -rf api/generated
29-
rm -rf gallery
30-
rm -rf tutorials
31-
rm -rf projections
32-
rm -rf .ipynb_checkpoints
22+
all: html
23+
24+
api:
25+
@echo
26+
@echo "Generating rst source files of API documentation."
27+
@echo
28+
$(SPHINXAUTOGEN) -i -t _templates -o api/generated api/*.rst
3329

3430
html: api
3531
@echo
@@ -39,23 +35,16 @@ html: api
3935
@echo
4036
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
4137

42-
api:
38+
server:
4339
@echo
44-
@echo "Building API docs."
40+
@echo "Running a server on port 8009."
41+
@echo "Open http://localhost:8009 in a web browser to preview the documentation."
4542
@echo
46-
$(SPHINXAUTOGEN) -i -t _templates -o api/generated api/*.rst
47-
48-
49-
linkcheck:
50-
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
51-
@echo
52-
@echo "Link check complete; look for any errors in the above output " \
53-
"or in $(BUILDDIR)/linkcheck/output.txt."
54-
55-
doctest:
56-
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
57-
@echo "Testing of doctests in the sources finished, look at the " \
58-
"results in $(BUILDDIR)/doctest/output.txt."
59-
60-
serve:
6143
cd $(BUILDDIR)/html && python -m http.server 8009
44+
45+
clean:
46+
rm -rf $(BUILDDIR)
47+
rm -rf api/generated
48+
rm -rf gallery
49+
rm -rf tutorials
50+
rm -rf projections

0 commit comments

Comments
 (0)