|
| 1 | +# Makefile for Sphinx documentation |
| 2 | +# |
| 3 | + |
| 4 | +# You can set these variables from the command line. |
| 5 | +SPHINXOPTS = |
| 6 | +SPHINXBUILD = sphinx-build |
| 7 | +PAPER = |
| 8 | +BUILDDIR = _build |
| 9 | + |
| 10 | +GITHUB_PAGES_BRANCH = gh-pages |
| 11 | +OUTPUTDIR = _build/html |
| 12 | + |
| 13 | +# User-friendly check for sphinx-build |
| 14 | +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) |
| 15 | +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) |
| 16 | +endif |
| 17 | + |
| 18 | +# Internal variables. |
| 19 | +PAPEROPT_a4 = -D latex_paper_size=a4 |
| 20 | +PAPEROPT_letter = -D latex_paper_size=letter |
| 21 | +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . |
| 22 | +# the i18n builder cannot share the environment and doctrees with the others |
| 23 | +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . |
| 24 | + |
| 25 | +.PHONY: help |
| 26 | +help: |
| 27 | + @echo "Please use \`make <target>' where <target> is one of" |
| 28 | + @echo " html-noplot to make standalone HTML files, without plotting anything" |
| 29 | + @echo " html to make standalone HTML files" |
| 30 | + @echo " dirhtml to make HTML files named index.html in directories" |
| 31 | + @echo " singlehtml to make a single large HTML file" |
| 32 | + @echo " pickle to make pickle files" |
| 33 | + @echo " htmlhelp to make HTML files and a HTML help project" |
| 34 | + @echo " qthelp to make HTML files and a qthelp project" |
| 35 | + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" |
| 36 | + @echo " latexpdf to make LaTeX files and run them through pdflatex" |
| 37 | + @echo " changes to make an overview of all changed/added/deprecated items" |
| 38 | + @echo " linkcheck to check all external links for integrity" |
| 39 | + @echo " doctest to run all doctests embedded in the documentation (if enabled)" |
| 40 | + @echo " coverage to run coverage check of the documentation (if enabled)" |
| 41 | + @echo " install to make the html and push it online" |
| 42 | + |
| 43 | +.PHONY: clean |
| 44 | + |
| 45 | +clean: |
| 46 | + rm -rf $(BUILDDIR)/* |
| 47 | + rm -rf auto_examples/ |
| 48 | + rm -rf generated/* |
| 49 | + rm -rf modules/* |
| 50 | + |
| 51 | +html-noplot: |
| 52 | + $(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html |
| 53 | + @echo |
| 54 | + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." |
| 55 | + |
| 56 | +.PHONY: html |
| 57 | +html: |
| 58 | + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html |
| 59 | + @echo |
| 60 | + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." |
| 61 | + |
| 62 | +.PHONY: dirhtml |
| 63 | +dirhtml: |
| 64 | + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml |
| 65 | + @echo |
| 66 | + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." |
| 67 | + |
| 68 | +.PHONY: singlehtml |
| 69 | +singlehtml: |
| 70 | + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml |
| 71 | + @echo |
| 72 | + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." |
| 73 | + |
| 74 | +.PHONY: pickle |
| 75 | +pickle: |
| 76 | + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle |
| 77 | + @echo |
| 78 | + @echo "Build finished; now you can process the pickle files." |
| 79 | + |
| 80 | +.PHONY: htmlhelp |
| 81 | +htmlhelp: |
| 82 | + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp |
| 83 | + @echo |
| 84 | + @echo "Build finished; now you can run HTML Help Workshop with the" \ |
| 85 | + ".hhp project file in $(BUILDDIR)/htmlhelp." |
| 86 | + |
| 87 | +.PHONY: qthelp |
| 88 | +qthelp: |
| 89 | + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp |
| 90 | + @echo |
| 91 | + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ |
| 92 | + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" |
| 93 | + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/skglm.qhcp" |
| 94 | + @echo "To view the help file:" |
| 95 | + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/skglms.qhc" |
| 96 | + |
| 97 | +.PHONY: latex |
| 98 | +latex: |
| 99 | + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
| 100 | + @echo |
| 101 | + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." |
| 102 | + @echo "Run \`make' in that directory to run these through (pdf)latex" \ |
| 103 | + "(use \`make latexpdf' here to do that automatically)." |
| 104 | + |
| 105 | +.PHONY: latexpdf |
| 106 | +latexpdf: |
| 107 | + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex |
| 108 | + @echo "Running LaTeX files through pdflatex..." |
| 109 | + $(MAKE) -C $(BUILDDIR)/latex all-pdf |
| 110 | + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." |
| 111 | + |
| 112 | +.PHONY: changes |
| 113 | +changes: |
| 114 | + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes |
| 115 | + @echo |
| 116 | + @echo "The overview file is in $(BUILDDIR)/changes." |
| 117 | + |
| 118 | +.PHONY: linkcheck |
| 119 | +linkcheck: |
| 120 | + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck |
| 121 | + @echo |
| 122 | + @echo "Link check complete; look for any errors in the above output " \ |
| 123 | + "or in $(BUILDDIR)/linkcheck/output.txt." |
| 124 | + |
| 125 | +.PHONY: doctest |
| 126 | +doctest: |
| 127 | + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest |
| 128 | + @echo "Testing of doctests in the sources finished, look at the " \ |
| 129 | + "results in $(BUILDDIR)/doctest/output.txt." |
| 130 | + |
| 131 | +.PHONY: coverage |
| 132 | +coverage: |
| 133 | + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage |
| 134 | + @echo "Testing of coverage in the sources finished, look at the " \ |
| 135 | + "results in $(BUILDDIR)/coverage/python.txt." |
| 136 | + |
| 137 | +install: |
| 138 | + touch $(OUTPUTDIR)/.nojekyll |
| 139 | + ghp-import -m "Generate Pelican site [ci skip]" -b $(GITHUB_PAGES_BRANCH) $(OUTPUTDIR) |
| 140 | + git push origin $(GITHUB_PAGES_BRANCH) |
0 commit comments