Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #16414 -- Added standard Windows make batch file for Sphinx. Th…

…anks, Aymeric Augustin.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16547 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8f7b5024b29321ff7b6995c6616558dca16104eb 1 parent 0452d4c
Jannis Leidel authored July 19, 2011
3  docs/README
@@ -9,7 +9,8 @@ To create an HTML version of the docs on a Unix machine (Linux or Mac):
9 9
 
10 10
 * Install Sphinx (using ``easy_install Sphinx`` or some other method)
11 11
 
12  
-* In this docs/ directory, type ``make html`` at a shell prompt.
  12
+* In this docs/ directory, type ``make html`` (or ``make.bat html`` on
  13
+  Windows) at a shell prompt.
13 14
 
14 15
 The documentation in _build/html/index.html can then be viewed in a web browser.
15 16
 
4  docs/internals/contributing/writing-documentation.txt
@@ -40,8 +40,8 @@ Sphinx -- ``easy_install Sphinx`` should do the trick.
40 40
 
41 41
 __ http://pygments.org
42 42
 
43  
-Then, building the HTML is easy; just ``make html`` from the ``docs``
44  
-directory.
  43
+Then, building the HTML is easy; just ``make html`` (or ``make.bat html`` on
  44
+Windows) from the ``docs`` directory.
45 45
 
46 46
 To get started contributing, you'll want to read the `reStructuredText
47 47
 Primer`__. After that, you'll want to read about the `Sphinx-specific markup`__
7  docs/intro/whatsnext.txt
@@ -183,6 +183,13 @@ You can get a local copy of the HTML documentation following a few easy steps:
183 183
 
184 184
       You'll need `GNU Make`__ installed for this.
185 185
 
  186
+      If you're on Windows you can alternatively use the included batch file:
  187
+
  188
+      .. code-block:: bat
  189
+
  190
+            cd path\to\django\docs
  191
+            make.bat html
  192
+
186 193
     * The HTML documentation will be placed in ``docs/_build/html``.
187 194
 
188 195
 .. note::
170  docs/make.bat
... ...
@@ -0,0 +1,170 @@
  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% .
  10
+if NOT "%PAPER%" == "" (
  11
+	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
  12
+)
  13
+
  14
+if "%1" == "" goto help
  15
+
  16
+if "%1" == "help" (
  17
+	:help
  18
+	echo.Please use `make ^<target^>` where ^<target^> is one of
  19
+	echo.  html       to make standalone HTML files
  20
+	echo.  dirhtml    to make HTML files named index.html in directories
  21
+	echo.  singlehtml to make a single large HTML file
  22
+	echo.  pickle     to make pickle files
  23
+	echo.  json       to make JSON files
  24
+	echo.  htmlhelp   to make HTML files and a HTML help project
  25
+	echo.  qthelp     to make HTML files and a qthelp project
  26
+	echo.  devhelp    to make HTML files and a Devhelp project
  27
+	echo.  epub       to make an epub
  28
+	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
  29
+	echo.  text       to make text files
  30
+	echo.  man        to make manual pages
  31
+	echo.  changes    to make an overview over all changed/added/deprecated items
  32
+	echo.  linkcheck  to check all external links for integrity
  33
+	echo.  doctest    to run all doctests embedded in the documentation if enabled
  34
+	goto end
  35
+)
  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
+
  43
+if "%1" == "html" (
  44
+	%SPHINXBUILD% -b djangohtml %ALLSPHINXOPTS% %BUILDDIR%/html
  45
+	if errorlevel 1 exit /b 1
  46
+	echo.
  47
+	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
  48
+	goto end
  49
+)
  50
+
  51
+if "%1" == "dirhtml" (
  52
+	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
  53
+	if errorlevel 1 exit /b 1
  54
+	echo.
  55
+	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
  56
+	goto end
  57
+)
  58
+
  59
+if "%1" == "singlehtml" (
  60
+	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
  61
+	if errorlevel 1 exit /b 1
  62
+	echo.
  63
+	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
  64
+	goto end
  65
+)
  66
+
  67
+if "%1" == "pickle" (
  68
+	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
  69
+	if errorlevel 1 exit /b 1
  70
+	echo.
  71
+	echo.Build finished; now you can process the pickle files.
  72
+	goto end
  73
+)
  74
+
  75
+if "%1" == "json" (
  76
+	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
  77
+	if errorlevel 1 exit /b 1
  78
+	echo.
  79
+	echo.Build finished; now you can process the JSON files.
  80
+	goto end
  81
+)
  82
+
  83
+if "%1" == "htmlhelp" (
  84
+	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
  85
+	if errorlevel 1 exit /b 1
  86
+	echo.
  87
+	echo.Build finished; now you can run HTML Help Workshop with the ^
  88
+.hhp project file in %BUILDDIR%/htmlhelp.
  89
+	goto end
  90
+)
  91
+
  92
+if "%1" == "qthelp" (
  93
+	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
  94
+	if errorlevel 1 exit /b 1
  95
+	echo.
  96
+	echo.Build finished; now you can run "qcollectiongenerator" with the ^
  97
+.qhcp project file in %BUILDDIR%/qthelp, like this:
  98
+	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\django.qhcp
  99
+	echo.To view the help file:
  100
+	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\django.qhc
  101
+	goto end
  102
+)
  103
+
  104
+if "%1" == "devhelp" (
  105
+	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
  106
+	if errorlevel 1 exit /b 1
  107
+	echo.
  108
+	echo.Build finished.
  109
+	goto end
  110
+)
  111
+
  112
+if "%1" == "epub" (
  113
+	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
  114
+	if errorlevel 1 exit /b 1
  115
+	echo.
  116
+	echo.Build finished. The epub file is in %BUILDDIR%/epub.
  117
+	goto end
  118
+)
  119
+
  120
+if "%1" == "latex" (
  121
+	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
  122
+	if errorlevel 1 exit /b 1
  123
+	echo.
  124
+	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
  125
+	goto end
  126
+)
  127
+
  128
+if "%1" == "text" (
  129
+	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
  130
+	if errorlevel 1 exit /b 1
  131
+	echo.
  132
+	echo.Build finished. The text files are in %BUILDDIR%/text.
  133
+	goto end
  134
+)
  135
+
  136
+if "%1" == "man" (
  137
+	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
  138
+	if errorlevel 1 exit /b 1
  139
+	echo.
  140
+	echo.Build finished. The manual pages are in %BUILDDIR%/man.
  141
+	goto end
  142
+)
  143
+
  144
+if "%1" == "changes" (
  145
+	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
  146
+	if errorlevel 1 exit /b 1
  147
+	echo.
  148
+	echo.The overview file is in %BUILDDIR%/changes.
  149
+	goto end
  150
+)
  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
+
  161
+if "%1" == "doctest" (
  162
+	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
  163
+	if errorlevel 1 exit /b 1
  164
+	echo.
  165
+	echo.Testing of doctests in the sources finished, look at the ^
  166
+results in %BUILDDIR%/doctest/output.txt.
  167
+	goto end
  168
+)
  169
+
  170
+:end

0 notes on commit 8f7b502

Please sign in to comment.
Something went wrong with that request. Please try again.