blob: f03da7628b2365f3bae79888cf9d4c7733763143 [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +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 Brandlf084aed2010-06-12 09:46:03 +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 Brandl8ec7f652007-08-15 14:28:01 +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
36Available make targets are:
37
38 * "html", which builds standalone HTML files for offline viewing.
39
Georg Brandl8ec7f652007-08-15 14:28:01 +000040 * "htmlhelp", which builds HTML files and a HTML Help project file usable to
41 convert them into a single Compiled HTML (.chm) file -- these are popular
42 under Microsoft Windows, but very handy on every platform.
43
Georg Brandlf084aed2010-06-12 09:46:03 +000044 To create the CHM file, you need to run the Microsoft HTML Help Workshop over
45 the generated project (.hhp) file.
Georg Brandl8ec7f652007-08-15 14:28:01 +000046
Georg Brandlf084aed2010-06-12 09:46:03 +000047 * "latex", which builds LaTeX source files as input to "pdflatex" to produce
48 PDF documents.
Georg Brandl14a1b8c2008-02-09 23:09:25 +000049
Georg Brandl4f2c9982008-06-01 16:41:31 +000050 * "text", which builds a plain text file for each source file.
51
Georg Brandlcd235272008-02-01 15:50:15 +000052 * "linkcheck", which checks all external references to see whether they are
Georg Brandlf084aed2010-06-12 09:46:03 +000053 broken, redirected or malformed, and outputs this information to stdout as
54 well as a plain-text (.txt) file.
Georg Brandl584265b2007-12-02 14:58:50 +000055
Georg Brandlb19be572007-12-29 10:57:00 +000056 * "changes", which builds an overview over all versionadded/versionchanged/
57 deprecated items in the current version. This is meant as a help for the
58 writer of the "What's New" document.
59
Georg Brandlf084aed2010-06-12 09:46:03 +000060 * "coverage", which builds a coverage overview for standard library modules and
61 C API.
Georg Brandl17048282008-02-23 18:47:04 +000062
Georg Brandlf084aed2010-06-12 09:46:03 +000063 * "pydoc-topics", which builds a Python module containing a dictionary with
64 plain text documentation for the labels defined in
65 `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and
66 keyword help.
Georg Brandl681001e2008-06-01 20:33:55 +000067
Georg Brandl8ec7f652007-08-15 14:28:01 +000068A "make update" updates the Subversion checkouts in `tools/`.
69
70
71Without make
72------------
73
Georg Brandlfce7b862010-03-13 10:54:12 +000074You'll need to install the Sphinx package, either by checking it out via ::
Georg Brandl8ec7f652007-08-15 14:28:01 +000075
Georg Brandl4263ad82010-10-29 05:41:25 +000076 svn co http://svn.python.org/projects/external/Sphinx-0.6.7/sphinx tools/sphinx
Georg Brandlfce7b862010-03-13 10:54:12 +000077
78or by installing it from PyPI.
Georg Brandl8ec7f652007-08-15 14:28:01 +000079
Benjamin Peterson2c85ed52008-12-21 01:12:26 +000080Then, you need to install Docutils, either by checking it out via ::
Georg Brandl8ec7f652007-08-15 14:28:01 +000081
Georg Brandlfce7b862010-03-13 10:54:12 +000082 svn co http://svn.python.org/projects/external/docutils-0.6/docutils tools/docutils
Georg Brandl8ec7f652007-08-15 14:28:01 +000083
84or by installing it from http://docutils.sf.net/.
85
Georg Brandldbc5b4b2009-04-26 06:05:18 +000086You also need Jinja2, either by checking it out via ::
87
Georg Brandlfce7b862010-03-13 10:54:12 +000088 svn co http://svn.python.org/projects/external/Jinja-2.3.1/jinja2 tools/jinja2
Georg Brandldbc5b4b2009-04-26 06:05:18 +000089
90or by installing it from PyPI.
91
Georg Brandlf084aed2010-06-12 09:46:03 +000092You can optionally also install Pygments, either as a checkout via ::
Georg Brandl8ec7f652007-08-15 14:28:01 +000093
Georg Brandlfce7b862010-03-13 10:54:12 +000094 svn co http://svn.python.org/projects/external/Pygments-1.3.1/pygments tools/pygments
Georg Brandl8ec7f652007-08-15 14:28:01 +000095
96or from PyPI at http://pypi.python.org/pypi/Pygments.
97
98
99Then, make an output directory, e.g. under `build/`, and run ::
100
101 python tools/sphinx-build.py -b<builder> . build/<outputdirectory>
102
Benjamin Peterson5c29dd42008-12-21 01:04:32 +0000103where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see
104the make targets above).
Georg Brandl8ec7f652007-08-15 14:28:01 +0000105
106
107Contributing
108============
109
Benjamin Peterson2c85ed52008-12-21 01:12:26 +0000110Bugs in the content should be reported to the Python bug tracker at
111http://bugs.python.org.
Georg Brandl8ec7f652007-08-15 14:28:01 +0000112
Benjamin Peterson2c85ed52008-12-21 01:12:26 +0000113Bugs in the toolset should be reported in the Sphinx bug tracker at
114http://www.bitbucket.org/birkenfeld/sphinx/issues/.
Georg Brandl8ec7f652007-08-15 14:28:01 +0000115
116You can also send a mail to the Python Documentation Team at docs@python.org,
117and we will process your request as soon as possible.
118
119If you want to help the Documentation Team, you are always welcome. Just send
120a mail to docs@python.org.
121
122
123Copyright notice
124================
125
126The Python source is copyrighted, but you can freely use and copy it
127as long as you don't change or remove the copyright notice:
128
129----------------------------------------------------------------------
Benjamin Peterson5f8d6062011-12-31 22:42:26 -0600130Copyright (c) 2000-2012 Python Software Foundation.
Georg Brandl8ec7f652007-08-15 14:28:01 +0000131All rights reserved.
132
133Copyright (c) 2000 BeOpen.com.
134All rights reserved.
135
136Copyright (c) 1995-2000 Corporation for National Research Initiatives.
137All rights reserved.
138
139Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
140All rights reserved.
141
142See the file "license.rst" for information on usage and redistribution
143of this file, and for a DISCLAIMER OF ALL WARRANTIES.
144----------------------------------------------------------------------