make.bat 6.8 KB

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