<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>6. Building the documentation — Python v3.2.2 documentation</title> <link rel="stylesheet" href="../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '3.2.2', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/sidebar.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within Python v3.2.2 documentation" href="../_static/opensearch.xml"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="copyright" title="Copyright" href="../copyright.html" /> <link rel="top" title="Python v3.2.2 documentation" href="../index.html" /> <link rel="up" title="Documenting Python" href="index.html" /> <link rel="next" title="Python HOWTOs" href="../howto/index.html" /> <link rel="prev" title="5. Differences to the LaTeX markup" href="fromlatex.html" /> <link rel="shortcut icon" type="image/png" href="../_static/py.png" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="../howto/index.html" title="Python HOWTOs" accesskey="N">next</a> |</li> <li class="right" > <a href="fromlatex.html" title="5. Differences to the LaTeX markup" accesskey="P">previous</a> |</li> <li><img src="../_static/py.png" alt="" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="../index.html">Python v3.2.2 documentation</a> »</li> <li><a href="index.html" accesskey="U">Documenting Python</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="building-the-documentation"> <h1>6. Building the documentation<a class="headerlink" href="#building-the-documentation" title="Permalink to this headline">¶</a></h1> <p>You need to have Python 2.4 or higher installed; the toolset used to build the docs is written in Python. It is called <em>Sphinx</em>, it is not included in this tree, but maintained separately. Also needed are the docutils, supplying the base markup that Sphinx uses, Jinja, a templating engine, and optionally Pygments, a code highlighter.</p> <div class="section" id="using-make"> <h2>6.1. Using make<a class="headerlink" href="#using-make" title="Permalink to this headline">¶</a></h2> <p>Luckily, a Makefile has been prepared so that on Unix, provided you have installed Python and Subversion, you can just run</p> <div class="highlight-python3"><div class="highlight"><pre><span class="n">cd</span> <span class="n">Doc</span> <span class="n">make</span> <span class="n">html</span> </pre></div> </div> <p>to check out the necessary toolset in the <tt class="file docutils literal"><span class="pre">tools/</span></tt> subdirectory and build the HTML output files. To view the generated HTML, point your favorite browser at the top-level index <tt class="file docutils literal"><span class="pre">build/html/index.html</span></tt> after running “make”.</p> <p>Available make targets are:</p> <blockquote> <div><ul> <li><p class="first">“html”, which builds standalone HTML files for offline viewing.</p> </li> <li><p class="first">“htmlhelp”, which builds HTML files and a HTML Help project file usable to convert them into a single Compiled HTML (.chm) file – these are popular under Microsoft Windows, but very handy on every platform.</p> <p>To create the CHM file, you need to run the Microsoft HTML Help Workshop over the generated project (.hhp) file.</p> </li> <li><p class="first">“latex”, which builds LaTeX source files as input to “pdflatex” to produce PDF documents.</p> </li> <li><p class="first">“text”, which builds a plain text file for each source file.</p> </li> <li><p class="first">“linkcheck”, which checks all external references to see whether they are broken, redirected or malformed, and outputs this information to stdout as well as a plain-text (.txt) file.</p> </li> <li><p class="first">“changes”, which builds an overview over all versionadded/versionchanged/ deprecated items in the current version. This is meant as a help for the writer of the “What’s New” document.</p> </li> <li><p class="first">“coverage”, which builds a coverage overview for standard library modules and C API.</p> </li> <li><p class="first">“pydoc-topics”, which builds a Python module containing a dictionary with plain text documentation for the labels defined in <tt class="file docutils literal"><span class="pre">tools/sphinxext/pyspecific.py</span></tt> – pydoc needs these to show topic and keyword help.</p> </li> </ul> </div></blockquote> <p>A “make update” updates the Subversion checkouts in <tt class="file docutils literal"><span class="pre">tools/</span></tt>.</p> </div> <div class="section" id="without-make"> <h2>6.2. Without make<a class="headerlink" href="#without-make" title="Permalink to this headline">¶</a></h2> <p>You’ll need to install the Sphinx package, either by checking it out via</p> <div class="highlight-python3"><div class="highlight"><pre><span class="n">svn</span> <span class="n">co</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">svn</span><span class="o">.</span><span class="n">python</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">projects</span><span class="o">/</span><span class="n">external</span><span class="o">/</span><span class="n">Sphinx</span><span class="o">-</span><span class="mf">0.6</span><span class="o">.</span><span class="mi">5</span><span class="o">/</span><span class="n">sphinx</span> <span class="n">tools</span><span class="o">/</span><span class="n">sphinx</span> </pre></div> </div> <p>or by installing it from PyPI.</p> <p>Then, you need to install Docutils, either by checking it out via</p> <div class="highlight-python3"><div class="highlight"><pre><span class="n">svn</span> <span class="n">co</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">svn</span><span class="o">.</span><span class="n">python</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">projects</span><span class="o">/</span><span class="n">external</span><span class="o">/</span><span class="n">docutils</span><span class="o">-</span><span class="mf">0.6</span><span class="o">/</span><span class="n">docutils</span> <span class="n">tools</span><span class="o">/</span><span class="n">docutils</span> </pre></div> </div> <p>or by installing it from <a class="reference external" href="http://docutils.sf.net/">http://docutils.sf.net/</a>.</p> <p>You also need Jinja2, either by checking it out via</p> <div class="highlight-python3"><div class="highlight"><pre><span class="n">svn</span> <span class="n">co</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">svn</span><span class="o">.</span><span class="n">python</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">projects</span><span class="o">/</span><span class="n">external</span><span class="o">/</span><span class="n">Jinja</span><span class="o">-</span><span class="mf">2.3</span><span class="o">.</span><span class="mi">1</span><span class="o">/</span><span class="n">jinja2</span> <span class="n">tools</span><span class="o">/</span><span class="n">jinja2</span> </pre></div> </div> <p>or by installing it from PyPI.</p> <p>You can optionally also install Pygments, either as a checkout via</p> <div class="highlight-python3"><div class="highlight"><pre><span class="n">svn</span> <span class="n">co</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">svn</span><span class="o">.</span><span class="n">python</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">projects</span><span class="o">/</span><span class="n">external</span><span class="o">/</span><span class="n">Pygments</span><span class="o">-</span><span class="mf">1.3</span><span class="o">.</span><span class="mi">1</span><span class="o">/</span><span class="n">pygments</span> <span class="n">tools</span><span class="o">/</span><span class="n">pygments</span> </pre></div> </div> <p>or from PyPI at <a class="reference external" href="http://pypi.python.org/pypi/Pygments">http://pypi.python.org/pypi/Pygments</a>.</p> <p>Then, make an output directory, e.g. under <cite>build/</cite>, and run</p> <div class="highlight-python3"><div class="highlight"><pre><span class="n">python</span> <span class="n">tools</span><span class="o">/</span><span class="n">sphinx</span><span class="o">-</span><span class="n">build</span><span class="o">.</span><span class="n">py</span> <span class="o">-</span><span class="n">b</span><span class="o"><</span><span class="n">builder</span><span class="o">></span> <span class="o">.</span> <span class="n">build</span><span class="o">/<</span><span class="n">outputdirectory</span><span class="o">></span> </pre></div> </div> <p>where <cite><builder></cite> is one of html, text, latex, or htmlhelp (for explanations see the make targets above).</p> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../contents.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">6. Building the documentation</a><ul> <li><a class="reference internal" href="#using-make">6.1. Using make</a></li> <li><a class="reference internal" href="#without-make">6.2. Without make</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="fromlatex.html" title="previous chapter">5. Differences to the LaTeX markup</a></p> <h4>Next topic</h4> <p class="topless"><a href="../howto/index.html" title="next chapter">Python HOWTOs</a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../bugs.html">Report a Bug</a></li> <li><a href="../_sources/documenting/building.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" size="18" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="../howto/index.html" title="Python HOWTOs" >next</a> |</li> <li class="right" > <a href="fromlatex.html" title="5. Differences to the LaTeX markup" >previous</a> |</li> <li><img src="../_static/py.png" alt="" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="../index.html">Python v3.2.2 documentation</a> »</li> <li><a href="index.html" >Documenting Python</a> »</li> </ul> </div> <div class="footer"> © <a href="../copyright.html">Copyright</a> 1990-2011, Python Software Foundation. <br /> The Python Software Foundation is a non-profit corporation. <a href="http://www.python.org/psf/donations/">Please donate.</a> <br /> Last updated on Sep 04, 2011. <a href="../bugs.html">Found a bug</a>? <br /> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7. </div> </body> </html>