Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add option for generating docs without examples #830

Merged
merged 9 commits into from
Jul 26, 2024
8 changes: 7 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ clean-except-examples:
pdf:
@$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true
(test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1
(test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1

# generate docs without examples
html-noplot:
@$(SPHINXBUILD) -D plot_gallery=0 -b html $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(O)
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
1 change: 1 addition & 0 deletions doc/changelog.d/830.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Feat: Add option for generating docs without examples
6 changes: 5 additions & 1 deletion doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set BUILDDIR=_build
set LINKCHECKDIR=\%BUILDDIR%\linkcheck

if "%1" == "" goto help
if "%1" == "html-noplot" goto html-noplot
if "%1" == "clean" goto clean
if "%1" == "pdf" goto pdf
if "%1" == "linkcheck" goto linkcheck
Expand All @@ -32,6 +33,10 @@ if errorlevel 9009 (
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:html-noplot
%SPHINXBUILD% -D plot_gallery=0 -b html %SOURCEDIR% %BUILDDIR%/html %SPHINXOPTS% %O%
goto end

:clean
rmdir /s /q %BUILDDIR% > /NUL 2>&1
for /d /r %SOURCEDIR% %%d in (_autosummary) do @if exist "%%d" rmdir /s /q "%%d"
Expand All @@ -57,4 +62,3 @@ goto end

:end
popd

Loading