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