make.bat 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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=-n -d %BUILDDIR%/doctrees %SPHINXOPTS% .
  8. if NOT "%PAPER%" == "" (
  9. set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
  10. set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
  11. )
  12. if "%1" == "" goto help
  13. if "%1" == "help" (
  14. :help
  15. echo.Please use `make ^<target^>` where ^<target^> is one of
  16. echo. html to make standalone HTML files
  17. echo. dirhtml to make HTML files named index.html in directories
  18. echo. singlehtml to make a single large HTML file
  19. echo. pickle to make pickle files
  20. echo. json to make JSON files
  21. echo. htmlhelp to make HTML files and a HTML help project
  22. echo. qthelp to make HTML files and a qthelp project
  23. echo. devhelp to make HTML files and a Devhelp project
  24. echo. epub to make an epub
  25. echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
  26. echo. text to make text files
  27. echo. man to make manual pages
  28. echo. texinfo to make a Texinfo source file
  29. echo. gettext to make PO message catalogs
  30. echo. changes to make an overview over all changed/added/deprecated items
  31. echo. linkcheck to check all external links for integrity
  32. echo. doctest to run all doctests embedded in the documentation if enabled
  33. echo. spelling to check for typos in documentation
  34. echo. black to apply the black formatting to code blocks in documentation
  35. goto end
  36. )
  37. if "%1" == "clean" (
  38. for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
  39. del /q /s %BUILDDIR%\*
  40. goto end
  41. )
  42. if "%1" == "html" (
  43. %SPHINXBUILD% -b djangohtml %ALLSPHINXOPTS% %BUILDDIR%/html
  44. if errorlevel 1 exit /b 1
  45. echo.
  46. echo.Build finished. The HTML pages are in %BUILDDIR%/html.
  47. goto end
  48. )
  49. if "%1" == "dirhtml" (
  50. %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
  51. if errorlevel 1 exit /b 1
  52. echo.
  53. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
  54. goto end
  55. )
  56. if "%1" == "singlehtml" (
  57. %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
  58. if errorlevel 1 exit /b 1
  59. echo.
  60. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
  61. goto end
  62. )
  63. if "%1" == "pickle" (
  64. %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
  65. if errorlevel 1 exit /b 1
  66. echo.
  67. echo.Build finished; now you can process the pickle files.
  68. goto end
  69. )
  70. if "%1" == "json" (
  71. %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
  72. if errorlevel 1 exit /b 1
  73. echo.
  74. echo.Build finished; now you can process the JSON files.
  75. goto end
  76. )
  77. if "%1" == "htmlhelp" (
  78. %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
  79. if errorlevel 1 exit /b 1
  80. echo.
  81. echo.Build finished; now you can run HTML Help Workshop with the ^
  82. .hhp project file in %BUILDDIR%/htmlhelp.
  83. goto end
  84. )
  85. if "%1" == "qthelp" (
  86. %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
  87. if errorlevel 1 exit /b 1
  88. echo.
  89. echo.Build finished; now you can run "qcollectiongenerator" with the ^
  90. .qhcp project file in %BUILDDIR%/qthelp, like this:
  91. echo.^> qcollectiongenerator %BUILDDIR%\qthelp\django.qhcp
  92. echo.To view the help file:
  93. echo.^> assistant -collectionFile %BUILDDIR%\qthelp\django.qhc
  94. goto end
  95. )
  96. if "%1" == "devhelp" (
  97. %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
  98. if errorlevel 1 exit /b 1
  99. echo.
  100. echo.Build finished.
  101. goto end
  102. )
  103. if "%1" == "epub" (
  104. %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
  105. if errorlevel 1 exit /b 1
  106. echo.
  107. echo.Build finished. The epub file is in %BUILDDIR%/epub.
  108. goto end
  109. )
  110. if "%1" == "latex" (
  111. %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
  112. if errorlevel 1 exit /b 1
  113. echo.
  114. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
  115. goto end
  116. )
  117. if "%1" == "text" (
  118. %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
  119. if errorlevel 1 exit /b 1
  120. echo.
  121. echo.Build finished. The text files are in %BUILDDIR%/text.
  122. goto end
  123. )
  124. if "%1" == "man" (
  125. %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
  126. if errorlevel 1 exit /b 1
  127. echo.
  128. echo.Build finished. The manual pages are in %BUILDDIR%/man.
  129. goto end
  130. )
  131. if "%1" == "texinfo" (
  132. %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
  133. if errorlevel 1 exit /b 1
  134. echo.
  135. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
  136. goto end
  137. )
  138. if "%%1" == "gettext" (
  139. %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
  140. if errorlevel 1 exit /b 1
  141. echo.
  142. echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
  143. goto end
  144. )
  145. if "%1" == "changes" (
  146. %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
  147. if errorlevel 1 exit /b 1
  148. echo.
  149. echo.The overview file is in %BUILDDIR%/changes.
  150. goto end
  151. )
  152. if "%1" == "linkcheck" (
  153. %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
  154. if errorlevel 1 exit /b 1
  155. echo.
  156. echo.Link check complete; look for any errors in the above output ^
  157. or in %BUILDDIR%/linkcheck/output.txt.
  158. goto end
  159. )
  160. if "%1" == "doctest" (
  161. %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
  162. if errorlevel 1 exit /b 1
  163. echo.
  164. echo.Testing of doctests in the sources finished, look at the ^
  165. results in %BUILDDIR%/doctest/output.txt.
  166. goto end
  167. )
  168. if "%1" == "spelling" (
  169. %SPHINXBUILD% -b spelling %ALLSPHINXOPTS% %BUILDDIR%/spelling
  170. if errorlevel 1 exit /b 1
  171. echo.
  172. echo.Check finished. Wrong words can be found in %BUILDDIR%/^
  173. spelling/output.txt.
  174. goto end
  175. )
  176. if "%1" == "black" (
  177. for /f "usebackq tokens=*" %%i in (`dir *.txt /s /b ^| findstr /v /c:"_build" /c:"_theme"`) do (
  178. blacken-docs --rst-literal-block %%i
  179. )
  180. echo.
  181. echo.Code blocks reformatted
  182. )
  183. :end