2008-03-09 16:32:24 -05:00
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
2008-03-12 16:37:22 -05:00
|
|
|
This is the documentation for the Sphinx documentation builder. Sphinx is a
|
|
|
|
tool that translates a set of reStructuredText_ source files into various output
|
2018-01-11 15:19:04 -06:00
|
|
|
formats, automatically producing cross-references, indices, etc. That is, if
|
2008-08-23 10:04:45 -05:00
|
|
|
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
|
2017-06-05 07:51:35 -05:00
|
|
|
browsing and navigation. But from the same source, it can also generate a PDF
|
|
|
|
file using LaTeX, `rinohtype`_ or `rst2pdf`_ (see :ref:`builders`).
|
2008-03-09 16:32:24 -05:00
|
|
|
|
2008-03-18 02:39:40 -05:00
|
|
|
The focus is on hand-written documentation, rather than auto-generated API docs.
|
2017-06-05 07:51:35 -05:00
|
|
|
Though there is support for that kind of documentation as well (which is
|
|
|
|
intended to be freely mixed with hand-written content), if you need pure API
|
|
|
|
docs have a look at `Epydoc <http://epydoc.sourceforge.net/>`_, which also
|
|
|
|
understands reST.
|
2008-03-18 02:39:40 -05:00
|
|
|
|
2014-01-12 05:44:36 -06:00
|
|
|
For a great "introduction" to writing docs in general -- the whys and hows, see
|
2018-01-07 11:08:29 -06:00
|
|
|
also `Write the docs <https://write-the-docs.readthedocs.io/>`_, written by Eric
|
2014-01-12 05:44:36 -06:00
|
|
|
Holscher.
|
|
|
|
|
2017-06-05 07:51:35 -05:00
|
|
|
.. _rinohtype: https://github.com/brechtm/rinohtype
|
|
|
|
.. _rst2pdf: https://github.com/rst2pdf/rst2pdf
|
2008-09-09 14:24:08 -05:00
|
|
|
|
|
|
|
Conversion from other systems
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
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 convert pure HTML to reST; it can be
|
2014-01-12 17:05:22 -06:00
|
|
|
found at the `Python Package Index <https://pypi.python.org/pypi/html2rest>`_.
|
2008-09-09 14:24:08 -05:00
|
|
|
|
|
|
|
* For converting the old Python docs to Sphinx, a converter was written which
|
|
|
|
can be found at `the Python SVN repository
|
|
|
|
<http://svn.python.org/projects/doctools/converter>`_. It contains generic
|
2008-09-24 10:50:37 -05:00
|
|
|
code to convert Python-doc-style LaTeX markup to Sphinx reST.
|
2008-09-09 14:24:08 -05:00
|
|
|
|
2009-08-04 15:39:17 -05:00
|
|
|
* Marcin Wojdyr has written a script to convert Docbook to reST with Sphinx
|
2018-01-11 15:19:04 -06:00
|
|
|
markup; it is at `GitHub <https://github.com/wojdyr/db2rst>`_.
|
2009-08-04 15:39:17 -05:00
|
|
|
|
2011-09-23 04:36:32 -05:00
|
|
|
* Christophe de Vienne wrote a tool to convert from Open/LibreOffice documents
|
2014-01-12 17:05:22 -06:00
|
|
|
to Sphinx: `odt2sphinx <https://pypi.python.org/pypi/odt2sphinx/>`_.
|
2011-09-23 04:36:32 -05:00
|
|
|
|
2016-02-13 09:00:42 -06:00
|
|
|
* To convert different markups, `Pandoc <http://pandoc.org/>`_ is
|
2011-09-22 07:05:03 -05:00
|
|
|
a very helpful tool.
|
|
|
|
|
2008-09-09 14:24:08 -05:00
|
|
|
|
2010-02-28 15:00:22 -06:00
|
|
|
Use with other systems
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
See the :ref:`pertinent section in the FAQ list <usingwith>`.
|
|
|
|
|
|
|
|
|
2008-03-09 16:32:24 -05:00
|
|
|
Prerequisites
|
|
|
|
-------------
|
|
|
|
|
2016-09-01 11:19:47 -05:00
|
|
|
Sphinx needs at least **Python 2.7** or **Python 3.4** to run, as well as the
|
2013-12-15 01:25:01 -06:00
|
|
|
docutils_ and Jinja2_ libraries. Sphinx should work with docutils version 0.10
|
2010-07-28 12:49:06 -05:00
|
|
|
or some (not broken) SVN trunk snapshot. If you like to have source code
|
|
|
|
highlighting support, you must also install the Pygments_ library.
|
2008-03-12 16:37:22 -05:00
|
|
|
|
2016-02-13 09:00:42 -06:00
|
|
|
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
|
|
|
|
.. _docutils: http://docutils.sourceforge.net/
|
2011-01-15 19:36:34 -06:00
|
|
|
.. _Jinja2: http://jinja.pocoo.org/
|
2010-07-10 09:50:32 -05:00
|
|
|
.. _Pygments: http://pygments.org/
|
2008-03-12 16:37:22 -05:00
|
|
|
|
|
|
|
|
2010-02-28 15:00:22 -06:00
|
|
|
Usage
|
|
|
|
-----
|
2008-03-12 16:37:22 -05:00
|
|
|
|
2010-03-01 07:53:30 -06:00
|
|
|
See :doc:`tutorial` for an introduction. It also contains links to more
|
|
|
|
advanced sections in this manual for the topics it discusses.
|