mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-01 11:43:17 +03:00
Refactor docs Makefile
(#8933)
Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
This commit is contained in:
parent
e23f017af1
commit
07df26aa5d
|
@ -3,17 +3,23 @@
|
||||||
|
|
||||||
# You can set these variables from the command line.
|
# You can set these variables from the command line.
|
||||||
PYTHON = python3
|
PYTHON = python3
|
||||||
SPHINXOPTS =
|
|
||||||
SPHINXBUILD = $(PYTHON) -m sphinx.cmd.build
|
SPHINXBUILD = $(PYTHON) -m sphinx.cmd.build
|
||||||
PAPER =
|
SPHINXOPTS = --fail-on-warning
|
||||||
BUILDDIR = _build
|
BUILDDIR = _build
|
||||||
|
BUILDER = html
|
||||||
|
JOBS = auto
|
||||||
|
PAPER =
|
||||||
|
|
||||||
# Internal variables.
|
# Internal variables.
|
||||||
PAPEROPT_a4 = --define latex_paper_size=a4
|
PAPEROPT_a4 = --define latex_paper_size=a4
|
||||||
PAPEROPT_letter = --define latex_paper_size=letter
|
PAPEROPT_letter = --define latex_paper_size=letter
|
||||||
ALLSPHINXOPTS = --doctree-dir $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
|
||||||
# the i18n builder cannot share the environment and doctrees with the others
|
ALLSPHINXOPTS = --builder $(BUILDER) \
|
||||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
--doctree-dir $(BUILDDIR)/doctrees \
|
||||||
|
--jobs $(JOBS) \
|
||||||
|
$(PAPEROPT_$(PAPER)) \
|
||||||
|
$(SPHINXOPTS) \
|
||||||
|
. $(BUILDDIR)/$(BUILDER)
|
||||||
|
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help:
|
help:
|
||||||
|
@ -36,31 +42,19 @@ install-sphinx:
|
||||||
.PHONY: html
|
.PHONY: html
|
||||||
html:
|
html:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) --builder html --fail-on-warning --keep-going $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
$(SPHINXBUILD) $(ALLSPHINXOPTS)
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
|
||||||
|
|
||||||
.PHONY: dirhtml
|
.PHONY: dirhtml
|
||||||
dirhtml:
|
dirhtml: BUILDER = dirhtml
|
||||||
$(MAKE) install-sphinx
|
dirhtml: html
|
||||||
$(SPHINXBUILD) --builder dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
|
||||||
|
|
||||||
.PHONY: singlehtml
|
.PHONY: singlehtml
|
||||||
singlehtml:
|
singlehtml: BUILDER = singlehtml
|
||||||
$(MAKE) install-sphinx
|
singlehtml: html
|
||||||
$(SPHINXBUILD) --builder singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
|
||||||
@echo
|
|
||||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
|
||||||
|
|
||||||
.PHONY: linkcheck
|
.PHONY: linkcheck
|
||||||
linkcheck:
|
linkcheck: BUILDER = linkcheck
|
||||||
$(MAKE) install-sphinx
|
linkcheck: html
|
||||||
$(SPHINXBUILD) --builder linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck -j auto
|
|
||||||
@echo
|
|
||||||
@echo "Link check complete; look for any errors in the above output " \
|
|
||||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
|
||||||
|
|
||||||
.PHONY: htmlview
|
.PHONY: htmlview
|
||||||
htmlview: html
|
htmlview: html
|
||||||
|
|
|
@ -7,10 +7,8 @@ if "%SPHINXBUILD%" == "" (
|
||||||
)
|
)
|
||||||
set BUILDDIR=_build
|
set BUILDDIR=_build
|
||||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||||
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
|
||||||
if NOT "%PAPER%" == "" (
|
if NOT "%PAPER%" == "" (
|
||||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||||
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if "%1" == "" goto help
|
if "%1" == "" goto help
|
||||||
|
|
Loading…
Reference in New Issue
Block a user