make.bat 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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% .
  8. set I18NSPHINXOPTS=%SPHINXOPTS% .
  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. goto end
  39. )
  40. if "%1" == "clean" (
  41. for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
  42. del /q /s %BUILDDIR%\*
  43. goto end
  44. )
  45. REM Check if sphinx-build is available and fallback to Python version if any
  46. %SPHINXBUILD% 1>NUL 2>NUL
  47. if errorlevel 9009 goto sphinx_python
  48. goto sphinx_ok
  49. :sphinx_python
  50. set SPHINXBUILD=python -m sphinx.__init__
  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. :sphinx_ok
  64. if "%1" == "html" (
  65. %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
  66. if errorlevel 1 exit /b 1
  67. echo.
  68. echo.Build finished. The HTML pages are in %BUILDDIR%/html.
  69. goto end
  70. )
  71. if "%1" == "dirhtml" (
  72. %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
  73. if errorlevel 1 exit /b 1
  74. echo.
  75. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
  76. goto end
  77. )
  78. if "%1" == "singlehtml" (
  79. %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
  80. if errorlevel 1 exit /b 1
  81. echo.
  82. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
  83. goto end
  84. )
  85. if "%1" == "pickle" (
  86. %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
  87. if errorlevel 1 exit /b 1
  88. echo.
  89. echo.Build finished; now you can process the pickle files.
  90. goto end
  91. )
  92. if "%1" == "json" (
  93. %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
  94. if errorlevel 1 exit /b 1
  95. echo.
  96. echo.Build finished; now you can process the JSON files.
  97. goto end
  98. )
  99. if "%1" == "htmlhelp" (
  100. %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
  101. if errorlevel 1 exit /b 1
  102. echo.
  103. echo.Build finished; now you can run HTML Help Workshop with the ^
  104. .hhp project file in %BUILDDIR%/htmlhelp.
  105. goto end
  106. )
  107. if "%1" == "qthelp" (
  108. %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
  109. if errorlevel 1 exit /b 1
  110. echo.
  111. echo.Build finished; now you can run "qcollectiongenerator" with the ^
  112. .qhcp project file in %BUILDDIR%/qthelp, like this:
  113. echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PROJ.qhcp
  114. echo.To view the help file:
  115. echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PROJ.ghc
  116. goto end
  117. )
  118. if "%1" == "devhelp" (
  119. %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
  120. if errorlevel 1 exit /b 1
  121. echo.
  122. echo.Build finished.
  123. goto end
  124. )
  125. if "%1" == "epub" (
  126. %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
  127. if errorlevel 1 exit /b 1
  128. echo.
  129. echo.Build finished. The epub file is in %BUILDDIR%/epub.
  130. goto end
  131. )
  132. if "%1" == "epub3" (
  133. %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3
  134. if errorlevel 1 exit /b 1
  135. echo.
  136. echo.Build finished. The epub3 file is in %BUILDDIR%/epub3.
  137. goto end
  138. )
  139. if "%1" == "latex" (
  140. %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
  141. if errorlevel 1 exit /b 1
  142. echo.
  143. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
  144. goto end
  145. )
  146. if "%1" == "latexpdf" (
  147. %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
  148. cd %BUILDDIR%/latex
  149. make all-pdf
  150. cd %~dp0
  151. echo.
  152. echo.Build finished; the PDF files are in %BUILDDIR%/latex.
  153. goto end
  154. )
  155. if "%1" == "latexpdfja" (
  156. %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
  157. cd %BUILDDIR%/latex
  158. make all-pdf-ja
  159. cd %~dp0
  160. echo.
  161. echo.Build finished; the PDF files are in %BUILDDIR%/latex.
  162. goto end
  163. )
  164. if "%1" == "text" (
  165. %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
  166. if errorlevel 1 exit /b 1
  167. echo.
  168. echo.Build finished. The text files are in %BUILDDIR%/text.
  169. goto end
  170. )
  171. if "%1" == "man" (
  172. %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
  173. if errorlevel 1 exit /b 1
  174. echo.
  175. echo.Build finished. The manual pages are in %BUILDDIR%/man.
  176. goto end
  177. )
  178. if "%1" == "texinfo" (
  179. %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
  180. if errorlevel 1 exit /b 1
  181. echo.
  182. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
  183. goto end
  184. )
  185. if "%1" == "gettext" (
  186. %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
  187. if errorlevel 1 exit /b 1
  188. echo.
  189. echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
  190. goto end
  191. )
  192. if "%1" == "changes" (
  193. %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
  194. if errorlevel 1 exit /b 1
  195. echo.
  196. echo.The overview file is in %BUILDDIR%/changes.
  197. goto end
  198. )
  199. if "%1" == "linkcheck" (
  200. %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
  201. if errorlevel 1 exit /b 1
  202. echo.
  203. echo.Link check complete; look for any errors in the above output ^
  204. or in %BUILDDIR%/linkcheck/output.txt.
  205. goto end
  206. )
  207. if "%1" == "doctest" (
  208. %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
  209. if errorlevel 1 exit /b 1
  210. echo.
  211. echo.Testing of doctests in the sources finished, look at the ^
  212. results in %BUILDDIR%/doctest/output.txt.
  213. goto end
  214. )
  215. if "%1" == "coverage" (
  216. %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
  217. if errorlevel 1 exit /b 1
  218. echo.
  219. echo.Testing of coverage in the sources finished, look at the ^
  220. results in %BUILDDIR%/coverage/python.txt.
  221. goto end
  222. )
  223. if "%1" == "xml" (
  224. %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
  225. if errorlevel 1 exit /b 1
  226. echo.
  227. echo.Build finished. The XML files are in %BUILDDIR%/xml.
  228. goto end
  229. )
  230. if "%1" == "pseudoxml" (
  231. %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
  232. if errorlevel 1 exit /b 1
  233. echo.
  234. echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
  235. goto end
  236. )
  237. :end