blob: 64e307ee65430dd04f29652383327bd9ecb5c258 [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
Guido van Rossume6e2d9b2013-11-20 11:53:31 -080010developers guide (http://docs.python.org/devguide/documenting.html).
11There's also a chapter intended to point out differences to
Georg Brandl116aa622007-08-15 14:28:22 +000012those familiar with the previous docs written in LaTeX.
13
14
15Building the docs
16=================
17
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000018You need to have Python 2.4 or higher installed; the toolset used to build the
19docs is written in Python. It is called *Sphinx*, it is not included in this
20tree, but maintained separately. Also needed are the docutils, supplying the
21base markup that Sphinx uses, Jinja, a templating engine, and optionally
22Pygments, 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
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000050 To create the CHM file, you need to run the Microsoft HTML Help Workshop over
51 the generated project (.hhp) file.
Georg Brandl116aa622007-08-15 14:28:22 +000052
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000053 * "latex", which builds LaTeX source files as input to "pdflatex" to produce
54 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
Georg Brandl183fe812011-01-05 11:00:25 +000058 * "epub", which builds an EPUB document, suitable to be viewed on e-book
59 readers.
60
Christian Heimes292d3512008-02-03 16:51:08 +000061 * "linkcheck", which checks all external references to see whether they are
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000062 broken, redirected or malformed, and outputs this information to stdout as
63 well as a plain-text (.txt) file.
Christian Heimesd8654cf2007-12-02 15:22:16 +000064
Christian Heimes5b5e81c2007-12-31 16:14:33 +000065 * "changes", which builds an overview over all versionadded/versionchanged/
66 deprecated items in the current version. This is meant as a help for the
67 writer of the "What's New" document.
68
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000069 * "coverage", which builds a coverage overview for standard library modules and
70 C API.
Christian Heimesd3eb5a152008-02-24 00:38:49 +000071
Benjamin Petersond7c3ed52010-06-27 22:32:30 +000072 * "pydoc-topics", which builds a Python module containing a dictionary with
73 plain text documentation for the labels defined in
74 `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and
75 keyword help.
Georg Brandl6b38daa2008-06-01 21:05:17 +000076
Georg Brandl116aa622007-08-15 14:28:22 +000077A "make update" updates the Subversion checkouts in `tools/`.
78
79
80Without make
81------------
82
Georg Brandld94b4a72010-03-13 10:56:09 +000083You'll need to install the Sphinx package, either by checking it out via ::
Georg Brandl116aa622007-08-15 14:28:22 +000084
Georg Brandl6dc50f32011-01-15 16:45:03 +000085 svn co http://svn.python.org/projects/external/Sphinx-1.0.7/sphinx tools/sphinx
Georg Brandld94b4a72010-03-13 10:56:09 +000086
87or by installing it from PyPI.
Georg Brandl116aa622007-08-15 14:28:22 +000088
Benjamin Peterson92035012008-12-27 16:00:54 +000089Then, you need to install Docutils, either by checking it out via ::
Georg Brandl116aa622007-08-15 14:28:22 +000090
Georg Brandld94b4a72010-03-13 10:56:09 +000091 svn co http://svn.python.org/projects/external/docutils-0.6/docutils tools/docutils
Georg Brandl116aa622007-08-15 14:28:22 +000092
93or by installing it from http://docutils.sf.net/.
94
Georg Brandlb5b5bcc2009-04-27 16:29:51 +000095You also need Jinja2, either by checking it out via ::
96
Georg Brandld94b4a72010-03-13 10:56:09 +000097 svn co http://svn.python.org/projects/external/Jinja-2.3.1/jinja2 tools/jinja2
Georg Brandlb5b5bcc2009-04-27 16:29:51 +000098
99or by installing it from PyPI.
100
Benjamin Petersond7c3ed52010-06-27 22:32:30 +0000101You can optionally also install Pygments, either as a checkout via ::
Georg Brandl116aa622007-08-15 14:28:22 +0000102
Georg Brandld94b4a72010-03-13 10:56:09 +0000103 svn co http://svn.python.org/projects/external/Pygments-1.3.1/pygments tools/pygments
Georg Brandl116aa622007-08-15 14:28:22 +0000104
105or from PyPI at http://pypi.python.org/pypi/Pygments.
106
107
108Then, make an output directory, e.g. under `build/`, and run ::
109
110 python tools/sphinx-build.py -b<builder> . build/<outputdirectory>
111
Benjamin Peterson92035012008-12-27 16:00:54 +0000112where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see
113the make targets above).
Georg Brandl116aa622007-08-15 14:28:22 +0000114
115
116Contributing
117============
118
Benjamin Peterson92035012008-12-27 16:00:54 +0000119Bugs in the content should be reported to the Python bug tracker at
120http://bugs.python.org.
Georg Brandl116aa622007-08-15 14:28:22 +0000121
Benjamin Peterson92035012008-12-27 16:00:54 +0000122Bugs in the toolset should be reported in the Sphinx bug tracker at
123http://www.bitbucket.org/birkenfeld/sphinx/issues/.
Georg Brandl116aa622007-08-15 14:28:22 +0000124
125You can also send a mail to the Python Documentation Team at docs@python.org,
126and we will process your request as soon as possible.
127
128If you want to help the Documentation Team, you are always welcome. Just send
129a mail to docs@python.org.
130
131
132Copyright notice
133================
134
135The Python source is copyrighted, but you can freely use and copy it
136as long as you don't change or remove the copyright notice:
137
138----------------------------------------------------------------------
Benjamin Petersona63eced2012-12-31 21:44:00 -0600139Copyright (c) 2000-2013 Python Software Foundation.
Georg Brandl116aa622007-08-15 14:28:22 +0000140All rights reserved.
141
142Copyright (c) 2000 BeOpen.com.
143All rights reserved.
144
145Copyright (c) 1995-2000 Corporation for National Research Initiatives.
146All rights reserved.
147
148Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
149All rights reserved.
150
151See the file "license.rst" for information on usage and redistribution
152of this file, and for a DISCLAIMER OF ALL WARRANTIES.
153----------------------------------------------------------------------