blob: 7a561c0d84d620f8bd3afe95e048d76480521eb4 [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
Georg Brandlc62efa82010-07-11 10:41:07 +000017You need to have Python 2.4 or higher installed; the toolset used to build the
18docs is written in Python. It is called *Sphinx*, it is not included in this
19tree, but maintained separately. Also needed are the docutils, supplying the
20base markup that Sphinx uses, Jinja, a templating engine, and optionally
21Pygments, a code highlighter.
Georg Brandl116aa622007-08-15 14:28:22 +000022
23
24Using make
25----------
26
27Luckily, a Makefile has been prepared so that on Unix, provided you have
28installed Python and Subversion, you can just run ::
29
30 make html
31
32to check out the necessary toolset in the `tools/` subdirectory and build the
33HTML output files. To view the generated HTML, point your favorite browser at
34the top-level index `build/html/index.html` after running "make".
35
Georg Brandl716c3ac2007-08-30 18:34:23 +000036To use a Python interpreter that's not called ``python``, use the standard
37way to set Makefile variables, using e.g. ::
38
39 make html PYTHON=/usr/bin/python2.5
40
Georg Brandl116aa622007-08-15 14:28:22 +000041Available make targets are:
42
43 * "html", which builds standalone HTML files for offline viewing.
44
Georg Brandl116aa622007-08-15 14:28:22 +000045 * "htmlhelp", which builds HTML files and a HTML Help project file usable to
46 convert them into a single Compiled HTML (.chm) file -- these are popular
47 under Microsoft Windows, but very handy on every platform.
48
Georg Brandlc62efa82010-07-11 10:41:07 +000049 To create the CHM file, you need to run the Microsoft HTML Help Workshop over
50 the generated project (.hhp) file.
Georg Brandl116aa622007-08-15 14:28:22 +000051
Georg Brandlc62efa82010-07-11 10:41:07 +000052 * "latex", which builds LaTeX source files as input to "pdflatex" to produce
53 PDF documents.
Christian Heimes3feef612008-02-11 06:19:17 +000054
Georg Brandl0c77a822008-06-10 16:37:50 +000055 * "text", which builds a plain text file for each source file.
56
Christian Heimes292d3512008-02-03 16:51:08 +000057 * "linkcheck", which checks all external references to see whether they are
Georg Brandlc62efa82010-07-11 10:41:07 +000058 broken, redirected or malformed, and outputs this information to stdout as
59 well as a plain-text (.txt) file.
Christian Heimesd8654cf2007-12-02 15:22:16 +000060
Christian Heimes5b5e81c2007-12-31 16:14:33 +000061 * "changes", which builds an overview over all versionadded/versionchanged/
62 deprecated items in the current version. This is meant as a help for the
63 writer of the "What's New" document.
64
Georg Brandlc62efa82010-07-11 10:41:07 +000065 * "coverage", which builds a coverage overview for standard library modules and
66 C API.
Christian Heimesd3eb5a152008-02-24 00:38:49 +000067
Georg Brandlc62efa82010-07-11 10:41:07 +000068 * "pydoc-topics", which builds a Python module containing a dictionary with
69 plain text documentation for the labels defined in
70 `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and
71 keyword help.
Georg Brandl6b38daa2008-06-01 21:05:17 +000072
Georg Brandl116aa622007-08-15 14:28:22 +000073A "make update" updates the Subversion checkouts in `tools/`.
74
75
76Without make
77------------
78
Georg Brandl0c812842010-03-13 10:57:09 +000079You'll need to install the Sphinx package, either by checking it out via ::
Georg Brandl116aa622007-08-15 14:28:22 +000080
Georg Brandl0c812842010-03-13 10:57:09 +000081 svn co http://svn.python.org/projects/external/Sphinx-0.6.5/sphinx tools/sphinx
82
83or by installing it from PyPI.
Georg Brandl116aa622007-08-15 14:28:22 +000084
Benjamin Peterson92035012008-12-27 16:00:54 +000085Then, you need to install Docutils, either by checking it out via ::
Georg Brandl116aa622007-08-15 14:28:22 +000086
Georg Brandl0c812842010-03-13 10:57:09 +000087 svn co http://svn.python.org/projects/external/docutils-0.6/docutils tools/docutils
Georg Brandl116aa622007-08-15 14:28:22 +000088
89or by installing it from http://docutils.sf.net/.
90
Georg Brandlb5b5bcc2009-04-27 16:29:51 +000091You also need Jinja2, either by checking it out via ::
92
Georg Brandl0c812842010-03-13 10:57:09 +000093 svn co http://svn.python.org/projects/external/Jinja-2.3.1/jinja2 tools/jinja2
Georg Brandlb5b5bcc2009-04-27 16:29:51 +000094
95or by installing it from PyPI.
96
Georg Brandlc62efa82010-07-11 10:41:07 +000097You can optionally also install Pygments, either as a checkout via ::
Georg Brandl116aa622007-08-15 14:28:22 +000098
Georg Brandl0c812842010-03-13 10:57:09 +000099 svn co http://svn.python.org/projects/external/Pygments-1.3.1/pygments tools/pygments
Georg Brandl116aa622007-08-15 14:28:22 +0000100
101or from PyPI at http://pypi.python.org/pypi/Pygments.
102
103
104Then, make an output directory, e.g. under `build/`, and run ::
105
106 python tools/sphinx-build.py -b<builder> . build/<outputdirectory>
107
Benjamin Peterson92035012008-12-27 16:00:54 +0000108where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see
109the make targets above).
Georg Brandl116aa622007-08-15 14:28:22 +0000110
111
112Contributing
113============
114
Benjamin Peterson92035012008-12-27 16:00:54 +0000115Bugs in the content should be reported to the Python bug tracker at
116http://bugs.python.org.
Georg Brandl116aa622007-08-15 14:28:22 +0000117
Benjamin Peterson92035012008-12-27 16:00:54 +0000118Bugs in the toolset should be reported in the Sphinx bug tracker at
119http://www.bitbucket.org/birkenfeld/sphinx/issues/.
Georg Brandl116aa622007-08-15 14:28:22 +0000120
121You can also send a mail to the Python Documentation Team at docs@python.org,
122and we will process your request as soon as possible.
123
124If you want to help the Documentation Team, you are always welcome. Just send
125a mail to docs@python.org.
126
127
128Copyright notice
129================
130
131The Python source is copyrighted, but you can freely use and copy it
132as long as you don't change or remove the copyright notice:
133
134----------------------------------------------------------------------
Barry Warsaw659fc422008-03-01 17:45:23 +0000135Copyright (c) 2000-2008 Python Software Foundation.
Georg Brandl116aa622007-08-15 14:28:22 +0000136All rights reserved.
137
138Copyright (c) 2000 BeOpen.com.
139All rights reserved.
140
141Copyright (c) 1995-2000 Corporation for National Research Initiatives.
142All rights reserved.
143
144Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
145All rights reserved.
146
147See the file "license.rst" for information on usage and redistribution
148of this file, and for a DISCLAIMER OF ALL WARRANTIES.
149----------------------------------------------------------------------