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 |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame^] | 10 | documentation. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 11 | |
| 12 | |
| 13 | Building the docs |
| 14 | ================= |
| 15 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame^] | 16 | You need to have Python 2 installed; the toolset used to build the |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 17 | docs is written in Python. It is called *Sphinx*, it is not included in this |
| 18 | tree, but maintained separately. Also needed are the docutils, supplying the |
| 19 | base markup that Sphinx uses, Jinja, a templating engine, and optionally |
| 20 | Pygments, a code highlighter. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 21 | |
| 22 | |
| 23 | Using make |
| 24 | ---------- |
| 25 | |
| 26 | Luckily, a Makefile has been prepared so that on Unix, provided you have |
| 27 | installed Python and Subversion, you can just run :: |
| 28 | |
| 29 | make html |
| 30 | |
| 31 | to check out the necessary toolset in the `tools/` subdirectory and build the |
| 32 | HTML output files. To view the generated HTML, point your favorite browser at |
| 33 | the top-level index `build/html/index.html` after running "make". |
| 34 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame^] | 35 | On Windows, we try to emulate the Makefile as closely as possible with a |
| 36 | ``make.bat`` file. |
| 37 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 38 | Available make targets are: |
| 39 | |
| 40 | * "html", which builds standalone HTML files for offline viewing. |
| 41 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 42 | * "htmlhelp", which builds HTML files and a HTML Help project file usable to |
| 43 | convert them into a single Compiled HTML (.chm) file -- these are popular |
| 44 | under Microsoft Windows, but very handy on every platform. |
| 45 | |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 46 | To create the CHM file, you need to run the Microsoft HTML Help Workshop over |
| 47 | the generated project (.hhp) file. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 48 | |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 49 | * "latex", which builds LaTeX source files as input to "pdflatex" to produce |
| 50 | PDF documents. |
Georg Brandl | 14a1b8c | 2008-02-09 23:09:25 +0000 | [diff] [blame] | 51 | |
Georg Brandl | 4f2c998 | 2008-06-01 16:41:31 +0000 | [diff] [blame] | 52 | * "text", which builds a plain text file for each source file. |
| 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 |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 55 | broken, redirected or malformed, and outputs this information to stdout as |
| 56 | 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 | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 62 | * "coverage", which builds a coverage overview for standard library modules and |
| 63 | C API. |
Georg Brandl | 1704828 | 2008-02-23 18:47:04 +0000 | [diff] [blame] | 64 | |
Georg Brandl | f084aed | 2010-06-12 09:46:03 +0000 | [diff] [blame] | 65 | * "pydoc-topics", which builds a Python module containing a dictionary with |
| 66 | plain text documentation for the labels defined in |
| 67 | `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and |
| 68 | keyword help. |
Georg Brandl | 681001e | 2008-06-01 20:33:55 +0000 | [diff] [blame] | 69 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame^] | 70 | * "suspicious", which checks the parsed markup for text that looks like |
| 71 | malformed and thus unconverted reST. |
| 72 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 73 | A "make update" updates the Subversion checkouts in `tools/`. |
| 74 | |
| 75 | |
| 76 | Without make |
| 77 | ------------ |
| 78 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame^] | 79 | Install the Sphinx package and its dependencies from PyPI. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 80 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame^] | 81 | Then, from the ``Docs`` directory, run :: |
Georg Brandl | fce7b86 | 2010-03-13 10:54:12 +0000 | [diff] [blame] | 82 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame^] | 83 | sphinx-build -b<builder> . build/<builder> |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 84 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame^] | 85 | where ``<builder>`` is one of html, text, latex, or htmlhelp (for explanations |
| 86 | see the make targets above). |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 87 | |
| 88 | |
| 89 | Contributing |
| 90 | ============ |
| 91 | |
Benjamin Peterson | 2c85ed5 | 2008-12-21 01:12:26 +0000 | [diff] [blame] | 92 | Bugs in the content should be reported to the Python bug tracker at |
| 93 | http://bugs.python.org. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 94 | |
Benjamin Peterson | 2c85ed5 | 2008-12-21 01:12:26 +0000 | [diff] [blame] | 95 | Bugs in the toolset should be reported in the Sphinx bug tracker at |
| 96 | http://www.bitbucket.org/birkenfeld/sphinx/issues/. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 97 | |
| 98 | You can also send a mail to the Python Documentation Team at docs@python.org, |
| 99 | and we will process your request as soon as possible. |
| 100 | |
| 101 | If you want to help the Documentation Team, you are always welcome. Just send |
| 102 | a mail to docs@python.org. |
| 103 | |
| 104 | |
| 105 | Copyright notice |
| 106 | ================ |
| 107 | |
| 108 | The Python source is copyrighted, but you can freely use and copy it |
| 109 | as long as you don't change or remove the copyright notice: |
| 110 | |
| 111 | ---------------------------------------------------------------------- |
Benjamin Peterson | 1aeb8cf | 2013-12-31 22:02:22 -0600 | [diff] [blame] | 112 | Copyright (c) 2000-2014 Python Software Foundation. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 113 | All rights reserved. |
| 114 | |
| 115 | Copyright (c) 2000 BeOpen.com. |
| 116 | All rights reserved. |
| 117 | |
| 118 | Copyright (c) 1995-2000 Corporation for National Research Initiatives. |
| 119 | All rights reserved. |
| 120 | |
| 121 | Copyright (c) 1991-1995 Stichting Mathematisch Centrum. |
| 122 | All rights reserved. |
| 123 | |
| 124 | See the file "license.rst" for information on usage and redistribution |
| 125 | of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 126 | ---------------------------------------------------------------------- |