55SPHINXOPTS =
66SPHINXBUILD = sphinx-build
77PAPER =
8- PYTHON = python
9- ZIP = zip
108BUILDDIR = _build
119
1210READTHEDOCS = true
1311export READTHEDOCS
1412
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+
1518# Internal variables.
1619PAPEROPT_a4 = -D latex_paper_size=a4
1720PAPEROPT_letter = -D latex_paper_size=letter
1821ALLSPHINXOPTS = -d $(BUILDDIR ) /doctrees $(PAPEROPT_$(PAPER ) ) $(SPHINXOPTS ) .
1922# the i18n builder cannot share the environment and doctrees with the others
2023I18NSPHINXOPTS = $(PAPEROPT_$(PAPER ) ) $(SPHINXOPTS ) .
2124
22- .PHONY : test check-sphinx help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23-
24- test : clean
25- @if [ ! -d venv ]; then virtualenv venv; fi
26- venv/bin/pip install -q -r docs_requirements.txt
27- venv/bin/$(SPHINXBUILD ) -a -b dirhtml $(ALLSPHINXOPTS ) $(BUILDDIR ) /dirhtml
28- test -f $(BUILDDIR ) /dirhtml/index.html
29-
30- check-sphinx :
31- # User-friendly check for sphinx-build
32- ifeq ($( shell which $( SPHINXBUILD) > /dev/null 2>&1 ; echo $$ ? ) , 1)
33- $(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/)
34- endif
35-
36- dirhtml : check-sphinx
37- $(SPHINXBUILD ) -b dirhtml $(ALLSPHINXOPTS ) $(BUILDDIR ) /dirhtml
38- @echo
39- @echo " Build finished. The HTML pages are in $( BUILDDIR) /dirhtml."
40-
41- auto : dirhtml
42- sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS ) $(BUILDDIR ) /dirhtml
25+ .PHONY : help clean test html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
4326
4427help :
4528 @echo " Please use \` make <target>' where <target> is one of"
4629 @echo " html to make standalone HTML files"
4730 @echo " dirhtml to make HTML files named index.html in directories"
48- @echo " server to make dirhtml as above, then serve it at http://0.0.0.0:8000/"
31+ @echo " server to make HTML as above and serve it at http://localhost:8000/"
32+ @echo " test to validate the dirhtml output"
4933 @echo " singlehtml to make a single large HTML file"
5034 @echo " pickle to make pickle files"
5135 @echo " json to make JSON files"
@@ -68,38 +52,51 @@ help:
6852 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
6953
7054clean :
71- rm -rf docs.zip $(BUILDDIR ) /*
72-
73- zipfile : dirhtml
74- cd $(BUILDDIR ) /dirhtml; $(ZIP ) -r -D -o ../../docs.zip .
55+ rm -rf $(BUILDDIR ) /*
7556
76- html : check-sphinx
57+ html :
7758 $(SPHINXBUILD ) -b html $(ALLSPHINXOPTS ) $(BUILDDIR ) /html
7859 @echo
7960 @echo " Build finished. The HTML pages are in $( BUILDDIR) /html."
8061
81- singlehtml : check-sphinx
62+ dirhtml :
63+ $(SPHINXBUILD ) -b dirhtml $(ALLSPHINXOPTS ) $(BUILDDIR ) /dirhtml
64+ @echo
65+ @echo " Build finished. The HTML pages are in $( BUILDDIR) /dirhtml."
66+
67+ server : dirhtml
68+ @cd $(BUILDDIR ) /dirhtml; python -m SimpleHTTPServer 8000
69+
70+ test : clean
71+ @if [ ! -d venv ]; then virtualenv venv; fi
72+ venv/bin/pip install -q -r docs_requirements.txt
73+ venv/bin/$(SPHINXBUILD ) -b dirhtml -N -W $(ALLSPHINXOPTS ) $(BUILDDIR ) /dirhtml
74+ grep -q \< h1\> Welcome _build/dirhtml/index.html || exit 1
75+ @echo
76+ @echo " Test finished. The HTML pages are in $( BUILDDIR) /dirhtml."
77+
78+ singlehtml :
8279 $(SPHINXBUILD ) -b singlehtml $(ALLSPHINXOPTS ) $(BUILDDIR ) /singlehtml
8380 @echo
8481 @echo " Build finished. The HTML page is in $( BUILDDIR) /singlehtml."
8582
86- pickle : check-sphinx
83+ pickle :
8784 $(SPHINXBUILD ) -b pickle $(ALLSPHINXOPTS ) $(BUILDDIR ) /pickle
8885 @echo
8986 @echo " Build finished; now you can process the pickle files."
9087
91- json : check-sphinx
88+ json :
9289 $(SPHINXBUILD ) -b json $(ALLSPHINXOPTS ) $(BUILDDIR ) /json
9390 @echo
9491 @echo " Build finished; now you can process the JSON files."
9592
96- htmlhelp : check-sphinx
93+ htmlhelp :
9794 $(SPHINXBUILD ) -b htmlhelp $(ALLSPHINXOPTS ) $(BUILDDIR ) /htmlhelp
9895 @echo
9996 @echo " Build finished; now you can run HTML Help Workshop with the" \
10097 " .hhp project file in $( BUILDDIR) /htmlhelp."
10198
102- qthelp : check-sphinx
99+ qthelp :
103100 $(SPHINXBUILD ) -b qthelp $(ALLSPHINXOPTS ) $(BUILDDIR ) /qthelp
104101 @echo
105102 @echo " Build finished; now you can run " qcollectiongenerator" with the" \
@@ -108,7 +105,7 @@ qthelp: check-sphinx
108105 @echo " To view the help file:"
109106 @echo " # assistant -collectionFile $( BUILDDIR) /qthelp/deis.qhc"
110107
111- devhelp : check-sphinx
108+ devhelp :
112109 $(SPHINXBUILD ) -b devhelp $(ALLSPHINXOPTS ) $(BUILDDIR ) /devhelp
113110 @echo
114111 @echo " Build finished."
@@ -117,83 +114,80 @@ devhelp: check-sphinx
117114 @echo " # ln -s $( BUILDDIR) /devhelp $$ HOME/.local/share/devhelp/deis"
118115 @echo " # devhelp"
119116
120- epub : check-sphinx
117+ epub :
121118 $(SPHINXBUILD ) -b epub $(ALLSPHINXOPTS ) $(BUILDDIR ) /epub
122119 @echo
123120 @echo " Build finished. The epub file is in $( BUILDDIR) /epub."
124121
125- latex : check-sphinx
122+ latex :
126123 $(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
127124 @echo
128125 @echo " Build finished; the LaTeX files are in $( BUILDDIR) /latex."
129126 @echo " Run \` make' in that directory to run these through (pdf)latex" \
130127 " (use \` make latexpdf' here to do that automatically)."
131128
132- latexpdf : check-sphinx
129+ latexpdf :
133130 $(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
134131 @echo " Running LaTeX files through pdflatex..."
135132 $(MAKE ) -C $(BUILDDIR ) /latex all-pdf
136133 @echo " pdflatex finished; the PDF files are in $( BUILDDIR) /latex."
137134
138- latexpdfja : check-sphinx
135+ latexpdfja :
139136 $(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
140137 @echo " Running LaTeX files through platex and dvipdfmx..."
141138 $(MAKE ) -C $(BUILDDIR ) /latex all-pdf-ja
142139 @echo " pdflatex finished; the PDF files are in $( BUILDDIR) /latex."
143140
144- text : check-sphinx
141+ text :
145142 $(SPHINXBUILD ) -b text $(ALLSPHINXOPTS ) $(BUILDDIR ) /text
146143 @echo
147144 @echo " Build finished. The text files are in $( BUILDDIR) /text."
148145
149- man : check-sphinx
146+ man :
150147 $(SPHINXBUILD ) -b man $(ALLSPHINXOPTS ) $(BUILDDIR ) /man
151148 @echo
152149 @echo " Build finished. The manual pages are in $( BUILDDIR) /man."
153150
154- texinfo : check-sphinx
151+ texinfo :
155152 $(SPHINXBUILD ) -b texinfo $(ALLSPHINXOPTS ) $(BUILDDIR ) /texinfo
156153 @echo
157154 @echo " Build finished. The Texinfo files are in $( BUILDDIR) /texinfo."
158155 @echo " Run \` make' in that directory to run these through makeinfo" \
159156 " (use \` make info' here to do that automatically)."
160157
161- info : check-sphinx
158+ info :
162159 $(SPHINXBUILD ) -b texinfo $(ALLSPHINXOPTS ) $(BUILDDIR ) /texinfo
163160 @echo " Running Texinfo files through makeinfo..."
164161 make -C $(BUILDDIR ) /texinfo info
165162 @echo " makeinfo finished; the Info files are in $( BUILDDIR) /texinfo."
166163
167- gettext : check-sphinx
164+ gettext :
168165 $(SPHINXBUILD ) -b gettext $(I18NSPHINXOPTS ) $(BUILDDIR ) /locale
169166 @echo
170167 @echo " Build finished. The message catalogs are in $( BUILDDIR) /locale."
171168
172- changes : check-sphinx
169+ changes :
173170 $(SPHINXBUILD ) -b changes $(ALLSPHINXOPTS ) $(BUILDDIR ) /changes
174171 @echo
175172 @echo " The overview file is in $( BUILDDIR) /changes."
176173
177- linkcheck : check-sphinx
174+ linkcheck :
178175 $(SPHINXBUILD ) -b linkcheck $(ALLSPHINXOPTS ) $(BUILDDIR ) /linkcheck
179176 @echo
180177 @echo " Link check complete; look for any errors in the above output " \
181178 " or in $( BUILDDIR) /linkcheck/output.txt."
182179
183- doctest : check-sphinx
180+ doctest :
184181 $(SPHINXBUILD ) -b doctest $(ALLSPHINXOPTS ) $(BUILDDIR ) /doctest
185182 @echo " Testing of doctests in the sources finished, look at the " \
186183 " results in $( BUILDDIR) /doctest/output.txt."
187184
188- xml : check-sphinx
185+ xml :
189186 $(SPHINXBUILD ) -b xml $(ALLSPHINXOPTS ) $(BUILDDIR ) /xml
190187 @echo
191188 @echo " Build finished. The XML files are in $( BUILDDIR) /xml."
192189
193- pseudoxml : check-sphinx
190+ pseudoxml :
194191 $(SPHINXBUILD ) -b pseudoxml $(ALLSPHINXOPTS ) $(BUILDDIR ) /pseudoxml
195192 @echo
196193 @echo " Build finished. The pseudo-XML files are in $( BUILDDIR) /pseudoxml."
197-
198- server : dirhtml
199- @cd $(BUILDDIR ) /dirhtml; $(PYTHON ) -m SimpleHTTPServer 8000
0 commit comments