diff --git a/docs/sphinx/Makefile b/docs/sphinx/Makefile index aedab24b80..0c96b4ed23 100644 --- a/docs/sphinx/Makefile +++ b/docs/sphinx/Makefile @@ -48,6 +48,9 @@ help: clean: rm -rf $(BUILDDIR)/* + rm -rf source/generated + rm -rf source/auto_examples + rm -rf source/savefig html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html diff --git a/docs/sphinx/make.bat b/docs/sphinx/make.bat index 9534b01813..d12b216553 100644 --- a/docs/sphinx/make.bat +++ b/docs/sphinx/make.bat @@ -12,6 +12,17 @@ set BUILDDIR=build if "%1" == "" goto help + +if "%1" == "clean" ( + REM override the default `make clean` behavior of sphinx-build; + REM this lets us clean out the various build files in sphinx/source/ + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + rmdir /q /s %SOURCEDIR%\generated >nul 2>&1 + rmdir /q /s %SOURCEDIR%\auto_examples >nul 2>&1 + rmdir /q /s %SOURCEDIR%\savefig >nul 2>&1 + goto end +) + %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo.