Skip to content

Commit 2f5ae17

Browse files
committed
Update make files with versions from Sphinx 1.2
1 parent eb2b08a commit 2f5ae17

File tree

2 files changed

+137
-3
lines changed

2 files changed

+137
-3
lines changed

docs/Makefile

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@ SPHINXBUILD = sphinx-build
77
PAPER =
88
BUILDDIR = _build
99

10+
# User-friendly check for sphinx-build
11+
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12+
$(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/)
13+
endif
14+
1015
# Internal variables.
1116
PAPEROPT_a4 = -D latex_paper_size=a4
1217
PAPEROPT_letter = -D latex_paper_size=letter
1318
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19+
# the i18n builder cannot share the environment and doctrees with the others
20+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1421

15-
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
22+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
1623

1724
help:
1825
@echo "Please use \`make <target>' where <target> is one of"
@@ -27,14 +34,20 @@ help:
2734
@echo " epub to make an epub"
2835
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
2936
@echo " latexpdf to make LaTeX files and run them through pdflatex"
37+
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
3038
@echo " text to make text files"
3139
@echo " man to make manual pages"
40+
@echo " texinfo to make Texinfo files"
41+
@echo " info to make Texinfo files and run them through makeinfo"
42+
@echo " gettext to make PO message catalogs"
3243
@echo " changes to make an overview of all changed/added/deprecated items"
44+
@echo " xml to make Docutils-native XML files"
45+
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
3346
@echo " linkcheck to check all external links for integrity"
3447
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
3548

