blob: dcd3d6e80ff3c48d9da289679ac50872c7bcb4bc [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
Mariatta814213b2017-02-25 11:56:48 -08005documentation. You don't need to build them yourself, `prebuilt versions are
6available <https://docs.python.org/dev/download.html>`_.
Georg Brandl116aa622007-08-15 14:28:22 +00007
Zachary Ware1de519c2014-04-29 09:26:56 -05008Documentation on authoring Python documentation, including information about
Mariatta814213b2017-02-25 11:56:48 -08009both style and markup, is available in the "`Documenting Python
10<https://docs.python.org/devguide/documenting.html>`_" chapter of the
11developers guide.
Georg Brandl116aa622007-08-15 14:28:22 +000012
13
14Building the docs
15=================
16
Mariatta814213b2017-02-25 11:56:48 -080017You need to have `Sphinx <http://sphinx-doc.org/>`_ installed; it is the toolset
Georg Brandl02e77d12014-03-10 19:31:52 +010018used to build the docs. It is not included in this tree, but maintained
Mariatta814213b2017-02-25 11:56:48 -080019separately and `available from PyPI <https://pypi.python.org/pypi/Sphinx>`_.
Georg Brandl116aa622007-08-15 14:28:22 +000020
21
22Using make
23----------
24
Georg Brandl02e77d12014-03-10 19:31:52 +010025A Makefile has been prepared so that on Unix, provided you have installed
26Sphinx, you can just run ::
Georg Brandl116aa622007-08-15 14:28:22 +000027
28 make html
29
Zachary Ware1de519c2014-04-29 09:26:56 -050030to build the HTML output files.
Georg Brandl116aa622007-08-15 14:28:22 +000031
Georg Brandl18a364f2014-03-10 19:26:57 +010032On Windows, we try to emulate the Makefile as closely as possible with a
33``make.bat`` file.
Georg Brandl116aa622007-08-15 14:28:22 +000034
Georg Brandl716c3ac2007-08-30 18:34:23 +000035To use a Python interpreter that's not called ``python``, use the standard
36way to set Makefile variables, using e.g. ::
37
Zachary Ware1de519c2014-04-29 09:26:56 -050038 make html PYTHON=python3
39
40On Windows, set the PYTHON environment variable instead.
41
42To use a specific sphinx-build (something other than ``sphinx-build``), set
43the SPHINXBUILD variable.
Georg Brandl716c3ac2007-08-30 18:34:23 +000044
Georg Brandl116aa622007-08-15 14:28:22 +000045Available make targets are:
46
Georg Brandl69a72032014-10-29 08:18:43 +010047* "clean", which removes all build files.
Zachary Ware1de519c2014-04-29 09:26:56 -050048
Georg Brandl69a72032014-10-29 08:18:43 +010049* "html", which builds standalone HTML files for offline viewing.
Georg Brandl116aa622007-08-15 14:28:22 +000050
Georg Brandl69a72032014-10-29 08:18:43 +010051* "htmlview", which re-uses the "html" builder, but then opens the main page
52 in your default web browser.
Zachary Ware1de519c2014-04-29 09:26:56 -050053
Georg Brandl69a72032014-10-29 08:18:43 +010054* "htmlhelp", which builds HTML files and a HTML Help project file usable to
55 convert them into a single Compiled HTML (.chm) file -- these are popular
56 under Microsoft Windows, but very handy on every platform.
Georg Brandl116aa622007-08-15 14:28:22 +000057
Georg Brandl69a72032014-10-29 08:18:43 +010058 To create the CHM file, you need to run the Microsoft HTML Help Workshop
59 over the generated project (.hhp) file. The make.bat script does this for
60 you on Windows.
Georg Brandl116aa622007-08-15 14:28:22 +000061
Georg Brandl69a72032014-10-29 08:18:43 +010062* "latex", which builds LaTeX source files as input to "pdflatex" to produce
63 PDF documents.
Christian Heimes3feef612008-02-11 06:19:17 +000064
Georg Brandl69a72032014-10-29 08:18:43 +010065* "text", which builds a plain text file for each source file.
Georg Brandl0c77a822008-06-10 16:37:50 +000066
Georg Brandl69a72032014-10-29 08:18:43 +010067* "epub", which builds an EPUB document, suitable to be viewed on e-book
68 readers.
Georg Brandl183fe812011-01-05 11:00:25 +000069
Georg Brandl69a72032014-10-29 08:18:43 +010070* "linkcheck", which checks all external references to see whether they are
71 broken, redirected or malformed, and outputs this information to stdout as
72 well as a plain-text (.txt) file.
Christian Heimesd8654cf2007-12-02 15:22:16 +000073
Georg Brandl69a72032014-10-29 08:18:43 +010074* "changes", which builds an overview over all versionadded/versionchanged/
75 deprecated items in the current version. This is meant as a help for the
76 writer of the "What's New" document.
Christian Heimes5b5e81c2007-12-31 16:14:33 +000077
Georg Brandl69a72032014-10-29 08:18:43 +010078* "coverage", which builds a coverage overview for standard library modules and
79 C API.
Christian Heimesd3eb5a152008-02-24 00:38:49 +000080
Georg Brandl69a72032014-10-29 08:18:43 +010081* "pydoc-topics", which builds a Python module containing a dictionary with
82 plain text documentation for the labels defined in
83 `tools/pyspecific.py` -- pydoc needs these to show topic and keyword help.
Georg Brandl6b38daa2008-06-01 21:05:17 +000084
Georg Brandl69a72032014-10-29 08:18:43 +010085* "suspicious", which checks the parsed markup for text that looks like
86 malformed and thus unconverted reST.
Georg Brandl116aa622007-08-15 14:28:22 +000087
Georg Brandl69a72032014-10-29 08:18:43 +010088* "check", which checks for frequent markup errors.
Zachary Ware1de519c2014-04-29 09:26:56 -050089
Georg Brandl69a72032014-10-29 08:18:43 +010090* "serve", which serves the build/html directory on port 8000.
Zachary Ware1de519c2014-04-29 09:26:56 -050091
Georg Brandl69a72032014-10-29 08:18:43 +010092* "dist", (Unix only) which creates distributable archives of HTML, text,
93 PDF, and EPUB builds.
Zachary Ware1de519c2014-04-29 09:26:56 -050094
Georg Brandl116aa622007-08-15 14:28:22 +000095
96Without make
97------------
98
Georg Brandl18a364f2014-03-10 19:26:57 +010099Install the Sphinx package and its dependencies from PyPI.
Georg Brandl116aa622007-08-15 14:28:22 +0000100
Zachary Warea37ff0f2014-04-18 15:10:40 -0500101Then, from the ``Doc`` directory, run ::
Georg Brandld94b4a72010-03-13 10:56:09 +0000102
Georg Brandl18a364f2014-03-10 19:26:57 +0100103 sphinx-build -b<builder> . build/<builder>
Georg Brandl116aa622007-08-15 14:28:22 +0000104
Georg Brandl18a364f2014-03-10 19:26:57 +0100105where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations
106see the make targets above).
Georg Brandl116aa622007-08-15 14:28:22 +0000107
108
109Contributing
110============
111
Mariatta814213b2017-02-25 11:56:48 -0800112Bugs in the content should be reported to the
113`Python bug tracker <https://bugs.python.org>`_.
Georg Brandl116aa622007-08-15 14:28:22 +0000114
Mariatta814213b2017-02-25 11:56:48 -0800115Bugs in the toolset should be reported in the
116`Sphinx bug tracker <https://github.com/sphinx-doc/sphinx/issues>`_.
Georg Brandl116aa622007-08-15 14:28:22 +0000117
118You can also send a mail to the Python Documentation Team at docs@python.org,
119and we will process your request as soon as possible.
120
121If you want to help the Documentation Team, you are always welcome. Just send
122a mail to docs@python.org.