blob: dc1c6a0d9a1ceaa592e6046f2761bf3434aa37f5 [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
Éric Araujo98e68ad2011-06-03 19:25:58 +020017 cd Doc
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000018 make html
19
Senthil Kumaran916bd382010-10-15 12:55:19 +000020to check out the necessary toolset in the :file:`tools/` subdirectory and build
21the HTML output files. To view the generated HTML, point your favorite browser
22at the top-level index :file:`build/html/index.html` after running "make".
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000023
24Available make targets are:
25
26 * "html", which builds standalone HTML files for offline viewing.
27
28 * "htmlhelp", which builds HTML files and a HTML Help project file usable to
29 convert them into a single Compiled HTML (.chm) file -- these are popular
30 under Microsoft Windows, but very handy on every platform.
31
32 To create the CHM file, you need to run the Microsoft HTML Help Workshop
33 over the generated project (.hhp) file.
34
35 * "latex", which builds LaTeX source files as input to "pdflatex" to produce
36 PDF documents.
37
38 * "text", which builds a plain text file for each source file.
39
40 * "linkcheck", which checks all external references to see whether they are
41 broken, redirected or malformed, and outputs this information to stdout
42 as well as a plain-text (.txt) file.
43
44 * "changes", which builds an overview over all versionadded/versionchanged/
45 deprecated items in the current version. This is meant as a help for the
46 writer of the "What's New" document.
47
48 * "coverage", which builds a coverage overview for standard library modules
49 and C API.
50
51 * "pydoc-topics", which builds a Python module containing a dictionary with
52 plain text documentation for the labels defined in
Senthil Kumaran916bd382010-10-15 12:55:19 +000053 :file:`tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000054 keyword help.
55
Senthil Kumaran916bd382010-10-15 12:55:19 +000056A "make update" updates the Subversion checkouts in :file:`tools/`.
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000057
58
59Without make
60------------
61
62You'll need to install the Sphinx package, either by checking it out via ::
63
64 svn co http://svn.python.org/projects/external/Sphinx-0.6.5/sphinx tools/sphinx
65
66or by installing it from PyPI.
67
68Then, you need to install Docutils, either by checking it out via ::
69
70 svn co http://svn.python.org/projects/external/docutils-0.6/docutils tools/docutils
71
72or by installing it from http://docutils.sf.net/.
73
74You also need Jinja2, either by checking it out via ::
75
76 svn co http://svn.python.org/projects/external/Jinja-2.3.1/jinja2 tools/jinja2
77
78or by installing it from PyPI.
79
80You can optionally also install Pygments, either as a checkout via ::
81
82 svn co http://svn.python.org/projects/external/Pygments-1.3.1/pygments tools/pygments
83
84or from PyPI at http://pypi.python.org/pypi/Pygments.
85
86
87Then, make an output directory, e.g. under `build/`, and run ::
88
89 python tools/sphinx-build.py -b<builder> . build/<outputdirectory>
90
91where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see
92the make targets above).