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 |
| 6 | available at http://docs.python.org/download/. |
| 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 |
Guido van Rossum | e6e2d9b | 2013-11-20 11:53:31 -0800 | [diff] [blame] | 10 | developers guide (http://docs.python.org/devguide/documenting.html). |
| 11 | There's also a chapter intended to point out differences to |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 12 | those familiar with the previous docs written in LaTeX. |
| 13 | |
| 14 | |
| 15 | Building the docs |
| 16 | ================= |
| 17 | |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 18 | You need to have Python 2.4 or higher installed; the toolset used to build the |
| 19 | docs is written in Python. It is called *Sphinx*, it is not included in this |
| 20 | tree, but maintained separately. Also needed are the docutils, supplying the |
| 21 | base markup that Sphinx uses, Jinja, a templating engine, and optionally |
| 22 | Pygments, a code highlighter. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 23 | |
| 24 | |
| 25 | Using make |
| 26 | ---------- |
| 27 | |
| 28 | Luckily, a Makefile has been prepared so that on Unix, provided you have |
| 29 | installed Python and Subversion, you can just run :: |
| 30 | |
| 31 | make html |
| 32 | |
| 33 | to check out the necessary toolset in the `tools/` subdirectory and build the |
| 34 | HTML output files. To view the generated HTML, point your favorite browser at |
| 35 | the top-level index `build/html/index.html` after running "make". |
| 36 | |
Georg Brandl | 716c3ac | 2007-08-30 18:34:23 +0000 | [diff] [blame] | 37 | To use a Python interpreter that's not called ``python``, use the standard |
| 38 | way to set Makefile variables, using e.g. :: |
| 39 | |
| 40 | make html PYTHON=/usr/bin/python2.5 |
| 41 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 42 | Available make targets are: |
| 43 | |
| 44 | * "html", which builds standalone HTML files for offline viewing. |
| 45 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 46 | * "htmlhelp", which builds HTML files and a HTML Help project file usable to |
| 47 | convert them into a single Compiled HTML (.chm) file -- these are popular |
| 48 | under Microsoft Windows, but very handy on every platform. |
| 49 | |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 50 | To create the CHM file, you need to run the Microsoft HTML Help Workshop over |
| 51 | the generated project (.hhp) file. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 52 | |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 53 | * "latex", which builds LaTeX source files as input to "pdflatex" to produce |
| 54 | PDF documents. |
Christian Heimes | 3feef61 | 2008-02-11 06:19:17 +0000 | [diff] [blame] | 55 | |
Georg Brandl | 0c77a82 | 2008-06-10 16:37:50 +0000 | [diff] [blame] | 56 | * "text", which builds a plain text file for each source file. |
| 57 | |
Georg Brandl | 183fe81 | 2011-01-05 11:00:25 +0000 | [diff] [blame] | 58 | * "epub", which builds an EPUB document, suitable to be viewed on e-book |
| 59 | readers. |
| 60 | |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 61 | * "linkcheck", which checks all external references to see whether they are |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 62 | broken, redirected or malformed, and outputs this information to stdout as |
| 63 | well as a plain-text (.txt) file. |
Christian Heimes | d8654cf | 2007-12-02 15:22:16 +0000 | [diff] [blame] | 64 | |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 65 | * "changes", which builds an overview over all versionadded/versionchanged/ |
| 66 | deprecated items in the current version. This is meant as a help for the |
| 67 | writer of the "What's New" document. |
| 68 | |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 69 | * "coverage", which builds a coverage overview for standard library modules and |
| 70 | C API. |
Christian Heimes | d3eb5a15 | 2008-02-24 00:38:49 +0000 | [diff] [blame] | 71 | |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 72 | * "pydoc-topics", which builds a Python module containing a dictionary with |
| 73 | plain text documentation for the labels defined in |
| 74 | `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and |
| 75 | keyword help. |
Georg Brandl | 6b38daa | 2008-06-01 21:05:17 +0000 | [diff] [blame] | 76 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 77 | A "make update" updates the Subversion checkouts in `tools/`. |
| 78 | |
| 79 | |
| 80 | Without make |
| 81 | ------------ |
| 82 | |
Georg Brandl | d94b4a7 | 2010-03-13 10:56:09 +0000 | [diff] [blame] | 83 | You'll need to install the Sphinx package, either by checking it out via :: |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 84 | |
Georg Brandl | 6dc50f3 | 2011-01-15 16:45:03 +0000 | [diff] [blame] | 85 | svn co http://svn.python.org/projects/external/Sphinx-1.0.7/sphinx tools/sphinx |
Georg Brandl | d94b4a7 | 2010-03-13 10:56:09 +0000 | [diff] [blame] | 86 | |
| 87 | or by installing it from PyPI. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 88 | |
Benjamin Peterson | 9203501 | 2008-12-27 16:00:54 +0000 | [diff] [blame] | 89 | Then, you need to install Docutils, either by checking it out via :: |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 90 | |
Georg Brandl | d94b4a7 | 2010-03-13 10:56:09 +0000 | [diff] [blame] | 91 | svn co http://svn.python.org/projects/external/docutils-0.6/docutils tools/docutils |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 92 | |
| 93 | or by installing it from http://docutils.sf.net/. |
| 94 | |
Georg Brandl | b5b5bcc | 2009-04-27 16:29:51 +0000 | [diff] [blame] | 95 | You also need Jinja2, either by checking it out via :: |
| 96 | |
Georg Brandl | d94b4a7 | 2010-03-13 10:56:09 +0000 | [diff] [blame] | 97 | svn co http://svn.python.org/projects/external/Jinja-2.3.1/jinja2 tools/jinja2 |
Georg Brandl | b5b5bcc | 2009-04-27 16:29:51 +0000 | [diff] [blame] | 98 | |
| 99 | or by installing it from PyPI. |
| 100 | |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 101 | You can optionally also install Pygments, either as a checkout via :: |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 102 | |
Georg Brandl | d94b4a7 | 2010-03-13 10:56:09 +0000 | [diff] [blame] | 103 | svn co http://svn.python.org/projects/external/Pygments-1.3.1/pygments tools/pygments |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 104 | |
| 105 | or from PyPI at http://pypi.python.org/pypi/Pygments. |
| 106 | |
| 107 | |
| 108 | Then, make an output directory, e.g. under `build/`, and run :: |
| 109 | |
| 110 | python tools/sphinx-build.py -b<builder> . build/<outputdirectory> |
| 111 | |
Benjamin Peterson | 9203501 | 2008-12-27 16:00:54 +0000 | [diff] [blame] | 112 | where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see |
| 113 | the make targets above). |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 114 | |
| 115 | |
| 116 | Contributing |
| 117 | ============ |
| 118 | |
Benjamin Peterson | 9203501 | 2008-12-27 16:00:54 +0000 | [diff] [blame] | 119 | Bugs in the content should be reported to the Python bug tracker at |
| 120 | http://bugs.python.org. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 121 | |
Benjamin Peterson | 9203501 | 2008-12-27 16:00:54 +0000 | [diff] [blame] | 122 | Bugs in the toolset should be reported in the Sphinx bug tracker at |
| 123 | http://www.bitbucket.org/birkenfeld/sphinx/issues/. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 124 | |
| 125 | You can also send a mail to the Python Documentation Team at docs@python.org, |
| 126 | and we will process your request as soon as possible. |
| 127 | |
| 128 | If you want to help the Documentation Team, you are always welcome. Just send |
| 129 | a mail to docs@python.org. |
| 130 | |
| 131 | |
| 132 | Copyright notice |
| 133 | ================ |
| 134 | |
| 135 | The Python source is copyrighted, but you can freely use and copy it |
| 136 | as long as you don't change or remove the copyright notice: |
| 137 | |
| 138 | ---------------------------------------------------------------------- |
Benjamin Peterson | a63eced | 2012-12-31 21:44:00 -0600 | [diff] [blame] | 139 | Copyright (c) 2000-2013 Python Software Foundation. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 140 | All rights reserved. |
| 141 | |
| 142 | Copyright (c) 2000 BeOpen.com. |
| 143 | All rights reserved. |
| 144 | |
| 145 | Copyright (c) 1995-2000 Corporation for National Research Initiatives. |
| 146 | All rights reserved. |
| 147 | |
| 148 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum. |
| 149 | All rights reserved. |
| 150 | |
| 151 | See the file "license.rst" for information on usage and redistribution |
| 152 | of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 153 | ---------------------------------------------------------------------- |