Skip to content

Commit 7fd5520

Browse files
committed
Update docs makefiles to clean intermediate autosummary directory
1 parent d93209f commit 7fd5520

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = source
99
BUILDDIR = build
10+
AUTOSUMMARYDIR = source/api/_autosummary
1011

1112
# Put it first so that "make" without argument is like "make help".
1213
help:
1314
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1415

15-
.PHONY: help Makefile
16+
clean:
17+
@echo "Removing autosummary directory"
18+
@rm -rf $(AUTOSUMMARYDIR)
19+
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
21+
.PHONY: help clean Makefile
1622

1723
# Catch-all target: route all unknown targets to Sphinx using the new
1824
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

docs/make.bat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ if "%SPHINXBUILD%" == "" (
99
)
1010
set SOURCEDIR=source
1111
set BUILDDIR=build
12+
set AUTOSUMMARYDIR=source\api\_autosummary
1213

1314
if "%1" == "" goto help
15+
if "%1" == "clean" goto clean
1416

1517
%SPHINXBUILD% >NUL 2>NUL
1618
if errorlevel 9009 (
@@ -30,6 +32,12 @@ goto end
3032

3133
:help
3234
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
35+
goto end
36+
37+
:clean
38+
echo Removing autosummary directory
39+
rmdir /s/q %AUTOSUMMARYDIR%
40+
%SPHINXBUILD% -M clean %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3341

3442
:end
3543
popd

0 commit comments

Comments
 (0)