Skip to content
Merged
Changes from 8 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
46 changes: 17 additions & 29 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,19 @@ 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

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 " html build the HTML files from the existing rst sources"
@echo " api generate rst source files of API documentation"
@echo " server make a local HTTP server for previewing the built documentation"
@echo " clean clean up built and generated files"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe sort these lines alphabetically?

Suggested change
@echo " html build the HTML files from the existing rst sources"
@echo " api generate rst source files of API documentation"
@echo " server make a local HTTP server for previewing the built documentation"
@echo " clean clean up built and generated files"
@echo " api generate rst source files of API documentation"
@echo " clean clean up built and generated files"
@echo " html build the HTML files from the existing rst sources"
@echo " server make a local HTTP server for previewing the built documentation"

I'd also prefer it if the rest of this Makefile was sorted alphabetically (i.e. all, api, clean, html, server), while keeping this help target on top of course.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People usually put clean to be the last one, while the target like all or install/build/html is the first one in a makefile. Shall we keep this rule? @seisman @willschlitzer How do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to put clean at the bottom.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiji14 @seisman Change the order to be all, api, html, server, and clean in e719f74. So keep all first, clean last, and sort the other alphabetically.


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

html: api
@echo
Expand All @@ -45,17 +35,15 @@ api:
@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:
server:
cd $(BUILDDIR)/html && python -m http.server 8009

clean:
rm -rf $(BUILDDIR)/doctrees
rm -rf $(BUILDDIR)/html
rm -rf $(BUILDDIR)/linkcheck
rm -rf $(BUILDDIR)/doctest
rm -rf api/generated
rm -rf gallery
rm -rf tutorials
rm -rf projections