3649
clean:
37-
-rm -rf $(BUILDDIR)/*
50+
rm -rf $(BUILDDIR)/*
3851

3952
html:
4053
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@@ -100,7 +113,13 @@ latex:
100113
latexpdf:
101114
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
102115
@echo "Running LaTeX files through pdflatex..."
103-
make -C $(BUILDDIR)/latex all-pdf
116+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
117+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
118+
119+
latexpdfja:
120+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121+
@echo "Running LaTeX files through platex and dvipdfmx..."
122+
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
104123
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
105124

106125
text:
@@ -113,6 +132,24 @@ man:
113132
@echo
114133
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
115134

135+
texinfo:
136+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
137+
@echo
138+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
139+
@echo "Run \`make' in that directory to run these through makeinfo" \
140+
"(use \`make info' here to do that automatically)."
141+
142+
info:
143+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
144+
@echo "Running Texinfo files through makeinfo..."
145+
make -C $(BUILDDIR)/texinfo info
146+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
147+
148+
gettext:
149+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
150+
@echo
151+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
152+
116153
changes:
117154
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
118155
@echo
@@ -128,3 +165,13 @@ doctest:
128165
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
129166
@echo "Testing of doctests in the sources finished, look at the " \
130167
"results in $(BUILDDIR)/doctest/output.txt."
168+
169+
xml:
170+
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
171+
@echo
172+
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
173+
174+
pseudoxml:
175+
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
176+
@echo
177+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

docs/make.bat

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ if "%SPHINXBUILD%" == "" (
77
)
88
set BUILDDIR=_build
99
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
10+
set I18NSPHINXOPTS=%SPHINXOPTS% .
1011
if NOT "%PAPER%" == "" (
1112
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
13+
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
1214
)
1315

1416
if "%1" == "" goto help
@@ -28,7 +30,11 @@ if "%1" == "help" (
2830
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
2931
echo. text to make text files
3032
echo. man to make manual pages
33+
echo. texinfo to make Texinfo files
34+
echo. gettext to make PO message catalogs
3135
echo. changes to make an overview over all changed/added/deprecated items
36+
echo. xml to make Docutils-native XML files
37+
echo. pseudoxml to make pseudoxml-XML files for display purposes
3238
echo. linkcheck to check all external links for integrity
3339
echo. doctest to run all doctests embedded in the documentation if enabled
3440
goto end
@@ -40,43 +46,63 @@ if "%1" == "clean" (
4046
goto end
4147
)
4248

49+
50+
%SPHINXBUILD% 2> nul
51+
if errorlevel 9009 (
52+
echo.
53+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
54+
echo.installed, then set the SPHINXBUILD environment variable to point
55+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
56+
echo.may add the Sphinx directory to PATH.
57+
echo.
58+
echo.If you don't have Sphinx installed, grab it from
59+
echo.http://sphinx-doc.org/
60+
exit /b 1
61+
)
62+
4363
if "%1" == "html" (
4464
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
65+
if errorlevel 1 exit /b 1
4566
echo.
4667
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
4768
goto end
4869
)
4970

5071
if "%1" == "dirhtml" (
5172
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
73+
if errorlevel 1 exit /b 1
5274
echo.
5375
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
5476
goto end
5577
)
5678

5779
if "%1" == "singlehtml" (
5880
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
81+
if errorlevel 1 exit /b 1
5982
echo.
6083
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
6184
goto end
6285
)
6386

6487
if "%1" == "pickle" (
6588
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
89+
if errorlevel 1 exit /b 1
6690
echo.
6791
echo.Build finished; now you can process the pickle files.
6892
goto end
6993
)
7094

7195
if "%1" == "json" (
7296
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
97+
if errorlevel 1 exit /b 1
7398
echo.
7499
echo.Build finished; now you can process the JSON files.
75100
goto end
76101
)
77102

78103
if "%1" == "htmlhelp" (
79104
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
105+
if errorlevel 1 exit /b 1
80106
echo.
81107
echo.Build finished; now you can run HTML Help Workshop with the ^
82108
.hhp project file in %BUILDDIR%/htmlhelp.
@@ -85,6 +111,7 @@ if "%1" == "htmlhelp" (
85111

86112
if "%1" == "qthelp" (
87113
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
114+
if errorlevel 1 exit /b 1
88115
echo.
89116
echo.Build finished; now you can run "qcollectiongenerator" with the ^
90117
.qhcp project file in %BUILDDIR%/qthelp, like this:
@@ -96,48 +123,91 @@ if "%1" == "qthelp" (
96123

97124
if "%1" == "devhelp" (
98125
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
126+
if errorlevel 1 exit /b 1
99127
echo.
100128
echo.Build finished.
101129
goto end
102130
)
103131

104132
if "%1" == "epub" (
105133
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
134+
if errorlevel 1 exit /b 1
106135
echo.
107136
echo.Build finished. The epub file is in %BUILDDIR%/epub.
108137
goto end
109138
)
110139

111140
if "%1" == "latex" (
112141
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
142+
if errorlevel 1 exit /b 1
113143
echo.
114144
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
115145
goto end
116146
)
117147

148+
if "%1" == "latexpdf" (
149+
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
150+
cd %BUILDDIR%/latex
151+
make all-pdf
152+
cd %BUILDDIR%/..
153+
echo.
154+
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
155+
goto end
156+
)
157+
158+
if "%1" == "latexpdfja" (
159+
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
160+
cd %BUILDDIR%/latex
161+
make all-pdf-ja
162+
cd %BUILDDIR%/..
163+
echo.
164+
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
165+
goto end
166+
)
167+
118168
if "%1" == "text" (
119169
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
170+
if errorlevel 1 exit /b 1
120171
echo.
121172
echo.Build finished. The text files are in %BUILDDIR%/text.
122173
goto end
123174
)
124175

125176
if "%1" == "man" (
126177
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
178+
if errorlevel 1 exit /b 1
127179
echo.
128180
echo.Build finished. The manual pages are in %BUILDDIR%/man.
129181
goto end
130182
)
131183

184+
if "%1" == "texinfo" (
185+
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
186+
if errorlevel 1 exit /b 1
187+
echo.
188+
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
189+
goto end
190+
)
191+
192+
if "%1" == "gettext" (
193+
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
194+
if errorlevel 1 exit /b 1
195+
echo.
196+
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
197+
goto end
198+
)
199+
132200
if "%1" == "changes" (
133201
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
202+
if errorlevel 1 exit /b 1
134203
echo.
135204
echo.The overview file is in %BUILDDIR%/changes.
136205
goto end
137206
)
138207

139208
if "%1" == "linkcheck" (
140209
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
210+
if errorlevel 1 exit /b 1
141211
echo.
142212
echo.Link check complete; look for any errors in the above output ^
143213
or in %BUILDDIR%/linkcheck/output.txt.
@@ -146,10 +216,27 @@ or in %BUILDDIR%/linkcheck/output.txt.
146216

147217
if "%1" == "doctest" (
148218
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
219+
if errorlevel 1 exit /b 1
149220
echo.
150221
echo.Testing of doctests in the sources finished, look at the ^
151222
results in %BUILDDIR%/doctest/output.txt.
152223
goto end
153224
)
154225

226+
if "%1" == "xml" (
227+
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
228+
if errorlevel 1 exit /b 1
229+
echo.
230+
echo.Build finished. The XML files are in %BUILDDIR%/xml.
231+
goto end
232+
)
233+
234+
if "%1" == "pseudoxml" (
235+
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
236+
if errorlevel 1 exit /b 1
237+
echo.
238+
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
239+
goto end
240+
)
241+
155242
:end

0 commit comments

Comments
 (0)