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 |
| 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 | |
Georg Brandl | 8e8e56c | 2008-02-09 21:36:15 +0000 | [diff] [blame] | 17 | You need to install Python 2.4 or higher; the toolset used to build the docs are |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 18 | written in Python. The toolset used to build the documentation is called |
| 19 | *Sphinx*, it is not included in this tree, but maintained separately in the |
| 20 | Python Subversion repository. Also needed are Jinja, a templating engine |
| 21 | (included in Sphinx as a Subversion external), and optionally Pygments, a code |
| 22 | highlighter. |
| 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 | |
| 37 | Available make targets are: |
| 38 | |
| 39 | * "html", which builds standalone HTML files for offline viewing. |
| 40 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 41 | * "htmlhelp", which builds HTML files and a HTML Help project file usable to |
| 42 | convert them into a single Compiled HTML (.chm) file -- these are popular |
| 43 | under Microsoft Windows, but very handy on every platform. |
| 44 | |
| 45 | To create the CHM file, you need to run the Microsoft HTML Help Workshop |
| 46 | over the generated project (.hhp) file. |
| 47 | |
Georg Brandl | 584265b | 2007-12-02 14:58:50 +0000 | [diff] [blame] | 48 | * "latex", which builds LaTeX source files that can be run with "pdflatex" |
| 49 | to produce PDF documents. |
Georg Brandl | 14a1b8c | 2008-02-09 23:09:25 +0000 | [diff] [blame] | 50 | |
Georg Brandl | 4f2c998 | 2008-06-01 16:41:31 +0000 | [diff] [blame] | 51 | * "text", which builds a plain text file for each source file. |
| 52 | |
Georg Brandl | cd23527 | 2008-02-01 15:50:15 +0000 | [diff] [blame] | 53 | * "linkcheck", which checks all external references to see whether they are |
| 54 | broken, redirected or malformed, and outputs this information to stdout |
| 55 | as well as a plain-text (.txt) file. |
Georg Brandl | 584265b | 2007-12-02 14:58:50 +0000 | [diff] [blame] | 56 | |
Georg Brandl | b19be57 | 2007-12-29 10:57:00 +0000 | [diff] [blame] | 57 | * "changes", which builds an overview over all versionadded/versionchanged/ |
| 58 | deprecated items in the current version. This is meant as a help for the |
| 59 | writer of the "What's New" document. |
| 60 | |
Georg Brandl | 1704828 | 2008-02-23 18:47:04 +0000 | [diff] [blame] | 61 | * "coverage", which builds a coverage overview for standard library modules |
| 62 | and C API. |
| 63 | |
Georg Brandl | 681001e | 2008-06-01 20:33:55 +0000 | [diff] [blame] | 64 | * "pydoc-topics", which builds a Python module containing a dictionary |
| 65 | with plain text documentation for the labels defined in |
| 66 | `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic |
| 67 | and keyword help. |
| 68 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 69 | A "make update" updates the Subversion checkouts in `tools/`. |
| 70 | |
| 71 | |
| 72 | Without make |
| 73 | ------------ |
| 74 | |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 75 | You'll need to install the Sphinx package, either by checking it out via :: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 76 | |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 77 | svn co http://svn.python.org/projects/external/Sphinx-0.6.5/sphinx tools/sphinx |
| 78 | |
| 79 | or by installing it from PyPI. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 80 | |
Benjamin Peterson | 2c85ed5 | 2008-12-21 01:12:26 +0000 | [diff] [blame] | 81 | Then, you need to install Docutils, either by checking it out via :: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 82 | |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 83 | svn co http://svn.python.org/projects/external/docutils-0.6/docutils tools/docutils |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 84 | |
| 85 | or by installing it from http://docutils.sf.net/. |
| 86 | |
Georg Brandl | dbc5b4b | 2009-04-26 06:05:18 +0000 | [diff] [blame] | 87 | You also need Jinja2, either by checking it out via :: |
| 88 | |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 89 | svn co http://svn.python.org/projects/external/Jinja-2.3.1/jinja2 tools/jinja2 |
Georg Brandl | dbc5b4b | 2009-04-26 06:05:18 +0000 | [diff] [blame] | 90 | |
| 91 | or by installing it from PyPI. |
| 92 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 93 | You can optionally also install Pygments, either as a checkout via :: |
| 94 | |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 95 | svn co http://svn.python.org/projects/external/Pygments-1.3.1/pygments tools/pygments |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 96 | |
| 97 | or from PyPI at http://pypi.python.org/pypi/Pygments. |
| 98 | |
| 99 | |
| 100 | Then, make an output directory, e.g. under `build/`, and run :: |
| 101 | |
| 102 | python tools/sphinx-build.py -b<builder> . build/<outputdirectory> |
| 103 | |
Benjamin Peterson | 5c29dd4 | 2008-12-21 01:04:32 +0000 | [diff] [blame] | 104 | where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see |
| 105 | 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 |
| 112 | http://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 |
| 115 | http://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 | ---------------------------------------------------------------------- |
Barry Warsaw | 189b6d8 | 2008-03-01 03:15:20 +0000 | [diff] [blame] | 131 | Copyright (c) 2000-2008 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 | ---------------------------------------------------------------------- |