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