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 | f084aed | 2010-06-12 09:46:03 +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 | 8ec7f65 | 2007-08-15 14:28:01 +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 | |
| 36 | Available make targets are: |
| 37 | |
| 38 | * "html", which builds standalone HTML files for offline viewing. |
| 39 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 40 | * "htmlhelp", which builds HTML files and a HTML Help project file usable to |
| 41 | convert them into a single Compiled HTML (.chm) file -- these are popular |
| 42 | under Microsoft Windows, but very handy on every platform. |
| 43 | |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 44 | To create the CHM file, you need to run the Microsoft HTML Help Workshop over |
| 45 | the generated project (.hhp) file. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 46 | |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 47 | * "latex", which builds LaTeX source files as input to "pdflatex" to produce |
| 48 | PDF documents. |
Georg Brandl | 14a1b8c | 2008-02-09 23:09:25 +0000 | [diff] [blame] | 49 | |
Georg Brandl | 4f2c998 | 2008-06-01 16:41:31 +0000 | [diff] [blame] | 50 | * "text", which builds a plain text file for each source file. |
| 51 | |
Georg Brandl | cd23527 | 2008-02-01 15:50:15 +0000 | [diff] [blame] | 52 | * "linkcheck", which checks all external references to see whether they are |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 53 | broken, redirected or malformed, and outputs this information to stdout as |
| 54 | well as a plain-text (.txt) file. |
Georg Brandl | 584265b | 2007-12-02 14:58:50 +0000 | [diff] [blame] | 55 | |
Georg Brandl | b19be57 | 2007-12-29 10:57:00 +0000 | [diff] [blame] | 56 | * "changes", which builds an overview over all versionadded/versionchanged/ |
| 57 | deprecated items in the current version. This is meant as a help for the |
| 58 | writer of the "What's New" document. |
| 59 | |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 60 | * "coverage", which builds a coverage overview for standard library modules and |
| 61 | C API. |
Georg Brandl | 1704828 | 2008-02-23 18:47:04 +0000 | [diff] [blame] | 62 | |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 63 | * "pydoc-topics", which builds a Python module containing a dictionary with |
| 64 | plain text documentation for the labels defined in |
| 65 | `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and |
| 66 | keyword help. |
Georg Brandl | 681001e | 2008-06-01 20:33:55 +0000 | [diff] [blame] | 67 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 68 | A "make update" updates the Subversion checkouts in `tools/`. |
| 69 | |
| 70 | |
| 71 | Without make |
| 72 | ------------ |
| 73 | |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 74 | 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] | 75 | |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 76 | svn co http://svn.python.org/projects/external/Sphinx-0.6.5/sphinx tools/sphinx |
| 77 | |
| 78 | or by installing it from PyPI. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 79 | |
Benjamin Peterson | 2c85ed5 | 2008-12-21 01:12:26 +0000 | [diff] [blame] | 80 | Then, you need to install Docutils, either by checking it out via :: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 81 | |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 82 | 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] | 83 | |
| 84 | or by installing it from http://docutils.sf.net/. |
| 85 | |
Georg Brandl | dbc5b4b | 2009-04-26 06:05:18 +0000 | [diff] [blame] | 86 | You also need Jinja2, either by checking it out via :: |
| 87 | |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 88 | 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] | 89 | |
| 90 | or by installing it from PyPI. |
| 91 | |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 92 | You can optionally also install Pygments, either as a checkout via :: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 93 | |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 94 | 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] | 95 | |
| 96 | or from PyPI at http://pypi.python.org/pypi/Pygments. |
| 97 | |
| 98 | |
| 99 | Then, make an output directory, e.g. under `build/`, and run :: |
| 100 | |
| 101 | python tools/sphinx-build.py -b<builder> . build/<outputdirectory> |
| 102 | |
Benjamin Peterson | 5c29dd4 | 2008-12-21 01:04:32 +0000 | [diff] [blame] | 103 | where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see |
| 104 | the make targets above). |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 105 | |
| 106 | |
| 107 | Contributing |
| 108 | ============ |
| 109 | |
Benjamin Peterson | 2c85ed5 | 2008-12-21 01:12:26 +0000 | [diff] [blame] | 110 | Bugs in the content should be reported to the Python bug tracker at |
| 111 | http://bugs.python.org. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 112 | |
Benjamin Peterson | 2c85ed5 | 2008-12-21 01:12:26 +0000 | [diff] [blame] | 113 | Bugs in the toolset should be reported in the Sphinx bug tracker at |
| 114 | http://www.bitbucket.org/birkenfeld/sphinx/issues/. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 115 | |
| 116 | You can also send a mail to the Python Documentation Team at docs@python.org, |
| 117 | and we will process your request as soon as possible. |
| 118 | |
| 119 | If you want to help the Documentation Team, you are always welcome. Just send |
| 120 | a mail to docs@python.org. |
| 121 | |
| 122 | |
| 123 | Copyright notice |
| 124 | ================ |
| 125 | |
| 126 | The Python source is copyrighted, but you can freely use and copy it |
| 127 | as long as you don't change or remove the copyright notice: |
| 128 | |
| 129 | ---------------------------------------------------------------------- |
Barry Warsaw | 189b6d8 | 2008-03-01 03:15:20 +0000 | [diff] [blame] | 130 | Copyright (c) 2000-2008 Python Software Foundation. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 131 | All rights reserved. |
| 132 | |
| 133 | Copyright (c) 2000 BeOpen.com. |
| 134 | All rights reserved. |
| 135 | |
| 136 | Copyright (c) 1995-2000 Corporation for National Research Initiatives. |
| 137 | All rights reserved. |
| 138 | |
| 139 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum. |
| 140 | All rights reserved. |
| 141 | |
| 142 | See the file "license.rst" for information on usage and redistribution |
| 143 | of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 144 | ---------------------------------------------------------------------- |