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