Debian Codegraph @

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 if exist _static\viewer rmdir /q /s _static\viewer
47 goto end
48 )
49
50
51 %SPHINXBUILD% 2> nul
52 if errorlevel 9009 (
53 echo.
54 echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
55 echo.installed, then set the SPHINXBUILD environment variable to point
56 echo.to the full path of the 'sphinx-build' executable. Alternatively you
57 echo.may add the Sphinx directory to PATH.
58 echo.
59 echo.If you don't have Sphinx installed, grab it from
60 echo.http://sphinx-doc.org/
61 exit /b 1
62 )
63
64 if "%1" == "html" (
65 call :viewer-assets
66 if errorlevel 1 exit /b 1
67 %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
68 if errorlevel 1 exit /b 1
69 echo.
70 echo.Build finished. The HTML pages are in %BUILDDIR%/html.
71 goto end
72 )
73
74 if "%1" == "dirhtml" (
75 call :viewer-assets
76 if errorlevel 1 exit /b 1
77 %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
78 if errorlevel 1 exit /b 1
79 echo.
80 echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
81 goto end
82 )
83
84 if "%1" == "singlehtml" (
85 call :viewer-assets
86 if errorlevel 1 exit /b 1
87 %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
88 if errorlevel 1 exit /b 1
89 echo.
90 echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
91 goto end
92 )
93
94 if "%1" == "pickle" (
95 %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
96 if errorlevel 1 exit /b 1
97 echo.
98 echo.Build finished; now you can process the pickle files.
99 goto end
100 )
101
102 if "%1" == "json" (
103 %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
104 if errorlevel 1 exit /b 1
105 echo.
106 echo.Build finished; now you can process the JSON files.
107 goto end
108 )
109
110 if "%1" == "htmlhelp" (
111 %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
112 if errorlevel 1 exit /b 1
113 echo.
114 echo.Build finished; now you can run HTML Help Workshop with the ^
115 .hhp project file in %BUILDDIR%/htmlhelp.
116 goto end
117 )
118
119 if "%1" == "qthelp" (
120 %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
121 if errorlevel 1 exit /b 1
122 echo.
123 echo.Build finished; now you can run "qcollectiongenerator" with the ^
124 .qhcp project file in %BUILDDIR%/qthelp, like this:
125 echo.^> qcollectiongenerator %BUILDDIR%\qthelp\COLMAP.qhcp
126 echo.To view the help file:
127 echo.^> assistant -collectionFile %BUILDDIR%\qthelp\COLMAP.ghc
128 goto end
129 )
130
131 if "%1" == "devhelp" (
132 %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
133 if errorlevel 1 exit /b 1
134 echo.
135 echo.Build finished.
136 goto end
137 )
138
139 if "%1" == "epub" (
140 %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
141 if errorlevel 1 exit /b 1
142 echo.
143 echo.Build finished. The epub file is in %BUILDDIR%/epub.
144 goto end
145 )
146
147 if "%1" == "latex" (
148 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
149 if errorlevel 1 exit /b 1
150 echo.
151 echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
152 goto end
153 )
154
155 if "%1" == "latexpdf" (
156 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
157 cd %BUILDDIR%/latex
158 make all-pdf
159 cd %BUILDDIR%/..
160 echo.
161 echo.Build finished; the PDF files are in %BUILDDIR%/latex.
162 goto end
163 )
164
165 if "%1" == "latexpdfja" (
166 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
167 cd %BUILDDIR%/latex
168 make all-pdf-ja
169 cd %BUILDDIR%/..
170 echo.
171 echo.Build finished; the PDF files are in %BUILDDIR%/latex.
172 goto end
173 )
174
175 if "%1" == "text" (
176 %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
177 if errorlevel 1 exit /b 1
178 echo.
179 echo.Build finished. The text files are in %BUILDDIR%/text.
180 goto end
181 )
182
183 if "%1" == "man" (
184 %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
185 if errorlevel 1 exit /b 1
186 echo.
187 echo.Build finished. The manual pages are in %BUILDDIR%/man.
188 goto end
189 )
190
191 if "%1" == "texinfo" (
192 %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
193 if errorlevel 1 exit /b 1
194 echo.
195 echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
196 goto end
197 )
198
199 if "%1" == "gettext" (
200 %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
201 if errorlevel 1 exit /b 1
202 echo.
203 echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
204 goto end
205 )
206
207 if "%1" == "changes" (
208 %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
209 if errorlevel 1 exit /b 1
210 echo.
211 echo.The overview file is in %BUILDDIR%/changes.
212 goto end
213 )
214
215 if "%1" == "linkcheck" (
216 %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
217 if errorlevel 1 exit /b 1
218 echo.
219 echo.Link check complete; look for any errors in the above output ^
220 or in %BUILDDIR%/linkcheck/output.txt.
221 goto end
222 )
223
224 if "%1" == "doctest" (
225 %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
226 if errorlevel 1 exit /b 1
227 echo.
228 echo.Testing of doctests in the sources finished, look at the ^
229 results in %BUILDDIR%/doctest/output.txt.
230 goto end
231 )
232
233 if "%1" == "xml" (
234 %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
235 if errorlevel 1 exit /b 1
236 echo.
237 echo.Build finished. The XML files are in %BUILDDIR%/xml.
238 goto end
239 )
240
241 if "%1" == "pseudoxml" (
242 %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
243 if errorlevel 1 exit /b 1
244 echo.
245 echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
246 goto end
247 )
248
249 :end
250 goto :eof
251
252 :viewer-assets
253 where npm > nul 2> nul
254 if errorlevel 1 goto viewer-assets-missing
255 if not exist node_modules goto viewer-assets-missing
256 npm run build
257 exit /b %errorlevel%
258
259 :viewer-assets-missing
260 if "%STRICT_VIEWER%" == "1" (
261 echo.npm and doc\node_modules are required when STRICT_VIEWER=1
262 exit /b 1
263 )
264 echo.WARNING: skipping 3D viewer build ^(npm or doc\node_modules not found^)
265 exit /b 0