Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 1 | Python Documentation README |
| 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 3 | |
| 4 | This directory contains the reStructuredText (reST) sources to the Python |
| 5 | documentation. You don't need to build them yourself, prebuilt versions are |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 6 | available at <https://docs.python.org/dev/download.html>. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 7 | |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 8 | Documentation on authoring Python documentation, including information about |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 9 | both style and markup, is available in the "Documenting Python" chapter of the |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 10 | developers guide <https://docs.python.org/devguide/documenting.html>. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 11 | |
| 12 | |
| 13 | Building the docs |
| 14 | ================= |
| 15 | |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 16 | You need to have Sphinx <http://sphinx-doc.org/> installed; it is the toolset |
| 17 | used to build the docs. It is not included in this tree, but maintained |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 18 | separately and available from PyPI <https://pypi.python.org/pypi/Sphinx>. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 19 | |
| 20 | |
| 21 | Using make |
| 22 | ---------- |
| 23 | |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 24 | A Makefile has been prepared so that on Unix, provided you have installed |
| 25 | Sphinx, you can just run :: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 26 | |
| 27 | make html |
| 28 | |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 29 | to build the HTML output files. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 30 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 31 | On Windows, we try to emulate the Makefile as closely as possible with a |
| 32 | ``make.bat`` file. |
| 33 | |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 34 | To use a Python interpreter that's not called ``python``, use the standard |
| 35 | way to set Makefile variables, using e.g. :: |
| 36 | |
| 37 | make html PYTHON=python3 |
| 38 | |
| 39 | On Windows, set the PYTHON environment variable instead. |
| 40 | |
| 41 | To use a specific sphinx-build (something other than ``sphinx-build``), set |
| 42 | the SPHINXBUILD variable. |
| 43 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 44 | Available make targets are: |
| 45 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 46 | * "clean", which removes all build files. |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 47 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 48 | * "html", which builds standalone HTML files for offline viewing. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 49 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 50 | * "htmlview", which re-uses the "html" builder, but then opens the main page |
| 51 | in your default web browser. |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 52 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 53 | * "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 Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 56 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 57 | 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 Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 60 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 61 | * "latex", which builds LaTeX source files as input to "pdflatex" to produce |
| 62 | PDF documents. |
Georg Brandl | 14a1b8c | 2008-02-09 23:09:25 +0000 | [diff] [blame] | 63 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 64 | * "text", which builds a plain text file for each source file. |
Georg Brandl | 4f2c998 | 2008-06-01 16:41:31 +0000 | [diff] [blame] | 65 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 66 | * "epub", which builds an EPUB document, suitable to be viewed on e-book |
| 67 | readers. |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 68 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 69 | * "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 Brandl | 584265b | 2007-12-02 14:58:50 +0000 | [diff] [blame] | 72 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 73 | * "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 Brandl | b19be57 | 2007-12-29 10:57:00 +0000 | [diff] [blame] | 76 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 77 | * "coverage", which builds a coverage overview for standard library modules and |
| 78 | C API. |
Georg Brandl | 1704828 | 2008-02-23 18:47:04 +0000 | [diff] [blame] | 79 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 80 | * "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 Brandl | 681001e | 2008-06-01 20:33:55 +0000 | [diff] [blame] | 83 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 84 | * "suspicious", which checks the parsed markup for text that looks like |
| 85 | malformed and thus unconverted reST. |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 86 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 87 | * "check", which checks for frequent markup errors. |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 88 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 89 | * "serve", which serves the build/html directory on port 8000. |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 90 | |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 91 | * "dist", (Unix only) which creates distributable archives of HTML, text, |
| 92 | PDF, and EPUB builds. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 93 | |
| 94 | |
| 95 | Without make |
| 96 | ------------ |
| 97 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 98 | Install the Sphinx package and its dependencies from PyPI. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 99 | |
Benjamin Peterson | 423f128 | 2014-09-04 23:07:03 -0400 | [diff] [blame] | 100 | Then, from the ``Doc`` directory, run :: |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 101 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 102 | sphinx-build -b<builder> . build/<builder> |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 103 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 104 | where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations |
| 105 | see the make targets above). |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 106 | |
| 107 | |
| 108 | Contributing |
| 109 | ============ |
| 110 | |
Benjamin Peterson | 2c85ed5 | 2008-12-21 01:12:26 +0000 | [diff] [blame] | 111 | Bugs in the content should be reported to the Python bug tracker at |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 112 | https://bugs.python.org. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 113 | |
Benjamin Peterson | 2c85ed5 | 2008-12-21 01:12:26 +0000 | [diff] [blame] | 114 | Bugs in the toolset should be reported in the Sphinx bug tracker at |
Georg Brandl | 23dd65b | 2014-10-29 08:18:43 +0100 | [diff] [blame] | 115 | https://www.bitbucket.org/birkenfeld/sphinx/issues/. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 116 | |
| 117 | You can also send a mail to the Python Documentation Team at docs@python.org, |
| 118 | and we will process your request as soon as possible. |
| 119 | |
| 120 | If you want to help the Documentation Team, you are always welcome. Just send |
| 121 | a mail to docs@python.org. |
| 122 | |
| 123 | |
| 124 | Copyright notice |
| 125 | ================ |
| 126 | |
| 127 | The Python source is copyrighted, but you can freely use and copy it |
| 128 | as long as you don't change or remove the copyright notice: |
| 129 | |
| 130 | ---------------------------------------------------------------------- |
Benjamin Peterson | 1aeb8cf | 2013-12-31 22:02:22 -0600 | [diff] [blame] | 131 | Copyright (c) 2000-2014 Python Software Foundation. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 132 | All rights reserved. |
| 133 | |
| 134 | Copyright (c) 2000 BeOpen.com. |
| 135 | All rights reserved. |
| 136 | |
| 137 | Copyright (c) 1995-2000 Corporation for National Research Initiatives. |
| 138 | All rights reserved. |
| 139 | |
| 140 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum. |
| 141 | All rights reserved. |
| 142 | |
| 143 | See the file "license.rst" for information on usage and redistribution |
| 144 | of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 145 | ---------------------------------------------------------------------- |