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 | |
Christian Heimes | 3feef61 | 2008-02-11 06:19:17 +0000 | [diff] [blame] | 17 | You need to install Python 2.4 or higher (but Python 3.0 is not supported yet); |
Georg Brandl | 716c3ac | 2007-08-30 18:34:23 +0000 | [diff] [blame] | 18 | the toolset used to build the docs are written in Python. The toolset used |
| 19 | to build the documentation is called *Sphinx*, it is not included in this |
| 20 | tree, but maintained separately in the Python Subversion repository. Also |
| 21 | needed are Jinja, a templating engine (included in Sphinx as a Subversion |
| 22 | external), and optionally 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 | |
| 46 | * "web", which builds files usable with the Sphinx.web application (used to |
| 47 | serve the docs online at http://docs.python.org/). |
| 48 | |
| 49 | * "htmlhelp", which builds HTML files and a HTML Help project file usable to |
| 50 | convert them into a single Compiled HTML (.chm) file -- these are popular |
| 51 | under Microsoft Windows, but very handy on every platform. |
| 52 | |
| 53 | To create the CHM file, you need to run the Microsoft HTML Help Workshop |
| 54 | over the generated project (.hhp) file. |
| 55 | |
Christian Heimes | d8654cf | 2007-12-02 15:22:16 +0000 | [diff] [blame] | 56 | * "latex", which builds LaTeX source files that can be run with "pdflatex" |
| 57 | to produce PDF documents. |
Christian Heimes | 3feef61 | 2008-02-11 06:19:17 +0000 | [diff] [blame] | 58 | |
Christian Heimes | 292d351 | 2008-02-03 16:51:08 +0000 | [diff] [blame] | 59 | * "linkcheck", which checks all external references to see whether they are |
| 60 | broken, redirected or malformed, and outputs this information to stdout |
| 61 | as well as a plain-text (.txt) file. |
Christian Heimes | d8654cf | 2007-12-02 15:22:16 +0000 | [diff] [blame] | 62 | |
Christian Heimes | 5b5e81c | 2007-12-31 16:14:33 +0000 | [diff] [blame] | 63 | * "changes", which builds an overview over all versionadded/versionchanged/ |
| 64 | deprecated items in the current version. This is meant as a help for the |
| 65 | writer of the "What's New" document. |
| 66 | |
Christian Heimes | d3eb5a15 | 2008-02-24 00:38:49 +0000 | [diff] [blame] | 67 | * "coverage", which builds a coverage overview for standard library modules |
| 68 | and C API. |
| 69 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 70 | A "make update" updates the Subversion checkouts in `tools/`. |
| 71 | |
| 72 | |
| 73 | Without make |
| 74 | ------------ |
| 75 | |
| 76 | You'll need to checkout the Sphinx package to the `tools/` directory:: |
| 77 | |
| 78 | svn co http://svn.python.org/projects/doctools/trunk/sphinx tools/sphinx |
| 79 | |
| 80 | Then, you need to install Docutils 0.4 (the SVN snapshot won't work), either |
| 81 | by checking it out via :: |
| 82 | |
| 83 | svn co http://svn.python.org/projects/external/docutils-0.4/docutils tools/docutils |
| 84 | |
| 85 | or by installing it from http://docutils.sf.net/. |
| 86 | |
| 87 | You can optionally also install Pygments, either as a checkout via :: |
| 88 | |
Georg Brandl | 9afde1c | 2007-11-01 20:32:30 +0000 | [diff] [blame] | 89 | svn co http://svn.python.org/projects/external/Pygments-0.9/pygments tools/pygments |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 90 | |
| 91 | or from PyPI at http://pypi.python.org/pypi/Pygments. |
| 92 | |
| 93 | |
| 94 | Then, make an output directory, e.g. under `build/`, and run :: |
| 95 | |
| 96 | python tools/sphinx-build.py -b<builder> . build/<outputdirectory> |
| 97 | |
| 98 | where `<builder>` is one of html, web or htmlhelp (for explanations see the make |
| 99 | targets above). |
| 100 | |
| 101 | |
| 102 | Contributing |
| 103 | ============ |
| 104 | |
| 105 | For bugs in the content, the online version at http://docs.python.org/ has a |
| 106 | "suggest change" facility that can be used to correct errors in the source text |
| 107 | and submit them as a patch to the maintainers. |
| 108 | |
| 109 | Bugs in the toolset should be reported in the Python bug tracker at |
| 110 | http://bugs.python.org/. |
| 111 | |
| 112 | You can also send a mail to the Python Documentation Team at docs@python.org, |
| 113 | and we will process your request as soon as possible. |
| 114 | |
| 115 | If you want to help the Documentation Team, you are always welcome. Just send |
| 116 | a mail to docs@python.org. |
| 117 | |
| 118 | |
| 119 | Copyright notice |
| 120 | ================ |
| 121 | |
| 122 | The Python source is copyrighted, but you can freely use and copy it |
| 123 | as long as you don't change or remove the copyright notice: |
| 124 | |
| 125 | ---------------------------------------------------------------------- |
Barry Warsaw | 659fc42 | 2008-03-01 17:45:23 +0000 | [diff] [blame^] | 126 | Copyright (c) 2000-2008 Python Software Foundation. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 127 | All rights reserved. |
| 128 | |
| 129 | Copyright (c) 2000 BeOpen.com. |
| 130 | All rights reserved. |
| 131 | |
| 132 | Copyright (c) 1995-2000 Corporation for National Research Initiatives. |
| 133 | All rights reserved. |
| 134 | |
| 135 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum. |
| 136 | All rights reserved. |
| 137 | |
| 138 | See the file "license.rst" for information on usage and redistribution |
| 139 | of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 140 | ---------------------------------------------------------------------- |