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