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