Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 1 | Building the documentation |
| 2 | ========================== |
| 3 | |
| 4 | You need to have Python 2.4 or higher installed; the toolset used to build the |
| 5 | docs is written in Python. It is called *Sphinx*, it is not included in this |
| 6 | tree, but maintained separately. Also needed are the docutils, supplying the |
| 7 | base markup that Sphinx uses, Jinja, a templating engine, and optionally |
| 8 | Pygments, a code highlighter. |
| 9 | |
| 10 | |
| 11 | Using make |
| 12 | ---------- |
| 13 | |
| 14 | Luckily, a Makefile has been prepared so that on Unix, provided you have |
| 15 | installed Python and Subversion, you can just run :: |
| 16 | |
| 17 | make html |
| 18 | |
Senthil Kumaran | 916bd38 | 2010-10-15 12:55:19 +0000 | [diff] [blame] | 19 | to check out the necessary toolset in the :file:`tools/` subdirectory and build |
| 20 | the HTML output files. To view the generated HTML, point your favorite browser |
| 21 | at the top-level index :file:`build/html/index.html` after running "make". |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 22 | |
| 23 | Available make targets are: |
| 24 | |
| 25 | * "html", which builds standalone HTML files for offline viewing. |
| 26 | |
| 27 | * "htmlhelp", which builds HTML files and a HTML Help project file usable to |
| 28 | convert them into a single Compiled HTML (.chm) file -- these are popular |
| 29 | under Microsoft Windows, but very handy on every platform. |
| 30 | |
| 31 | To create the CHM file, you need to run the Microsoft HTML Help Workshop |
| 32 | over the generated project (.hhp) file. |
| 33 | |
| 34 | * "latex", which builds LaTeX source files as input to "pdflatex" to produce |
| 35 | PDF documents. |
| 36 | |
| 37 | * "text", which builds a plain text file for each source file. |
| 38 | |
| 39 | * "linkcheck", which checks all external references to see whether they are |
| 40 | broken, redirected or malformed, and outputs this information to stdout |
| 41 | as well as a plain-text (.txt) file. |
| 42 | |
| 43 | * "changes", which builds an overview over all versionadded/versionchanged/ |
| 44 | deprecated items in the current version. This is meant as a help for the |
| 45 | writer of the "What's New" document. |
| 46 | |
| 47 | * "coverage", which builds a coverage overview for standard library modules |
| 48 | and C API. |
| 49 | |
| 50 | * "pydoc-topics", which builds a Python module containing a dictionary with |
| 51 | plain text documentation for the labels defined in |
Senthil Kumaran | 916bd38 | 2010-10-15 12:55:19 +0000 | [diff] [blame] | 52 | :file:`tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic and |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 53 | keyword help. |
| 54 | |
Senthil Kumaran | 916bd38 | 2010-10-15 12:55:19 +0000 | [diff] [blame] | 55 | A "make update" updates the Subversion checkouts in :file:`tools/`. |
Benjamin Peterson | d7c3ed5 | 2010-06-27 22:32:30 +0000 | [diff] [blame] | 56 | |
| 57 | |
| 58 | Without make |
| 59 | ------------ |
| 60 | |
| 61 | You'll need to install the Sphinx package, either by checking it out via :: |
| 62 | |
| 63 | svn co http://svn.python.org/projects/external/Sphinx-0.6.5/sphinx tools/sphinx |
| 64 | |
| 65 | or by installing it from PyPI. |
| 66 | |
| 67 | Then, you need to install Docutils, either by checking it out via :: |
| 68 | |
| 69 | svn co http://svn.python.org/projects/external/docutils-0.6/docutils tools/docutils |
| 70 | |
| 71 | or by installing it from http://docutils.sf.net/. |
| 72 | |
| 73 | You also need Jinja2, either by checking it out via :: |
| 74 | |
| 75 | svn co http://svn.python.org/projects/external/Jinja-2.3.1/jinja2 tools/jinja2 |
| 76 | |
| 77 | or by installing it from PyPI. |
| 78 | |
| 79 | You can optionally also install Pygments, either as a checkout via :: |
| 80 | |
| 81 | svn co http://svn.python.org/projects/external/Pygments-1.3.1/pygments tools/pygments |
| 82 | |
| 83 | or from PyPI at http://pypi.python.org/pypi/Pygments. |
| 84 | |
| 85 | |
| 86 | Then, make an output directory, e.g. under `build/`, and run :: |
| 87 | |
| 88 | python tools/sphinx-build.py -b<builder> . build/<outputdirectory> |
| 89 | |
| 90 | where `<builder>` is one of html, text, latex, or htmlhelp (for explanations see |
| 91 | the make targets above). |