Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +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 |
Senthil Kumaran | f3ddcc9 | 2014-04-09 11:44:34 -0400 | [diff] [blame] | 6 | available at <https://docs.python.org/3.4/download.html>. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 7 | |
| 8 | Documentation on the authoring Python documentation, including information about |
| 9 | both style and markup, is available in the "Documenting Python" chapter of the |
Georg Brandl | 02e77d1 | 2014-03-10 19:31:52 +0100 | [diff] [blame] | 10 | developers guide <http://docs.python.org/devguide/documenting.html>. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 11 | |
| 12 | |
| 13 | Building the docs |
| 14 | ================= |
| 15 | |
Georg Brandl | 02e77d1 | 2014-03-10 19:31:52 +0100 | [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 |
| 18 | separately and available from PyPI <http://pypi.python.org/pypi/Sphinx>. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 19 | |
| 20 | |
| 21 | Using make |
| 22 | ---------- |
| 23 | |
Georg Brandl | 02e77d1 | 2014-03-10 19:31:52 +0100 | [diff] [blame] | 24 | A Makefile has been prepared so that on Unix, provided you have installed |
| 25 | Sphinx, you can just run :: |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 26 | |
| 27 | make html |
| 28 | |
Georg Brandl | 02e77d1 | 2014-03-10 19:31:52 +0100 | [diff] [blame] | 29 | to build the HTML output files. To view the generated HTML, point your favorite |
| 30 | browser at the top-level index `build/html/index.html` after running "make". |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 31 | |
Georg Brandl | 18a364f | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 32 | On Windows, we try to emulate the Makefile as closely as possible with a |
| 33 | ``make.bat`` file. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 34 | |
Georg Brandl | 716c3ac | 2007-08-30 18:34:23 +0000 | [diff] [blame] | 35 | To use a Python interpreter that's not called ``python``, use the standard |
| 36 | way to set Makefile variables, using e.g. :: |
| 37 | |
| 38 | make html PYTHON=/usr/bin/python2.5 |
| 39 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 40 | Available make targets are: |
| 41 | |
| 42 | * "html", which builds standalone HTML files for offline viewing. |
| 43 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 44 | * "htmlhelp", which builds HTML files and a HTML Help project file usable to |
| 45 | convert them into a single Compiled HTML (.chm) file -- these are popular |
| 46 | under Microsoft Windows, but very handy on every platform. |
| 47 | |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 48 | To create the CHM file, you need to run the Microsoft HTML Help Workshop over |
| 49 | the generated project (.hhp) file. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 50 | |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 51 | * "latex", which builds LaTeX source files as input to "pdflatex" to produce |
| 52 | PDF documents. |
Christian Heimes | 3feef61 | 2008-02-11 06:19:17 +0000 | [diff] [blame] | 53 | |
Georg Brandl | 0c77a82 | 2008-06-10 16:37:50 +0000 | [diff] [blame] | 54 | * "text", which builds a plain text file for each source file. |
| 55 | |
Georg Brandl | 183fe81 | 2011-01-05 11:00:25 +0000 | [diff] [blame] | 56 | * "epub", which builds an EPUB document, suitable to be viewed on e-book |
| 57 | readers. |
| 58 | |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 59 | * "linkcheck", which checks all external references to see whether they are |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 60 | broken, redirected or malformed, and outputs this information to stdout as |
| 61 | well as a plain-text (.txt) file. |
Christian Heimes | d8654cf | 2007-12-02 15:22:16 +0000 | [diff] [blame] | 62 | |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 63 | * "changes", which builds an overview over all versionadded/versionchanged/ |
| 64 | deprecated items in the current version. This is meant as a help for the |
| 65 | writer of the "What's New" document. |
| 66 | |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 67 | * "coverage", which builds a coverage overview for standard library modules and |
| 68 | C API. |
Christian Heimes | d3eb5a15 | 2008-02-24 00:38:49 +0000 | [diff] [blame] | 69 | |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 70 | * "pydoc-topics", which builds a Python module containing a dictionary with |
| 71 | plain text documentation for the labels defined in |
| 72 | `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and |
| 73 | keyword help. |
Georg Brandl | 6b38daa | 2008-06-01 21:05:17 +0000 | [diff] [blame] | 74 | |
Georg Brandl | 18a364f | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 75 | * "suspicious", which checks the parsed markup for text that looks like |
| 76 | malformed and thus unconverted reST. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 77 | |
| 78 | |
| 79 | Without make |
| 80 | ------------ |
| 81 | |
Georg Brandl | 18a364f | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 82 | Install the Sphinx package and its dependencies from PyPI. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 83 | |
Georg Brandl | 18a364f | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 84 | Then, from the ``Docs`` directory, run :: |
Georg Brandl | d94b4a7 | 2010-03-13 10:56:09 +0000 | [diff] [blame] | 85 | |
Georg Brandl | 18a364f | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 86 | sphinx-build -b<builder> . build/<builder> |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 87 | |
Georg Brandl | 18a364f | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 88 | where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations |
| 89 | see the make targets above). |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 90 | |
| 91 | |
| 92 | Contributing |
| 93 | ============ |
| 94 | |
Benjamin Peterson | 9203501 | 2008-12-27 16:00:54 +0000 | [diff] [blame] | 95 | Bugs in the content should be reported to the Python bug tracker at |
| 96 | http://bugs.python.org. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 97 | |
Benjamin Peterson | 9203501 | 2008-12-27 16:00:54 +0000 | [diff] [blame] | 98 | Bugs in the toolset should be reported in the Sphinx bug tracker at |
| 99 | http://www.bitbucket.org/birkenfeld/sphinx/issues/. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 100 | |
| 101 | You can also send a mail to the Python Documentation Team at docs@python.org, |
| 102 | and we will process your request as soon as possible. |
| 103 | |
| 104 | If you want to help the Documentation Team, you are always welcome. Just send |
| 105 | a mail to docs@python.org. |
| 106 | |
| 107 | |
| 108 | Copyright notice |
| 109 | ================ |
| 110 | |
| 111 | The Python source is copyrighted, but you can freely use and copy it |
| 112 | as long as you don't change or remove the copyright notice: |
| 113 | |
| 114 | ---------------------------------------------------------------------- |
Benjamin Peterson | fa10ae0 | 2013-12-31 22:02:22 -0600 | [diff] [blame] | 115 | Copyright (c) 2000-2014 Python Software Foundation. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 116 | All rights reserved. |
| 117 | |
| 118 | Copyright (c) 2000 BeOpen.com. |
| 119 | All rights reserved. |
| 120 | |
| 121 | Copyright (c) 1995-2000 Corporation for National Research Initiatives. |
| 122 | All rights reserved. |
| 123 | |
| 124 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum. |
| 125 | All rights reserved. |
| 126 | |
| 127 | See the file "license.rst" for information on usage and redistribution |
| 128 | of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 129 | ---------------------------------------------------------------------- |