blob: 19cf26bbd790cbbfaba49ecc6f3f0db8314db4dc [file] [log] [blame]
Benjamin Petersond7c3ed52010-06-27 22:32:30 +00001Building the documentation
2==========================
3
4You need to have Python 2.4 or higher installed; the toolset used to build the
5docs is written in Python. It is called *Sphinx*, it is not included in this
6tree, but maintained separately. Also needed are the docutils, supplying the
7base markup that Sphinx uses, Jinja, a templating engine, and optionally
8Pygments, a code highlighter.
9
10
11Using make
12----------
13
14Luckily, a Makefile has been prepared so that on Unix, provided you have
15installed Python and Subversion, you can just run ::
16
17 make html
18
Senthil Kumaran916bd382010-10-15 12:55:19 +000019to check out the necessary toolset in the :file:`tools/` subdirectory and build
20the HTML output files. To view the generated HTML, point your favorite browser
21at the top-level index :file:`build/html/index.html` after running "make".
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000022
23Available make targets are:
24
25 * "html", which builds standalone HTML files for offline viewing.
26
27 * "htmlhelp", which builds HTML files and a HTML Help project file usable to
28 convert them into a single Compiled HTML (.chm) file -- these are popular
29 under Microsoft Windows, but very handy on every platform.
30
31 To create the CHM file, you need to run the Microsoft HTML Help Workshop
32 over the generated project (.hhp) file.
33
34 * "latex", which builds LaTeX source files as input to "pdflatex" to produce
35 PDF documents.
36
37 * "text", which builds a plain text file for each source file.
38
39 * "linkcheck", which checks all external references to see whether they are
40 broken, redirected or malformed, and outputs this information to stdout
41 as well as a plain-text (.txt) file.
42
43 * "changes", which builds an overview over all versionadded/versionchanged/
44 deprecated items in the current version. This is meant as a help for the
45 writer of the "What's New" document.
46
47 * "coverage", which builds a coverage overview for standard library modules
48 and C API.
49
50 * "pydoc-topics", which builds a Python module containing a dictionary with
51 plain text documentation for the labels defined in
Senthil Kumaran916bd382010-10-15 12:55:19 +000052 :file:`tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000053 keyword help.
54
Senthil Kumaran916bd382010-10-15 12:55:19 +000055A "make update" updates the Subversion checkouts in :file:`tools/`.
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000056
57
58Without make
59------------
60
61You'll need to install the Sphinx package, either by checking it out via ::
62
63 svn co http://svn.python.org/projects/external/Sphinx-0.6.5/sphinx tools/sphinx
64
65or by installing it from PyPI.
66
67Then, you need to install Docutils, either by checking it out via ::
68
69 svn co http://svn.python.org/projects/external/docutils-0.6/docutils tools/docutils
70
71or by installing it from http://docutils.sf.net/.
72
73You also need Jinja2, either by checking it out via ::
74
75 svn co http://svn.python.org/projects/external/Jinja-2.3.1/jinja2 tools/jinja2
76
77or by installing it from PyPI.
78
79You can optionally also install Pygments, either as a checkout via ::
80
81 svn co http://svn.python.org/projects/external/Pygments-1.3.1/pygments tools/pygments
82
83or from PyPI at http://pypi.python.org/pypi/Pygments.
84
85
86Then, make an output directory, e.g. under `build/`, and run ::
87
88 python tools/sphinx-build.py -b<builder> . build/<outputdirectory>
89
90where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see
91the make targets above).