Sphinx Documentation 1.5.3
Total Page:16
File Type:pdf, Size:1020Kb
Sphinx Documentation 1.5.3 Georg Brandl 7 14, 2017 Contents 1 1 1.1......................................................1 1.2......................................................2 1.3......................................................2 1.4......................................................2 2 3 2.1......................................................3 2.2......................................................3 2.3......................................................4 2.4......................................................4 2.5......................................................5 2.6......................................................6 2.7 Autodoc.................................................6 2.8......................................................6 3 sphinx-build 9 3.1 Makefile................................................. 11 4 sphinx-apidoc 13 5 reStructuredText 15 5.1...................................................... 15 5.2...................................................... 15 5.3...................................................... 16 5.4...................................................... 17 5.5...................................................... 18 5.6...................................................... 18 5.7...................................................... 19 5.8...................................................... 19 5.9...................................................... 19 5.10...................................................... 21 5.11...................................................... 22 5.12...................................................... 22 5.13...................................................... 22 5.14...................................................... 23 5.15...................................................... 23 i 5.16...................................................... 23 6 25 6.1 TOC................................................... 25 6.2...................................................... 28 6.3...................................................... 30 6.4...................................................... 30 6.5...................................................... 31 6.6...................................................... 31 6.7...................................................... 34 6.8...................................................... 38 7 43 7.1 ?..................................................... 43 7.2...................................................... 43 7.3...................................................... 44 7.4 Python.................................................. 45 7.5 C..................................................... 50 7.6 C++................................................... 51 7.7 JavaScript................................................ 52 7.8 reStructuredText............................................ 53 7.9 PHP................................................... 54 7.10...................................................... 59 8 61 8.1...................................................... 65 9 67 9.1...................................................... 67 9.2...................................................... 70 9.3...................................................... 71 9.4 HTML.................................................. 73 9.5 epub................................................... 77 9.6 LaTeX.................................................. 79 9.7 text.................................................... 82 9.8...................................................... 82 9.9 Texinfo.................................................. 83 9.10...................................................... 84 9.11 XML................................................... 84 10 85 11 HTML 87 11.1...................................................... 87 11.2...................................................... 89 11.3...................................................... 92 12 95 12.1 SphinxHTML?............................................. 95 12.2 Jinja/Sphinx.............................................. 95 12.3...................................................... 96 13 101 13.1 :..................................................... 101 13.2...................................................... 106 ii 13.3...................................................... 115 13.4...................................................... 116 13.5...................................................... 139 14 141 14.1 Web................................................... 141 14.2 Web................................................... 145 14.3...................................................... 148 14.4...................................................... 150 15 153 15.1 ........................................................ 153 15.2 Sphinx.................................................... 153 15.3 Epub................................................... 154 15.4 Texinfo.................................................. 155 16 157 17 159 17.1 Bug.................................................... 159 17.2 Sphinx.................................................. 160 17.3...................................................... 161 18 Sphinx 163 18.1 1.2 ()................................................... 163 18.2 1.1.3 (Mar 10, 2012).......................................... 165 18.3 1.1.2 (Nov 1, 2011) – 1.1.1!....................................... 165 18.4 Release 1.1.1 (Nov 1, 2011)...................................... 166 18.5 Release 1.1 (Oct 9, 2011)........................................ 166 18.6 Release 1.0.8 (Sep 23, 2011)...................................... 168 18.7 Release 1.0.7 (Jan 15, 2011)...................................... 169 18.8 Release 1.0.6 (Jan 04, 2011)...................................... 170 18.9 Release 1.0.5 (Nov 12, 2010)...................................... 170 18.10 Release 1.0.4 (Sep 17, 2010)...................................... 170 18.11 Release 1.0.3 (Aug 23, 2010)...................................... 170 18.12 Release 1.0.2 (Aug 14, 2010)...................................... 171 18.13 Release 1.0.1 (Jul 27, 2010)....................................... 171 18.14 Release 1.0 (Jul 23, 2010)........................................ 172 18.15 Release 0.6.7 (Jun 05, 2010)...................................... 175 18.16 Release 0.6.6 (May 25, 2010)...................................... 175 18.17 Release 0.6.5 (Mar 01, 2010)...................................... 175 18.18 Release 0.6.4 (Jan 12, 2010)...................................... 176 18.19 Release 0.6.3 (Sep 03, 2009)...................................... 176 18.20 Release 0.6.2 (Jun 16, 2009)...................................... 177 18.21 Release 0.6.1 (Mar 26, 2009)...................................... 178 18.22 Release 0.6 (Mar 24, 2009)....................................... 178 18.23 Release 0.5.2 (Mar 24, 2009)...................................... 181 18.24 Release 0.5.1 (Dec 15, 2008)...................................... 181 18.25 Release 0.5 (Nov 23, 2008) – Birthday release!............................ 182 18.26 Release 0.4.3 (Oct 8, 2008)....................................... 185 18.27 Release 0.4.2 (Jul 29, 2008)....................................... 185 18.28 Release 0.4.1 (Jul 5, 2008)....................................... 186 18.29 Release 0.4 (Jun 23, 2008)....................................... 186 18.30 Release 0.3 (May 6, 2008)....................................... 188 18.31 Release 0.2 (Apr 27, 2008)....................................... 189 iii 18.32 Release 0.1.61950 (Mar 26, 2008)................................... 190 18.33 Release 0.1.61945 (Mar 26, 2008)................................... 190 18.34 Release 0.1.61843 (Mar 24, 2008)................................... 191 18.35 Release 0.1.61798 (Mar 23, 2008)................................... 191 18.36 Release 0.1.61611 (Mar 21, 2008)................................... 191 19 Sphinx 193 19.1...................................................... 193 19.2...................................................... 195 19.3 sphinxdoc................................................ 195 19.4...................................................... 196 19.5...................................................... 196 19.6...................................................... 197 19.7 Sphinx.................................................. 198 Python 199 iv CHAPTER 1 This is the documentation for the Sphinx documentation builder. Sphinx is a tool that translates a set of reStructuredText3 source files into various output formats, automatically producing cross-references, indices etc. That is, if you have a directory containing a bunch of reST-formatted documents (and possibly subdirectories of docs in there as well), Sphinx can generate a nicely-organized arrangement of HTML files (in some other directory) for easy browsing and navigation. But from the same source, it can also generate a LaTeX file that you can compile into a PDF version of the documents, or a PDF file directly using rst2pdf4. The focus is on hand-written documentation, rather than auto-generated API docs. Though there is support for that kind of docs as well (which is intended to be freely mixed with hand-written content), if you need pure API docs have a look at Epydoc5, which also understands reST. This section is intended to collect helpful hints for those wanting to migrate to reStructuredText/Sphinx from other documentation systems. • Gerard Flanagan has written a script to