You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

make.bat 7.3KB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. @ECHO OFF
  2. REM Command file for Sphinx documentation
  3. if "%SPHINXBUILD%" == "" (
  4. set SPHINXBUILD=sphinx-build
  5. )
  6. set BUILDDIR=build
  7. set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
  8. set I18NSPHINXOPTS=%SPHINXOPTS% source
  9. if NOT "%PAPER%" == "" (
  10. set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
  11. set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
  12. )
  13. if "%1" == "" goto help
  14. if "%1" == "help" (
  15. :help
  16. echo.Please use `make ^<target^>` where ^<target^> is one of
  17. echo. html to make standalone HTML files
  18. echo. dirhtml to make HTML files named index.html in directories
  19. echo. singlehtml to make a single large HTML file
  20. echo. pickle to make pickle files
  21. echo. json to make JSON files
  22. echo. htmlhelp to make HTML files and a HTML help project
  23. echo. qthelp to make HTML files and a qthelp project
  24. echo. devhelp to make HTML files and a Devhelp project
  25. echo. epub to make an epub
  26. echo. epub3 to make an epub3
  27. echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
  28. echo. text to make text files
  29. echo. man to make manual pages
  30. echo. texinfo to make Texinfo files
  31. echo. gettext to make PO message catalogs
  32. echo. changes to make an overview over all changed/added/deprecated items
  33. echo. xml to make Docutils-native XML files
  34. echo. pseudoxml to make pseudoxml-XML files for display purposes
  35. echo. linkcheck to check all external links for integrity
  36. echo. doctest to run all doctests embedded in the documentation if enabled
  37. echo. coverage to run coverage check of the documentation if enabled
  38. echo. dummy to check syntax errors of document sources
  39. goto end
  40. )
  41. if "%1" == "clean" (
  42. for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
  43. del /q /s %BUILDDIR%\*
  44. goto end
  45. )
  46. REM Check if sphinx-build is available and fallback to Python version if any
  47. %SPHINXBUILD% 1>NUL 2>NUL
  48. if errorlevel 9009 goto sphinx_python
  49. goto sphinx_ok
  50. :sphinx_python
  51. set SPHINXBUILD=python -m sphinx.__init__
  52. %SPHINXBUILD% 2> nul
  53. if errorlevel 9009 (
  54. echo.
  55. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
  56. echo.installed, then set the SPHINXBUILD environment variable to point
  57. echo.to the full path of the 'sphinx-build' executable. Alternatively you
  58. echo.may add the Sphinx directory to PATH.
  59. echo.
  60. echo.If you don't have Sphinx installed, grab it from
  61. echo.http://sphinx-doc.org/
  62. exit /b 1
  63. )
  64. :sphinx_ok
  65. if "%1" == "html" (
  66. %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
  67. if errorlevel 1 exit /b 1
  68. echo.
  69. echo.Build finished. The HTML pages are in %BUILDDIR%/html.
  70. goto end
  71. )
  72. if "%1" == "dirhtml" (
  73. %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
  74. if errorlevel 1 exit /b 1
  75. echo.
  76. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
  77. goto end
  78. )
  79. if "%1" == "singlehtml" (
  80. %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
  81. if errorlevel 1 exit /b 1
  82. echo.
  83. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
  84. goto end
  85. )
  86. if "%1" == "pickle" (
  87. %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
  88. if errorlevel 1 exit /b 1
  89. echo.
  90. echo.Build finished; now you can process the pickle files.
  91. goto end
  92. )
  93. if "%1" == "json" (
  94. %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
  95. if errorlevel 1 exit /b 1
  96. echo.
  97. echo.Build finished; now you can process the JSON files.
  98. goto end
  99. )
  100. if "%1" == "htmlhelp" (
  101. %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
  102. if errorlevel 1 exit /b 1
  103. echo.
  104. echo.Build finished; now you can run HTML Help Workshop with the ^
  105. .hhp project file in %BUILDDIR%/htmlhelp.
  106. goto end
  107. )
  108. if "%1" == "qthelp" (
  109. %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
  110. if errorlevel 1 exit /b 1
  111. echo.
  112. echo.Build finished; now you can run "qcollectiongenerator" with the ^
  113. .qhcp project file in %BUILDDIR%/qthelp, like this:
  114. echo.^> qcollectiongenerator %BUILDDIR%\qthelp\NeuroRTArchway.qhcp
  115. echo.To view the help file:
  116. echo.^> assistant -collectionFile %BUILDDIR%\qthelp\NeuroRTArchway.ghc
  117. goto end
  118. )
  119. if "%1" == "devhelp" (
  120. %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
  121. if errorlevel 1 exit /b 1
  122. echo.
  123. echo.Build finished.
  124. goto end
  125. )
  126. if "%1" == "epub" (
  127. %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
  128. if errorlevel 1 exit /b 1
  129. echo.
  130. echo.Build finished. The epub file is in %BUILDDIR%/epub.
  131. goto end
  132. )
  133. if "%1" == "epub3" (
  134. %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3
  135. if errorlevel 1 exit /b 1
  136. echo.
  137. echo.Build finished. The epub3 file is in %BUILDDIR%/epub3.
  138. goto end
  139. )
  140. if "%1" == "latex" (
  141. %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
  142. if errorlevel 1 exit /b 1
  143. echo.
  144. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
  145. goto end
  146. )
  147. if "%1" == "latexpdf" (
  148. %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
  149. cd %BUILDDIR%/latex
  150. make all-pdf
  151. cd %~dp0
  152. echo.
  153. echo.Build finished; the PDF files are in %BUILDDIR%/latex.
  154. goto end
  155. )
  156. if "%1" == "latexpdfja" (
  157. %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
  158. cd %BUILDDIR%/latex
  159. make all-pdf-ja
  160. cd %~dp0
  161. echo.
  162. echo.Build finished; the PDF files are in %BUILDDIR%/latex.
  163. goto end
  164. )
  165. if "%1" == "text" (
  166. %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
  167. if errorlevel 1 exit /b 1
  168. echo.
  169. echo.Build finished. The text files are in %BUILDDIR%/text.
  170. goto end
  171. )
  172. if "%1" == "man" (
  173. %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
  174. if errorlevel 1 exit /b 1
  175. echo.
  176. echo.Build finished. The manual pages are in %BUILDDIR%/man.
  177. goto end
  178. )
  179. if "%1" == "texinfo" (
  180. %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
  181. if errorlevel 1 exit /b 1
  182. echo.
  183. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
  184. goto end
  185. )
  186. if "%1" == "gettext" (
  187. %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
  188. if errorlevel 1 exit /b 1
  189. echo.
  190. echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
  191. goto end
  192. )
  193. if "%1" == "changes" (
  194. %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
  195. if errorlevel 1 exit /b 1
  196. echo.
  197. echo.The overview file is in %BUILDDIR%/changes.
  198. goto end
  199. )
  200. if "%1" == "linkcheck" (
  201. %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
  202. if errorlevel 1 exit /b 1
  203. echo.
  204. echo.Link check complete; look for any errors in the above output ^
  205. or in %BUILDDIR%/linkcheck/output.txt.
  206. goto end
  207. )
  208. if "%1" == "doctest" (
  209. %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
  210. if errorlevel 1 exit /b 1
  211. echo.
  212. echo.Testing of doctests in the sources finished, look at the ^
  213. results in %BUILDDIR%/doctest/output.txt.
  214. goto end
  215. )
  216. if "%1" == "coverage" (
  217. %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
  218. if errorlevel 1 exit /b 1
  219. echo.
  220. echo.Testing of coverage in the sources finished, look at the ^
  221. results in %BUILDDIR%/coverage/python.txt.
  222. goto end
  223. )
  224. if "%1" == "xml" (
  225. %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
  226. if errorlevel 1 exit /b 1
  227. echo.
  228. echo.Build finished. The XML files are in %BUILDDIR%/xml.
  229. goto end
  230. )
  231. if "%1" == "pseudoxml" (
  232. %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
  233. if errorlevel 1 exit /b 1
  234. echo.
  235. echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
  236. goto end
  237. )
  238. if "%1" == "dummy" (
  239. %SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy
  240. if errorlevel 1 exit /b 1
  241. echo.
  242. echo.Build finished. Dummy builder generates no files.
  243. goto end
  244. )
  245. :end