cpython/Doc/README.rst at main · python/cpython (original) (raw)

Python Documentation README

This directory contains the reStructuredText (reST) sources to the Python documentation. You don't need to build them yourself, prebuilt versions are available.

Documentation on authoring Python documentation, including information about both style and markup, is available in the "Documenting Python" chapter of the developers guide.

Building the docs

The documentation is built with several tools which are not included in this tree but are maintained separately and are available fromPyPI.

The easiest way to install these tools is to create a virtual environment and install the tools into there.

Using make

To get started on Unix, you can create a virtual environment and build documentation with the commands:

make venv make html

The virtual environment in the venv directory will contain all the tools necessary to build the documentation downloaded and installed from PyPI. If you'd like to create the virtual environment in a different location, you can specify it using the VENVDIR variable.

You can also skip creating the virtual environment altogether, in which case the Makefile will look for instances of sphinx-build and blurbinstalled on your process PATH (configurable with the SPHINXBUILD andBLURB variables).

On Windows, we try to emulate the Makefile as closely as possible with amake.bat file. If you need to specify the Python interpreter to use, set the PYTHON environment variable.

Available make targets are:

Without make

First, install the tool dependencies from PyPI.

Then, from the Doc directory, run

sphinx-build -b . build/

where <builder> is one of html, text, latex, or htmlhelp (for explanations see the make targets above).

Deprecation header

You can define the outdated variable in html_context to show a red banner on each page redirecting to the "latest" version.

The link points to the same page on /3/, sadly for the moment the language is lost during the process.

Contributing

Bugs in the content should be reported to thePython bug tracker.

Bugs in the toolset should be reported to the tools themselves.

To help with the documentation, or report any problems, please leave a message on discuss.python.org.