Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | @ECHO OFF |
michael@0 | 2 | |
michael@0 | 3 | REM Command file for Sphinx documentation |
michael@0 | 4 | |
michael@0 | 5 | if "%SPHINXBUILD%" == "" ( |
michael@0 | 6 | set SPHINXBUILD=sphinx-build |
michael@0 | 7 | ) |
michael@0 | 8 | set BUILDDIR=_build |
michael@0 | 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . |
michael@0 | 10 | if NOT "%PAPER%" == "" ( |
michael@0 | 11 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% |
michael@0 | 12 | ) |
michael@0 | 13 | |
michael@0 | 14 | if "%1" == "" goto help |
michael@0 | 15 | |
michael@0 | 16 | if "%1" == "help" ( |
michael@0 | 17 | :help |
michael@0 | 18 | echo.Please use `make ^<target^>` where ^<target^> is one of |
michael@0 | 19 | echo. html to make standalone HTML files |
michael@0 | 20 | echo. dirhtml to make HTML files named index.html in directories |
michael@0 | 21 | echo. singlehtml to make a single large HTML file |
michael@0 | 22 | echo. pickle to make pickle files |
michael@0 | 23 | echo. json to make JSON files |
michael@0 | 24 | echo. htmlhelp to make HTML files and a HTML help project |
michael@0 | 25 | echo. qthelp to make HTML files and a qthelp project |
michael@0 | 26 | echo. devhelp to make HTML files and a Devhelp project |
michael@0 | 27 | echo. epub to make an epub |
michael@0 | 28 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter |
michael@0 | 29 | echo. text to make text files |
michael@0 | 30 | echo. man to make manual pages |
michael@0 | 31 | echo. changes to make an overview over all changed/added/deprecated items |
michael@0 | 32 | echo. linkcheck to check all external links for integrity |
michael@0 | 33 | echo. doctest to run all doctests embedded in the documentation if enabled |
michael@0 | 34 | goto end |
michael@0 | 35 | ) |
michael@0 | 36 | |
michael@0 | 37 | if "%1" == "clean" ( |
michael@0 | 38 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i |
michael@0 | 39 | del /q /s %BUILDDIR%\* |
michael@0 | 40 | goto end |
michael@0 | 41 | ) |
michael@0 | 42 | |
michael@0 | 43 | if "%1" == "html" ( |
michael@0 | 44 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html |
michael@0 | 45 | if errorlevel 1 exit /b 1 |
michael@0 | 46 | echo. |
michael@0 | 47 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. |
michael@0 | 48 | goto end |
michael@0 | 49 | ) |
michael@0 | 50 | |
michael@0 | 51 | if "%1" == "dirhtml" ( |
michael@0 | 52 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml |
michael@0 | 53 | if errorlevel 1 exit /b 1 |
michael@0 | 54 | echo. |
michael@0 | 55 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. |
michael@0 | 56 | goto end |
michael@0 | 57 | ) |
michael@0 | 58 | |
michael@0 | 59 | if "%1" == "singlehtml" ( |
michael@0 | 60 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml |
michael@0 | 61 | if errorlevel 1 exit /b 1 |
michael@0 | 62 | echo. |
michael@0 | 63 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. |
michael@0 | 64 | goto end |
michael@0 | 65 | ) |
michael@0 | 66 | |
michael@0 | 67 | if "%1" == "pickle" ( |
michael@0 | 68 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle |
michael@0 | 69 | if errorlevel 1 exit /b 1 |
michael@0 | 70 | echo. |
michael@0 | 71 | echo.Build finished; now you can process the pickle files. |
michael@0 | 72 | goto end |
michael@0 | 73 | ) |
michael@0 | 74 | |
michael@0 | 75 | if "%1" == "json" ( |
michael@0 | 76 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json |
michael@0 | 77 | if errorlevel 1 exit /b 1 |
michael@0 | 78 | echo. |
michael@0 | 79 | echo.Build finished; now you can process the JSON files. |
michael@0 | 80 | goto end |
michael@0 | 81 | ) |
michael@0 | 82 | |
michael@0 | 83 | if "%1" == "htmlhelp" ( |
michael@0 | 84 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp |
michael@0 | 85 | if errorlevel 1 exit /b 1 |
michael@0 | 86 | echo. |
michael@0 | 87 | echo.Build finished; now you can run HTML Help Workshop with the ^ |
michael@0 | 88 | .hhp project file in %BUILDDIR%/htmlhelp. |
michael@0 | 89 | goto end |
michael@0 | 90 | ) |
michael@0 | 91 | |
michael@0 | 92 | if "%1" == "qthelp" ( |
michael@0 | 93 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp |
michael@0 | 94 | if errorlevel 1 exit /b 1 |
michael@0 | 95 | echo. |
michael@0 | 96 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ |
michael@0 | 97 | .qhcp project file in %BUILDDIR%/qthelp, like this: |
michael@0 | 98 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\django-compressor.qhcp |
michael@0 | 99 | echo.To view the help file: |
michael@0 | 100 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\django-compressor.ghc |
michael@0 | 101 | goto end |
michael@0 | 102 | ) |
michael@0 | 103 | |
michael@0 | 104 | if "%1" == "devhelp" ( |
michael@0 | 105 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp |
michael@0 | 106 | if errorlevel 1 exit /b 1 |
michael@0 | 107 | echo. |
michael@0 | 108 | echo.Build finished. |
michael@0 | 109 | goto end |
michael@0 | 110 | ) |
michael@0 | 111 | |
michael@0 | 112 | if "%1" == "epub" ( |
michael@0 | 113 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub |
michael@0 | 114 | if errorlevel 1 exit /b 1 |
michael@0 | 115 | echo. |
michael@0 | 116 | echo.Build finished. The epub file is in %BUILDDIR%/epub. |
michael@0 | 117 | goto end |
michael@0 | 118 | ) |
michael@0 | 119 | |
michael@0 | 120 | if "%1" == "latex" ( |
michael@0 | 121 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex |
michael@0 | 122 | if errorlevel 1 exit /b 1 |
michael@0 | 123 | echo. |
michael@0 | 124 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. |
michael@0 | 125 | goto end |
michael@0 | 126 | ) |
michael@0 | 127 | |
michael@0 | 128 | if "%1" == "text" ( |
michael@0 | 129 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text |
michael@0 | 130 | if errorlevel 1 exit /b 1 |
michael@0 | 131 | echo. |
michael@0 | 132 | echo.Build finished. The text files are in %BUILDDIR%/text. |
michael@0 | 133 | goto end |
michael@0 | 134 | ) |
michael@0 | 135 | |
michael@0 | 136 | if "%1" == "man" ( |
michael@0 | 137 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man |
michael@0 | 138 | if errorlevel 1 exit /b 1 |
michael@0 | 139 | echo. |
michael@0 | 140 | echo.Build finished. The manual pages are in %BUILDDIR%/man. |
michael@0 | 141 | goto end |
michael@0 | 142 | ) |
michael@0 | 143 | |
michael@0 | 144 | if "%1" == "changes" ( |
michael@0 | 145 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes |
michael@0 | 146 | if errorlevel 1 exit /b 1 |
michael@0 | 147 | echo. |
michael@0 | 148 | echo.The overview file is in %BUILDDIR%/changes. |
michael@0 | 149 | goto end |
michael@0 | 150 | ) |
michael@0 | 151 | |
michael@0 | 152 | if "%1" == "linkcheck" ( |
michael@0 | 153 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck |
michael@0 | 154 | if errorlevel 1 exit /b 1 |
michael@0 | 155 | echo. |
michael@0 | 156 | echo.Link check complete; look for any errors in the above output ^ |
michael@0 | 157 | or in %BUILDDIR%/linkcheck/output.txt. |
michael@0 | 158 | goto end |
michael@0 | 159 | ) |
michael@0 | 160 | |
michael@0 | 161 | if "%1" == "doctest" ( |
michael@0 | 162 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest |
michael@0 | 163 | if errorlevel 1 exit /b 1 |
michael@0 | 164 | echo. |
michael@0 | 165 | echo.Testing of doctests in the sources finished, look at the ^ |
michael@0 | 166 | results in %BUILDDIR%/doctest/output.txt. |
michael@0 | 167 | goto end |
michael@0 | 168 | ) |
michael@0 | 169 | |
michael@0 | 170 | :end |