Debian Codegraph @

pypy/doc/make.bat

raw
1 @ECHO OFF
2
3 REM Command file for Sphinx documentation
4
5 if "%SPHINXBUILD%" == "" (
6 set SPHINXBUILD=sphinx-build
7 )
8 set BUILDDIR=_build
9 set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
10 set I18NSPHINXOPTS=%SPHINXOPTS% .
11 if NOT "%PAPER%" == "" (
12 set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
13 set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
14 )
15
16 if "%1" == "" goto help
17
18 if "%1" == "help" (
19 :help
20 echo.Please use `make ^<target^>` where ^<target^> is one of
21 echo. html to make standalone HTML files
22 echo. dirhtml to make HTML files named index.html in directories
23 echo. singlehtml to make a single large HTML file
24 echo. pickle to make pickle files
25 echo. json to make JSON files
26 echo. htmlhelp to make HTML files and a HTML help project
27 echo. qthelp to make HTML files and a qthelp project
28 echo. devhelp to make HTML files and a Devhelp project
29 echo. epub to make an epub
30 echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
31 echo. text to make text files
32 echo. man to make manual pages
33 echo. texinfo to make Texinfo files
34 echo. gettext to make PO message catalogs
35 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
38 echo. linkcheck to check all external links for integrity
39 echo. doctest to run all doctests embedded in the documentation if enabled
40 goto end
41 )
42
43 if "%1" == "clean" (
44 for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
45 del /q /s %BUILDDIR%\*
46 goto end
47 )
48
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
74 if "%1" == "html" (
75 %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
76 if errorlevel 1 exit /b 1
77 echo.
78 echo.Build finished. The HTML pages are in %BUILDDIR%/html.
79 goto end
80 )
81
82 if "%1" == "dirhtml" (
83 %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
84 if errorlevel 1 exit /b 1
85 echo.
86 echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
87 goto end
88 )
89
90 if "%1" == "singlehtml" (
91 %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
92 if errorlevel 1 exit /b 1
93 echo.
94 echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
95 goto end
96 )
97
98 if "%1" == "pickle" (
99 %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
100 if errorlevel 1 exit /b 1
101 echo.
102 echo.Build finished; now you can process the pickle files.
103 goto end
104 )
105
106 if "%1" == "json" (
107 %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
108 if errorlevel 1 exit /b 1
109 echo.
110 echo.Build finished; now you can process the JSON files.
111 goto end
112 )
113
114 if "%1" == "htmlhelp" (
115 %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
116 if errorlevel 1 exit /b 1
117 echo.
118 echo.Build finished; now you can run HTML Help Workshop with the ^
119 .hhp project file in %BUILDDIR%/htmlhelp.
120 goto end
121 )
122
123 if "%1" == "qthelp" (
124 %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
125 if errorlevel 1 exit /b 1
126 echo.
127 echo.Build finished; now you can run "qcollectiongenerator" with the ^
128 .qhcp project file in %BUILDDIR%/qthelp, like this:
129 echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PyPy.qhcp
130 echo.To view the help file:
131 echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PyPy.ghc
132 goto end
133 )
134
135 if "%1" == "devhelp" (
136 %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
137 if errorlevel 1 exit /b 1
138 echo.
139 echo.Build finished.
140 goto end
141 )
142
143 if "%1" == "epub" (
144 %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
145 if errorlevel 1 exit /b 1
146 echo.
147 echo.Build finished. The epub file is in %BUILDDIR%/epub.
148 goto end
149 )
150
151 if "%1" == "latex" (
152 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
153 if errorlevel 1 exit /b 1
154 echo.
155 echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
156 goto end
157 )
158
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
179 if "%1" == "text" (
180 %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
181 if errorlevel 1 exit /b 1
182 echo.
183 echo.Build finished. The text files are in %BUILDDIR%/text.
184 goto end
185 )
186
187 if "%1" == "man" (
188 %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
189 if errorlevel 1 exit /b 1
190 echo.
191 echo.Build finished. The manual pages are in %BUILDDIR%/man.
192 goto end
193 )
194
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
211 if "%1" == "changes" (
212 %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
213 if errorlevel 1 exit /b 1
214 echo.
215 echo.The overview file is in %BUILDDIR%/changes.
216 goto end
217 )
218
219 if "%1" == "linkcheck" (
220 %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
221 if errorlevel 1 exit /b 1
222 echo.
223 echo.Link check complete; look for any errors in the above output ^
224 or in %BUILDDIR%/linkcheck/output.txt.
225 goto end
226 )
227
228 if "%1" == "doctest" (
229 %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
230 if errorlevel 1 exit /b 1
231 echo.
232 echo.Testing of doctests in the sources finished, look at the ^
233 results in %BUILDDIR%/doctest/output.txt.
234 goto end
235 )
236
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
253 :end