@@ -7,8 +7,10 @@ if "%SPHINXBUILD%" == "" (
77)
88set BUILDDIR = _build
99set ALLSPHINXOPTS = -d %BUILDDIR% /doctrees %SPHINXOPTS% .
10+ set I18NSPHINXOPTS = %SPHINXOPTS% .
1011if NOT " %PAPER% " == " " (
1112 set ALLSPHINXOPTS = -D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
13+ set I18NSPHINXOPTS = -D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
1214)
1315
1416if " %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,74 @@ if "%1" == "clean" (
4046 goto end
4147)
4248
49+
50+ REM Check if sphinx-build is available and fallback to Python version if any
51+ %SPHINXBUILD% 2 > nul
52+ if errorlevel 9009 goto sphinx_python
53+ goto sphinx_ok
54+
55+ :sphinx_python
56+
57+ set SPHINXBUILD = python -m sphinx.__init__
58+ %SPHINXBUILD% 2 > nul
59+ if errorlevel 9009 (
60+ echo .
61+ echo .The 'sphinx-build' command was not found. Make sure you have Sphinx
62+ echo .installed, then set the SPHINXBUILD environment variable to point
63+ echo .to the full path of the 'sphinx-build' executable. Alternatively you
64+ echo .may add the Sphinx directory to PATH.
65+ echo .
66+ echo .If you don't have Sphinx installed, grab it from
67+ echo .http://sphinx-doc.org/
68+ exit /b 1
69+ )
70+
71+ :sphinx_ok
72+
73+
4374if " %1 " == " html" (
4475 %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR% /html
76+ if errorlevel 1 exit /b 1
4577 echo .
4678 echo .Build finished. The HTML pages are in %BUILDDIR% /html.
4779 goto end
4880)
4981
5082if " %1 " == " dirhtml" (
5183 %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR% /dirhtml
84+ if errorlevel 1 exit /b 1
5285 echo .
5386 echo .Build finished. The HTML pages are in %BUILDDIR% /dirhtml.
5487 goto end
5588)
5689
5790if " %1 " == " singlehtml" (
5891 %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR% /singlehtml
92+ if errorlevel 1 exit /b 1
5993 echo .
6094 echo .Build finished. The HTML pages are in %BUILDDIR% /singlehtml.
6195 goto end
6296)
6397
6498if " %1 " == " pickle" (
6599 %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR% /pickle
100+ if errorlevel 1 exit /b 1
66101 echo .
67102 echo .Build finished; now you can process the pickle files.
68103 goto end
69104)
70105
71106if " %1 " == " json" (
72107 %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR% /json
108+ if errorlevel 1 exit /b 1
73109 echo .
74110 echo .Build finished; now you can process the JSON files.
75111 goto end
76112)
77113
78114if " %1 " == " htmlhelp" (
79115 %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR% /htmlhelp
116+ if errorlevel 1 exit /b 1
80117 echo .
81118 echo .Build finished; now you can run HTML Help Workshop with the ^
82119.hhp project file in %BUILDDIR% /htmlhelp.
@@ -85,59 +122,103 @@ if "%1" == "htmlhelp" (
85122
86123if " %1 " == " qthelp" (
87124 %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR% /qthelp
125+ if errorlevel 1 exit /b 1
88126 echo .
89127 echo .Build finished; now you can run " qcollectiongenerator" with the ^
90128.qhcp project file in %BUILDDIR% /qthelp, like this:
91- echo .^ > qcollectiongenerator %BUILDDIR% \qthelp\osxpython .qhcp
129+ echo .^ > qcollectiongenerator %BUILDDIR% \qthelp\pythonguide .qhcp
92130 echo .To view the help file:
93- echo .^ > assistant -collectionFile %BUILDDIR% \qthelp\osxpython .ghc
131+ echo .^ > assistant -collectionFile %BUILDDIR% \qthelp\pythonguide .ghc
94132 goto end
95133)
96134
97135if " %1 " == " devhelp" (
98136 %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR% /devhelp
137+ if errorlevel 1 exit /b 1
99138 echo .
100139 echo .Build finished.
101140 goto end
102141)
103142
104143if " %1 " == " epub" (
105144 %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR% /epub
145+ if errorlevel 1 exit /b 1
106146 echo .
107147 echo .Build finished. The epub file is in %BUILDDIR% /epub.
108148 goto end
109149)
110150
111151if " %1 " == " latex" (
112152 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR% /latex
153+ if errorlevel 1 exit /b 1
113154 echo .
114155 echo .Build finished; the LaTeX files are in %BUILDDIR% /latex.
115156 goto end
116157)
117158
159+ if " %1 " == " latexpdf" (
160+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR% /latex
161+ cd %BUILDDIR% /latex
162+ make all-pdf
163+ cd %BUILDDIR% /..
164+ echo .
165+ echo .Build finished; the PDF files are in %BUILDDIR% /latex.
166+ goto end
167+ )
168+
169+ if " %1 " == " latexpdfja" (
170+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR% /latex
171+ cd %BUILDDIR% /latex
172+ make all-pdf-ja
173+ cd %BUILDDIR% /..
174+ echo .
175+ echo .Build finished; the PDF files are in %BUILDDIR% /latex.
176+ goto end
177+ )
178+
118179if " %1 " == " text" (
119180 %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR% /text
181+ if errorlevel 1 exit /b 1
120182 echo .
121183 echo .Build finished. The text files are in %BUILDDIR% /text.
122184 goto end
123185)
124186
125187if " %1 " == " man" (
126188 %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR% /man
189+ if errorlevel 1 exit /b 1
127190 echo .
128191 echo .Build finished. The manual pages are in %BUILDDIR% /man.
129192 goto end
130193)
131194
195+ if " %1 " == " texinfo" (
196+ %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR% /texinfo
197+ if errorlevel 1 exit /b 1
198+ echo .
199+ echo .Build finished. The Texinfo files are in %BUILDDIR% /texinfo.
200+ goto end
201+ )
202+
203+ if " %1 " == " gettext" (
204+ %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR% /locale
205+ if errorlevel 1 exit /b 1
206+ echo .
207+ echo .Build finished. The message catalogs are in %BUILDDIR% /locale.
208+ goto end
209+ )
210+
132211if " %1 " == " changes" (
133212 %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR% /changes
213+ if errorlevel 1 exit /b 1
134214 echo .
135215 echo .The overview file is in %BUILDDIR% /changes.
136216 goto end
137217)
138218
139219if " %1 " == " linkcheck" (
140220 %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR% /linkcheck
221+ if errorlevel 1 exit /b 1
141222 echo .
142223 echo .Link check complete; look for any errors in the above output ^
143224or in %BUILDDIR% /linkcheck/output.txt.
@@ -146,10 +227,27 @@ or in %BUILDDIR%/linkcheck/output.txt.
146227
147228if " %1 " == " doctest" (
148229 %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR% /doctest
230+ if errorlevel 1 exit /b 1
149231 echo .
150232 echo .Testing of doctests in the sources finished, look at the ^
151233results in %BUILDDIR% /doctest/output.txt.
152234 goto end
153235)
154236
237+ if " %1 " == " xml" (
238+ %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR% /xml
239+ if errorlevel 1 exit /b 1
240+ echo .
241+ echo .Build finished. The XML files are in %BUILDDIR% /xml.
242+ goto end
243+ )
244+
245+ if " %1 " == " pseudoxml" (
246+ %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR% /pseudoxml
247+ if errorlevel 1 exit /b 1
248+ echo .
249+ echo .Build finished. The pseudo-XML files are in %BUILDDIR% /pseudoxml.
250+ goto end
251+ )
252+
155253:end
0 commit comments