blob: 9db4f4ca3868ffa9636f6571c23416aeda1cefa5 [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 Brandl716c3ac2007-08-30 18:34:23 +000017You need to install Python 2.5.1 or higher (but Python 3.0 is not supported yet);
18the 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
46 * "web", which builds files usable with the Sphinx.web application (used to
47 serve the docs online at http://docs.python.org/).
48
49 * "htmlhelp", which builds HTML files and a HTML Help project file usable to
50 convert them into a single Compiled HTML (.chm) file -- these are popular
51 under Microsoft Windows, but very handy on every platform.
52
53 To create the CHM file, you need to run the Microsoft HTML Help Workshop
54 over the generated project (.hhp) file.
55
Christian Heimesd8654cf2007-12-02 15:22:16 +000056 * "latex", which builds LaTeX source files that can be run with "pdflatex"
57 to produce PDF documents.
58
Georg Brandl116aa622007-08-15 14:28:22 +000059A "make update" updates the Subversion checkouts in `tools/`.
60
61
62Without make
63------------
64
65You'll need to checkout the Sphinx package to the `tools/` directory::
66
67 svn co http://svn.python.org/projects/doctools/trunk/sphinx tools/sphinx
68
69Then, you need to install Docutils 0.4 (the SVN snapshot won't work), either
70by checking it out via ::
71
72 svn co http://svn.python.org/projects/external/docutils-0.4/docutils tools/docutils
73
74or by installing it from http://docutils.sf.net/.
75
76You can optionally also install Pygments, either as a checkout via ::
77
Georg Brandl9afde1c2007-11-01 20:32:30 +000078 svn co http://svn.python.org/projects/external/Pygments-0.9/pygments tools/pygments
Georg Brandl116aa622007-08-15 14:28:22 +000079
80or from PyPI at http://pypi.python.org/pypi/Pygments.
81
82
83Then, make an output directory, e.g. under `build/`, and run ::
84
85 python tools/sphinx-build.py -b<builder> . build/<outputdirectory>
86
87where `<builder>` is one of html, web or htmlhelp (for explanations see the make
88targets above).
89
90
91Contributing
92============
93
94For bugs in the content, the online version at http://docs.python.org/ has a
95"suggest change" facility that can be used to correct errors in the source text
96and submit them as a patch to the maintainers.
97
98Bugs in the toolset should be reported in the Python bug tracker at
99http://bugs.python.org/.
100
101You can also send a mail to the Python Documentation Team at docs@python.org,
102and we will process your request as soon as possible.
103
104If you want to help the Documentation Team, you are always welcome. Just send
105a mail to docs@python.org.
106
107
108Copyright notice
109================
110
111The Python source is copyrighted, but you can freely use and copy it
112as long as you don't change or remove the copyright notice:
113
114----------------------------------------------------------------------
115Copyright (c) 2000-2007 Python Software Foundation.
116All rights reserved.
117
118Copyright (c) 2000 BeOpen.com.
119All rights reserved.
120
121Copyright (c) 1995-2000 Corporation for National Research Initiatives.
122All rights reserved.
123
124Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
125All rights reserved.
126
127See the file "license.rst" for information on usage and redistribution
128of this file, and for a DISCLAIMER OF ALL WARRANTIES.
129----------------------------------------------------------------------