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

Improve the targets in doc/Makefile #1014

Merged
merged 20 commits into from
Mar 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 25 additions & 36 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,25 @@ SPHINXAUTOGEN = sphinx-autogen
BUILDDIR = _build

# Internal variables.
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .

.PHONY: help clean html linkcheck doctest api

all: html
.PHONY: help all api html server clean

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

clean:
rm -rf $(BUILDDIR)/html
rm -rf $(BUILDDIR)/doctrees
rm -rf $(BUILDDIR)/linkcheck
rm -rf modules
rm -rf api/generated
rm -rf gallery
rm -rf tutorials
rm -rf projections
rm -rf .ipynb_checkpoints
all: html

api:
@echo
@echo "Generating rst source files of API documentation."
@echo
$(SPHINXAUTOGEN) -i -t _templates -o api/generated api/*.rst

html: api
@echo
Expand All @@ -39,23 +35,16 @@ html: api
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

api:
server:
@echo
@echo "Building API docs."
@echo "Running a server on port 8009."
@echo "Open http://localhost:8009 in a web browser to preview the documentation."
@echo
$(SPHINXAUTOGEN) -i -t _templates -o api/generated api/*.rst


linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

serve:
cd $(BUILDDIR)/html && python -m http.server 8009

clean:
rm -rf $(BUILDDIR)
rm -rf api/generated
rm -rf gallery
rm -rf tutorials
rm -rf projections