blob: 004c6e1fe63abef320722620edf8f7a1405b8b09 [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
Benjamin Peterson423f1282014-09-04 23:07:03 -04006available at <https://docs.python.org/dev/download.html>.
Georg Brandl8ec7f652007-08-15 14:28:01 +00007
Benjamin Peterson423f1282014-09-04 23:07:03 -04008Documentation on authoring Python documentation, including information about
Georg Brandl8ec7f652007-08-15 14:28:01 +00009both style and markup, is available in the "Documenting Python" chapter of the
Georg Brandl23dd65b2014-10-29 08:18:43 +010010developers guide <https://docs.python.org/devguide/documenting.html>.
Georg Brandl8ec7f652007-08-15 14:28:01 +000011
12
13Building the docs
14=================
15
Benjamin Peterson423f1282014-09-04 23:07:03 -040016You need to have Sphinx <http://sphinx-doc.org/> installed; it is the toolset
17used to build the docs. It is not included in this tree, but maintained
Georg Brandl23dd65b2014-10-29 08:18:43 +010018separately and available from PyPI <https://pypi.python.org/pypi/Sphinx>.
Georg Brandl8ec7f652007-08-15 14:28:01 +000019
20
21Using make
22----------
23
Benjamin Peterson423f1282014-09-04 23:07:03 -040024A Makefile has been prepared so that on Unix, provided you have installed
25Sphinx, you can just run ::
Georg Brandl8ec7f652007-08-15 14:28:01 +000026
27 make html
28
Benjamin Peterson423f1282014-09-04 23:07:03 -040029to build the HTML output files.
Georg Brandl8ec7f652007-08-15 14:28:01 +000030
Georg Brandl418b1ea2014-03-10 19:26:57 +010031On Windows, we try to emulate the Makefile as closely as possible with a
32``make.bat`` file.
33
Benjamin Peterson423f1282014-09-04 23:07:03 -040034To use a Python interpreter that's not called ``python``, use the standard
35way to set Makefile variables, using e.g. ::
36
37 make html PYTHON=python3
38
39On Windows, set the PYTHON environment variable instead.
40
41To use a specific sphinx-build (something other than ``sphinx-build``), set
42the SPHINXBUILD variable.
43
Georg Brandl8ec7f652007-08-15 14:28:01 +000044Available make targets are:
45
Georg Brandl23dd65b2014-10-29 08:18:43 +010046* "clean", which removes all build files.
Benjamin Peterson423f1282014-09-04 23:07:03 -040047
Georg Brandl23dd65b2014-10-29 08:18:43 +010048* "html", which builds standalone HTML files for offline viewing.
Georg Brandl8ec7f652007-08-15 14:28:01 +000049
Georg Brandl23dd65b2014-10-29 08:18:43 +010050* "htmlview", which re-uses the "html" builder, but then opens the main page
51 in your default web browser.
Benjamin Peterson423f1282014-09-04 23:07:03 -040052
Georg Brandl23dd65b2014-10-29 08:18:43 +010053* "htmlhelp", which builds HTML files and a HTML Help project file usable to
54 convert them into a single Compiled HTML (.chm) file -- these are popular
55 under Microsoft Windows, but very handy on every platform.
Georg Brandl8ec7f652007-08-15 14:28:01 +000056
Georg Brandl23dd65b2014-10-29 08:18:43 +010057 To create the CHM file, you need to run the Microsoft HTML Help Workshop
58 over the generated project (.hhp) file. The make.bat script does this for
59 you on Windows.
Georg Brandl8ec7f652007-08-15 14:28:01 +000060
Georg Brandl23dd65b2014-10-29 08:18:43 +010061* "latex", which builds LaTeX source files as input to "pdflatex" to produce
62 PDF documents.
Georg Brandl14a1b8c2008-02-09 23:09:25 +000063
Georg Brandl23dd65b2014-10-29 08:18:43 +010064* "text", which builds a plain text file for each source file.
Georg Brandl4f2c9982008-06-01 16:41:31 +000065
Georg Brandl23dd65b2014-10-29 08:18:43 +010066* "epub", which builds an EPUB document, suitable to be viewed on e-book
67 readers.
Benjamin Peterson423f1282014-09-04 23:07:03 -040068
Georg Brandl23dd65b2014-10-29 08:18:43 +010069* "linkcheck", which checks all external references to see whether they are
70 broken, redirected or malformed, and outputs this information to stdout as
71 well as a plain-text (.txt) file.
Georg Brandl584265b2007-12-02 14:58:50 +000072
Georg Brandl23dd65b2014-10-29 08:18:43 +010073* "changes", which builds an overview over all versionadded/versionchanged/
74 deprecated items in the current version. This is meant as a help for the
75 writer of the "What's New" document.
Georg Brandlb19be572007-12-29 10:57:00 +000076
Georg Brandl23dd65b2014-10-29 08:18:43 +010077* "coverage", which builds a coverage overview for standard library modules and
78 C API.
Georg Brandl17048282008-02-23 18:47:04 +000079
Georg Brandl23dd65b2014-10-29 08:18:43 +010080* "pydoc-topics", which builds a Python module containing a dictionary with
81 plain text documentation for the labels defined in
82 `tools/pyspecific.py` -- pydoc needs these to show topic and keyword help.
Georg Brandl681001e2008-06-01 20:33:55 +000083
Georg Brandl23dd65b2014-10-29 08:18:43 +010084* "suspicious", which checks the parsed markup for text that looks like
85 malformed and thus unconverted reST.
Georg Brandl418b1ea2014-03-10 19:26:57 +010086
Georg Brandl23dd65b2014-10-29 08:18:43 +010087* "check", which checks for frequent markup errors.
Benjamin Peterson423f1282014-09-04 23:07:03 -040088
Georg Brandl23dd65b2014-10-29 08:18:43 +010089* "serve", which serves the build/html directory on port 8000.
Benjamin Peterson423f1282014-09-04 23:07:03 -040090
Georg Brandl23dd65b2014-10-29 08:18:43 +010091* "dist", (Unix only) which creates distributable archives of HTML, text,
92 PDF, and EPUB builds.
Georg Brandl8ec7f652007-08-15 14:28:01 +000093
94
95Without make
96------------
97
Georg Brandl418b1ea2014-03-10 19:26:57 +010098Install the Sphinx package and its dependencies from PyPI.
Georg Brandl8ec7f652007-08-15 14:28:01 +000099
Benjamin Peterson423f1282014-09-04 23:07:03 -0400100Then, from the ``Doc`` directory, run ::
Georg Brandlfce7b862010-03-13 10:54:12 +0000101
Georg Brandl418b1ea2014-03-10 19:26:57 +0100102 sphinx-build -b<builder> . build/<builder>
Georg Brandl8ec7f652007-08-15 14:28:01 +0000103
Georg Brandl418b1ea2014-03-10 19:26:57 +0100104where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations
105see the make targets above).
Georg Brandl8ec7f652007-08-15 14:28:01 +0000106
107
108Contributing
109============
110
Benjamin Peterson2c85ed52008-12-21 01:12:26 +0000111Bugs in the content should be reported to the Python bug tracker at
Georg Brandl23dd65b2014-10-29 08:18:43 +0100112https://bugs.python.org.
Georg Brandl8ec7f652007-08-15 14:28:01 +0000113
Benjamin Peterson2c85ed52008-12-21 01:12:26 +0000114Bugs in the toolset should be reported in the Sphinx bug tracker at
Georg Brandl23dd65b2014-10-29 08:18:43 +0100115https://www.bitbucket.org/birkenfeld/sphinx/issues/.
Georg Brandl8ec7f652007-08-15 14:28:01 +0000116
117You can also send a mail to the Python Documentation Team at docs@python.org,
118and we will process your request as soon as possible.
119
120If you want to help the Documentation Team, you are always welcome. Just send
121a mail to docs@python.org.
122
123
124Copyright notice
125================
126
127The Python source is copyrighted, but you can freely use and copy it
128as long as you don't change or remove the copyright notice:
129
130----------------------------------------------------------------------
Benjamin Peterson1aeb8cf2013-12-31 22:02:22 -0600131Copyright (c) 2000-2014 Python Software Foundation.
Georg Brandl8ec7f652007-08-15 14:28:01 +0000132All rights reserved.
133
134Copyright (c) 2000 BeOpen.com.
135All rights reserved.
136
137Copyright (c) 1995-2000 Corporation for National Research Initiatives.
138All rights reserved.
139
140Copyright (c) 1991-1995 Stichting Mathematisch Centrum.
141All rights reserved.
142
143See the file "license.rst" for information on usage and redistribution
144of this file, and for a DISCLAIMER OF ALL WARRANTIES.
145----------------------------------------------------------------------