| 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 |  | 
| Georg Brandl | 183fe81 | 2011-01-05 11:00:25 +0000 | [diff] [blame] | 57 |  * "epub", which builds an EPUB document, suitable to be viewed on e-book | 
 | 58 |    readers. | 
 | 59 |  | 
| Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 60 |  * "linkcheck", which checks all external references to see whether they are | 
| Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 61 |    broken, redirected or malformed, and outputs this information to stdout as | 
 | 62 |    well as a plain-text (.txt) file. | 
| Christian Heimes | d8654cf | 2007-12-02 15:22:16 +0000 | [diff] [blame] | 63 |  | 
| Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 64 |  * "changes", which builds an overview over all versionadded/versionchanged/ | 
 | 65 |    deprecated items in the current version. This is meant as a help for the | 
 | 66 |    writer of the "What's New" document. | 
 | 67 |  | 
| Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 68 |  * "coverage", which builds a coverage overview for standard library modules and | 
 | 69 |    C API. | 
| Christian Heimes | d3eb5a15 | 2008-02-24 00:38:49 +0000 | [diff] [blame] | 70 |  | 
| Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 71 |  * "pydoc-topics", which builds a Python module containing a dictionary with | 
 | 72 |    plain text documentation for the labels defined in | 
 | 73 |    `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and | 
 | 74 |    keyword help. | 
| Georg Brandl | 6b38daa | 2008-06-01 21:05:17 +0000 | [diff] [blame] | 75 |  | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 76 | A "make update" updates the Subversion checkouts in `tools/`. | 
 | 77 |  | 
 | 78 |  | 
 | 79 | Without make | 
 | 80 | ------------ | 
 | 81 |  | 
| Georg Brandl | d94b4a7 | 2010-03-13 10:56:09 +0000 | [diff] [blame] | 82 | 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] | 83 |  | 
| Georg Brandl | 6dc50f3 | 2011-01-15 16:45:03 +0000 | [diff] [blame] | 84 |    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] | 85 |  | 
 | 86 | or by installing it from PyPI. | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 87 |  | 
| Benjamin Peterson | 9203501 | 2008-12-27 16:00:54 +0000 | [diff] [blame] | 88 | Then, you need to install Docutils, either by checking it out via :: | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 89 |  | 
| Georg Brandl | d94b4a7 | 2010-03-13 10:56:09 +0000 | [diff] [blame] | 90 |    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] | 91 |  | 
 | 92 | or by installing it from http://docutils.sf.net/. | 
 | 93 |  | 
| Georg Brandl | b5b5bcc | 2009-04-27 16:29:51 +0000 | [diff] [blame] | 94 | You also need Jinja2, either by checking it out via :: | 
 | 95 |  | 
| Georg Brandl | d94b4a7 | 2010-03-13 10:56:09 +0000 | [diff] [blame] | 96 |    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] | 97 |  | 
 | 98 | or by installing it from PyPI. | 
 | 99 |  | 
| Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 100 | You can optionally also install Pygments, either as a checkout via :: | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 101 |  | 
| Georg Brandl | d94b4a7 | 2010-03-13 10:56:09 +0000 | [diff] [blame] | 102 |    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] | 103 |  | 
 | 104 | or from PyPI at http://pypi.python.org/pypi/Pygments. | 
 | 105 |  | 
 | 106 |  | 
 | 107 | Then, make an output directory, e.g. under `build/`, and run :: | 
 | 108 |  | 
 | 109 |    python tools/sphinx-build.py -b<builder> . build/<outputdirectory> | 
 | 110 |  | 
| Benjamin Peterson | 9203501 | 2008-12-27 16:00:54 +0000 | [diff] [blame] | 111 | where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see | 
 | 112 | the make targets above). | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 113 |  | 
 | 114 |  | 
 | 115 | Contributing | 
 | 116 | ============ | 
 | 117 |  | 
| Benjamin Peterson | 9203501 | 2008-12-27 16:00:54 +0000 | [diff] [blame] | 118 | Bugs in the content should be reported to the Python bug tracker at | 
 | 119 | http://bugs.python.org. | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 120 |  | 
| Benjamin Peterson | 9203501 | 2008-12-27 16:00:54 +0000 | [diff] [blame] | 121 | Bugs in the toolset should be reported in the Sphinx bug tracker at | 
 | 122 | http://www.bitbucket.org/birkenfeld/sphinx/issues/. | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 123 |  | 
 | 124 | You can also send a mail to the Python Documentation Team at docs@python.org, | 
 | 125 | and we will process your request as soon as possible. | 
 | 126 |  | 
 | 127 | If you want to help the Documentation Team, you are always welcome.  Just send | 
 | 128 | a mail to docs@python.org. | 
 | 129 |  | 
 | 130 |  | 
 | 131 | Copyright notice | 
 | 132 | ================ | 
 | 133 |  | 
 | 134 | The Python source is copyrighted, but you can freely use and copy it | 
 | 135 | as long as you don't change or remove the copyright notice: | 
 | 136 |  | 
 | 137 | ---------------------------------------------------------------------- | 
| Georg Brandl | ed13853 | 2010-12-31 23:00:03 +0000 | [diff] [blame] | 138 | Copyright (c) 2000-2011 Python Software Foundation. | 
| Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 139 | All rights reserved. | 
 | 140 |  | 
 | 141 | Copyright (c) 2000 BeOpen.com. | 
 | 142 | All rights reserved. | 
 | 143 |  | 
 | 144 | Copyright (c) 1995-2000 Corporation for National Research Initiatives. | 
 | 145 | All rights reserved. | 
 | 146 |  | 
 | 147 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum. | 
 | 148 | All rights reserved. | 
 | 149 |  | 
 | 150 | See the file "license.rst" for information on usage and redistribution | 
 | 151 | of this file, and for a DISCLAIMER OF ALL WARRANTIES. | 
 | 152 | ---------------------------------------------------------------------- |