Skip to content

Commit 27c7f67

Browse files
William Grantbraxtonmckee
authored andcommitted
add autogen sphinx process to Makefile
1 parent ad7620f commit 27c7f67

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
_build/
2+
api/

docs/Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,27 @@ SPHINXOPTS ?=
88
SPHINXBUILD ?= sphinx-build
99
SOURCEDIR = .
1010
BUILDDIR = _build
11+
APIBUILDDIR = api
12+
MODULEDIR = ../typed_python
1113

1214
# Put it first so that "make" without argument is like "make help".
1315
help:
1416
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1517

16-
.PHONY: help Makefile
18+
.PHONY: help clean apidocs Makefile
19+
20+
apidocs:
21+
@sphinx-apidoc -fo "$(APIBUILDDIR)" "$(MODULEDIR)"
22+
23+
clean:
24+
-rm -rf "$(BUILDDIR)"/*
25+
-rm -rf "$(APIBUILDDIR)"/*
1726

1827
show:
1928
@echo "Showing generated html"
2029
@python -c "import webbrowser; webbrowser.open_new_tab('file://$(PWD)/$(BUILDDIR)/html/index.html')"
2130

2231
# Catch-all target: route all unknown targets to Sphinx using the new
2332
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
24-
25-
# make sure to rebuild API reference with
26-
#sphinx-apidoc -o . ../typed_python -f
27-
# if required
2833
%: Makefile
2934
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

0 commit comments

Comments
 (0)