2013-04-12 21:52:50 +04:00
|
|
|
# Makefile for Sphinx documentation
|
|
|
|
#
|
|
|
|
|
|
|
|
# You can set these variables from the command line.
|
2022-07-15 14:55:08 +03:00
|
|
|
PYTHON = python3
|
2013-04-12 21:52:50 +04:00
|
|
|
SPHINXOPTS =
|
2022-07-15 14:55:08 +03:00
|
|
|
SPHINXBUILD = $(PYTHON) -m sphinx.cmd.build
|
2013-04-12 21:52:50 +04:00
|
|
|
PAPER =
|
|
|
|
BUILDDIR = _build
|
|
|
|
|
|
|
|
# Internal variables.
|
2024-06-06 09:38:38 +03:00
|
|
|
PAPEROPT_a4 = --define latex_paper_size=a4
|
|
|
|
PAPEROPT_letter = --define latex_paper_size=letter
|
|
|
|
ALLSPHINXOPTS = --doctree-dir $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
2013-04-12 21:52:50 +04:00
|
|
|
# the i18n builder cannot share the environment and doctrees with the others
|
|
|
|
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: help
|
2013-04-12 21:52:50 +04:00
|
|
|
help:
|
|
|
|
@echo "Please use \`make <target>' where <target> is one of"
|
|
|
|
@echo " html to make standalone HTML files"
|
2023-03-08 19:22:33 +03:00
|
|
|
@echo " htmlview to open the index page built by the html target in your browser"
|
2022-11-28 13:34:43 +03:00
|
|
|
@echo " serve to start a local server for viewing docs"
|
|
|
|
@echo " livehtml to start a local server for viewing docs and auto-reload on change"
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo " dirhtml to make HTML files named index.html in directories"
|
|
|
|
@echo " singlehtml to make a single large HTML file"
|
|
|
|
@echo " pickle to make pickle files"
|
|
|
|
@echo " json to make JSON files"
|
|
|
|
@echo " htmlhelp to make HTML files and a HTML help project"
|
|
|
|
@echo " qthelp to make HTML files and a qthelp project"
|
|
|
|
@echo " devhelp to make HTML files and a Devhelp project"
|
|
|
|
@echo " epub to make an epub"
|
|
|
|
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
|
|
|
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
|
|
|
@echo " text to make text files"
|
|
|
|
@echo " man to make manual pages"
|
|
|
|
@echo " texinfo to make Texinfo files"
|
|
|
|
@echo " info to make Texinfo files and run them through makeinfo"
|
|
|
|
@echo " gettext to make PO message catalogs"
|
|
|
|
@echo " changes to make an overview of all changed/added/deprecated items"
|
|
|
|
@echo " linkcheck to check all external links for integrity"
|
|
|
|
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: clean
|
2013-04-12 21:52:50 +04:00
|
|
|
clean:
|
|
|
|
-rm -rf $(BUILDDIR)/*
|
|
|
|
|
2022-02-25 02:37:38 +03:00
|
|
|
install-sphinx:
|
2024-10-10 21:35:48 +03:00
|
|
|
$(PYTHON) -m pip install -e ..[docs]
|
2022-02-25 02:37:38 +03:00
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: html
|
2013-04-12 21:52:50 +04:00
|
|
|
html:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder html --fail-on-warning --keep-going $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: dirhtml
|
2013-04-12 21:52:50 +04:00
|
|
|
dirhtml:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: singlehtml
|
2013-04-12 21:52:50 +04:00
|
|
|
singlehtml:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: pickle
|
2013-04-12 21:52:50 +04:00
|
|
|
pickle:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished; now you can process the pickle files."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: json
|
2013-04-12 21:52:50 +04:00
|
|
|
json:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished; now you can process the JSON files."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: htmlhelp
|
2013-04-12 21:52:50 +04:00
|
|
|
htmlhelp:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
|
|
|
".hhp project file in $(BUILDDIR)/htmlhelp."
|
|
|
|
|
2022-11-29 00:23:46 +03:00
|
|
|
.PHONY: qthelp
|
2013-04-12 21:52:50 +04:00
|
|
|
qthelp:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
|
|
|
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
|
|
|
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PillowPILfork.qhcp"
|
|
|
|
@echo "To view the help file:"
|
|
|
|
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PillowPILfork.qhc"
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: devhelp
|
2013-04-12 21:52:50 +04:00
|
|
|
devhelp:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished."
|
|
|
|
@echo "To view the help file:"
|
|
|
|
@echo "# mkdir -p $$HOME/.local/share/devhelp/PillowPILfork"
|
|
|
|
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PillowPILfork"
|
|
|
|
@echo "# devhelp"
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: epub
|
2013-04-12 21:52:50 +04:00
|
|
|
epub:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: latex
|
2013-04-12 21:52:50 +04:00
|
|
|
latex:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
|
|
|
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
|
|
|
"(use \`make latexpdf' here to do that automatically)."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: latexpdf
|
2013-04-12 21:52:50 +04:00
|
|
|
latexpdf:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo "Running LaTeX files through pdflatex..."
|
|
|
|
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
|
|
|
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: text
|
2013-04-12 21:52:50 +04:00
|
|
|
text:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: man
|
2013-04-12 21:52:50 +04:00
|
|
|
man:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: texinfo
|
2013-04-12 21:52:50 +04:00
|
|
|
texinfo:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
|
|
|
@echo "Run \`make' in that directory to run these through makeinfo" \
|
|
|
|
"(use \`make info' here to do that automatically)."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: info
|
2013-04-12 21:52:50 +04:00
|
|
|
info:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo "Running Texinfo files through makeinfo..."
|
|
|
|
make -C $(BUILDDIR)/texinfo info
|
|
|
|
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: gettext
|
2013-04-12 21:52:50 +04:00
|
|
|
gettext:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: changes
|
2013-04-12 21:52:50 +04:00
|
|
|
changes:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "The overview file is in $(BUILDDIR)/changes."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: linkcheck
|
2013-04-12 21:52:50 +04:00
|
|
|
linkcheck:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck -j auto
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo
|
|
|
|
@echo "Link check complete; look for any errors in the above output " \
|
|
|
|
"or in $(BUILDDIR)/linkcheck/output.txt."
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: doctest
|
2013-04-12 21:52:50 +04:00
|
|
|
doctest:
|
2022-02-25 02:37:38 +03:00
|
|
|
$(MAKE) install-sphinx
|
2024-06-06 09:38:38 +03:00
|
|
|
$(SPHINXBUILD) --builder doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
2013-04-12 21:52:50 +04:00
|
|
|
@echo "Testing of doctests in the sources finished, look at the " \
|
|
|
|
"results in $(BUILDDIR)/doctest/output.txt."
|
2013-10-07 04:06:00 +04:00
|
|
|
|
2023-03-08 19:22:33 +03:00
|
|
|
.PHONY: htmlview
|
|
|
|
htmlview: html
|
|
|
|
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('$(BUILDDIR)/html/index.html'))"
|
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: livehtml
|
2013-10-07 04:06:00 +04:00
|
|
|
livehtml: html
|
|
|
|
livereload $(BUILDDIR)/html -p 33233
|
2015-09-30 13:38:51 +03:00
|
|
|
|
2022-11-28 13:36:04 +03:00
|
|
|
.PHONY: serve
|
2015-09-30 13:38:51 +03:00
|
|
|
serve:
|
2022-07-15 14:55:08 +03:00
|
|
|
cd $(BUILDDIR)/html; $(PYTHON) -m http.server
|