blob: 7ef31cffbcee93d95181b09680e55601a8d53bcd [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001Python Documentation README
2~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
4This directory contains the reStructuredText (reST) sources to the Python
5documentation. You don't need to build them yourself, prebuilt versions are
6available at http://docs.python.org/download/.
7
8Documentation on the authoring Python documentation, including information about
9both style and markup, is available in the "Documenting Python" chapter of the
10documentation. There's also a chapter intended to point out differences to
11those familiar with the previous docs written in LaTeX.
12
13
14Building the docs
15=================
16
Christian Heimes3feef612008-02-11 06:19:17 +000017You need to install Python 2.4 or higher (but Python 3.0 is not supported yet);
Georg Brandl716c3ac2007-08-30 18:34:23 +000018the toolset used to build the docs are written in Python. The toolset used
19to build the documentation is called *Sphinx*, it is not included in this
20tree, but maintained separately in the Python Subversion repository. Also
21needed are Jinja, a templating engine (included in Sphinx as a Subversion
22external), and optionally Pygments, a code highlighter.
Georg Brandl116aa622007-08-15 14:28:22 +000023
24
25Using make
26----------
27
28Luckily, a Makefile has been prepared so that on Unix, provided you have
29installed Python and Subversion, you can just run ::
30
31 make html
32
33to check out the necessary toolset in the `tools/` subdirectory and build the
34HTML output files. To view the generated HTML, point your favorite browser at
35the top-level index `build/html/index.html` after running "make".
36
Georg Brandl716c3ac2007-08-30 18:34:23 +000037To use a Python interpreter that's not called ``python``, use the standard
38way to set Makefile variables, using e.g. ::
39
40 make html PYTHON=/usr/bin/python2.5
41
Georg Brandl116aa622007-08-15 14:28:22 +000042Available make targets are:
43
44 * "html", which builds standalone HTML files for offline viewing.
45
Georg Brandl116aa622007-08-15 14:28:22 +000046 * "htmlhelp", which builds HTML files and a HTML Help project file usable to
47 convert them into a single Compiled HTML (.chm) file -- these are popular
48 under Microsoft Windows, but very handy on every platform.
49
50 To create the CHM file, you need to run the Microsoft HTML Help Workshop
51 over the generated project (.hhp) file.
52
Christian Heimesd8654cf2007-12-02 15:22:16 +000053 * "latex", which builds LaTeX source files that can be run with "pdflatex"
54 to produce PDF documents.
Christian Heimes3feef612008-02-11 06:19:17 +000055
Georg Brandl0c77a822008-06-10 16:37:50 +000056 * "text", which builds a plain text file for each source file.
57
Christian Heimes292d3512008-02-03 16:51:08 +000058 * "linkcheck", which checks all external references to see whether they are
59 broken, redirected or malformed, and outputs this information to stdout
60 as well as a plain-text (.txt) file.
Christian Heimesd8654cf2007-12-02 15:22:16 +000061
Christian Heimes5b5e81c2007-12-31 16:14:33 +000062 * "changes", which builds an overview over all versionadded/versionchanged/
63 deprecated items in the current version. This is meant as a help for the
64 writer of the "What's New" document.
65
Christian Heimesd3eb5a152008-02-24 00:38:49 +000066 * "coverage", which builds a coverage overview for standard library modules
67 and C API.
68
Georg Brandl6b38daa2008-06-01 21:05:17 +000069 * "pydoc-topics", which builds a Python module containing a dictionary
70 with plain text documentation for the labels defined in
71 `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic
72 and keyword help.
73
Georg Brandl116aa622007-08-15 14:28:22 +000074A "make update" updates the Subversion checkouts in `tools/`.
75
76
77Without make
78------------
79
Georg Brandld94b4a72010-03-13 10:56:09 +000080You'll need to install the Sphinx package, either by checking it out via ::
Georg Brandl116aa622007-08-15 14:28:22 +000081
Georg Brandld94b4a72010-03-13 10:56:09 +000082 svn co http://svn.python.org/projects/external/Sphinx-0.6.5/sphinx tools/sphinx
83
84or by installing it from PyPI.
Georg Brandl116aa622007-08-15 14:28:22 +000085
Benjamin Peterson92035012008-12-27 16:00:54 +000086Then, you need to install Docutils, either by checking it out via ::
Georg Brandl116aa622007-08-15 14:28:22 +000087
Georg Brandld94b4a72010-03-13 10:56:09 +000088 svn co http://svn.python.org/projects/external/docutils-0.6/docutils tools/docutils
Georg Brandl116aa622007-08-15 14:28:22 +000089
90or by installing it from http://docutils.sf.net/.
91
Georg Brandlb5b5bcc2009-04-27 16:29:51 +000092You also need Jinja2, either by checking it out via ::
93
Georg Brandld94b4a72010-03-13 10:56:09 +000094 svn co http://svn.python.org/projects/external/Jinja-2.3.1/jinja2 tools/jinja2
Georg Brandlb5b5bcc2009-04-27 16:29:51 +000095
96or by installing it from PyPI.
97
Georg Brandl116aa622007-08-15 14:28:22 +000098You can optionally also install Pygments, either as a checkout via ::
99
Georg Brandld94b4a72010-03-13 10:56:09 +0000100 svn co http://svn.python.org/projects/external/Pygments-1.3.1/pygments tools/pygments
Georg Brandl116aa622007-08-15 14:28:22 +0000101
102or from PyPI at http://pypi.python.org/pypi/Pygments.
103
104
105Then, make an output directory, e.g. under `build/`, and run ::
106
107 python tools/sphinx-build.py -b<builder> . build/<outputdirectory>
108
Benjamin Peterson92035012008-12-27 16:00:54 +0000109where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see
110the make targets above).
Georg Brandl116aa622007-08-15 14:28:22 +0000111
112
113Contributing
114============
115
Benjamin Peterson92035012008-12-27 16:00:54 +0000116Bugs in the content should be reported to the Python bug tracker at
117http://bugs.python.org.
Georg Brandl116aa622007-08-15 14:28:22 +0000118
Benjamin Peterson92035012008-12-27 16:00:54 +0000119Bugs in the toolset should be reported in the Sphinx bug tracker at
120http://www.bitbucket.org/birkenfeld/sphinx/issues/.
Georg Brandl116aa622007-08-15 14:28:22 +0000121
122You can also send a mail to the Python Documentation Team at docs@python.org,
123and we will process your request as soon as possible.
124
125If you want to help the Documentation Team, you are always welcome. Just send
126a mail to docs@python.org.
127
128
129Copyright notice
130================
131
132The Python source is copyrighted, but you can freely use and copy it
133as long as you don't change or remove the copyright notice:
134
135----------------------------------------------------------------------
Barry Warsaw659fc422008-03-01 17:45:23 +0000136Copyright (c) 2000-2008 Python Software Foundation.
Georg Brandl116aa622007-08-15 14:28:22 +0000137All rights reserved.
138
139Copyright (c) 2000 BeOpen.com.
140All rights reserved.
141
142Copyright (c) 1995-2000 Corporation for National Research Initiatives.
143All rights reserved.
144
145Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
146All rights reserved.
147
148See the file "license.rst" for information on usage and redistribution
149of this file, and for a DISCLAIMER OF ALL WARRANTIES.
150----------------------------------------------------------------------