make.bat 7.4 KB

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