mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
rewrapping paragraphs when over 80 characters wide
This commit is contained in:
@@ -495,9 +495,10 @@ that use Sphinx' HTMLWriter class.
|
|||||||
.. confval:: html_favicon
|
.. confval:: html_favicon
|
||||||
|
|
||||||
If given, this must be the name of an image file (path relative to the
|
If given, this must be the name of an image file (path relative to the
|
||||||
:term:`configuration directory`) that is the favicon of the docs. Modern browsers use this
|
:term:`configuration directory`) that is the favicon of the docs. Modern
|
||||||
as icon for tabs, windows and bookmarks. It should be a Windows-style icon
|
browsers use this as the icon for tabs, windows and bookmarks. It should
|
||||||
file (``.ico``), which is 16x16 or 32x32 pixels large. Default: ``None``.
|
be a Windows-style icon file (``.ico``), which is 16x16 or 32x32
|
||||||
|
pixels large. Default: ``None``.
|
||||||
|
|
||||||
.. versionadded:: 0.4
|
.. versionadded:: 0.4
|
||||||
The image file will be copied to the ``_static`` directory of the output
|
The image file will be copied to the ``_static`` directory of the output
|
||||||
@@ -582,7 +583,8 @@ that use Sphinx' HTMLWriter class.
|
|||||||
|
|
||||||
Builtin sidebar templates that can be rendered are:
|
Builtin sidebar templates that can be rendered are:
|
||||||
|
|
||||||
* **localtoc.html** -- a fine-grained table of contents of the current document
|
* **localtoc.html** -- a fine-grained table of contents of the current
|
||||||
|
document
|
||||||
* **globaltoc.html** -- a coarse-grained table of contents for the whole
|
* **globaltoc.html** -- a coarse-grained table of contents for the whole
|
||||||
documentation set, collapsed
|
documentation set, collapsed
|
||||||
* **relations.html** -- two links to the previous and next documents
|
* **relations.html** -- two links to the previous and next documents
|
||||||
@@ -699,13 +701,14 @@ that use Sphinx' HTMLWriter class.
|
|||||||
.. confval:: html_translator_class
|
.. confval:: html_translator_class
|
||||||
|
|
||||||
A string with the fully-qualified name of a HTML Translator class, that is, a
|
A string with the fully-qualified name of a HTML Translator class, that is, a
|
||||||
subclass of Sphinx' :class:`~sphinx.writers.html.HTMLTranslator`, that is used
|
subclass of Sphinx' :class:`~sphinx.writers.html.HTMLTranslator`, that is
|
||||||
to translate document trees to HTML. Default is ``None`` (use the builtin
|
used to translate document trees to HTML. Default is ``None`` (use the
|
||||||
translator).
|
builtin translator).
|
||||||
|
|
||||||
.. confval:: html_show_copyright
|
.. confval:: html_show_copyright
|
||||||
|
|
||||||
If true, "(C) Copyright ..." is shown in the HTML footer. Default is ``True``.
|
If true, "(C) Copyright ..." is shown in the HTML footer. Default is
|
||||||
|
``True``.
|
||||||
|
|
||||||
.. versionadded:: 1.0
|
.. versionadded:: 1.0
|
||||||
|
|
||||||
@@ -1033,9 +1036,9 @@ These options influence LaTeX output.
|
|||||||
``'John \and Sarah'``.
|
``'John \and Sarah'``.
|
||||||
* *documentclass*: Normally, one of ``'manual'`` or ``'howto'`` (provided by
|
* *documentclass*: Normally, one of ``'manual'`` or ``'howto'`` (provided by
|
||||||
Sphinx). Other document classes can be given, but they must include the
|
Sphinx). Other document classes can be given, but they must include the
|
||||||
"sphinx" package in order to define Sphinx' custom LaTeX commands.
|
"sphinx" package in order to define Sphinx' custom LaTeX commands. "howto"
|
||||||
"howto" documents will not get appendices. Also, howtos will have a simpler
|
documents will not get appendices. Also, howtos will have a simpler title
|
||||||
title page.
|
page.
|
||||||
|
|
||||||
* *toctree_only*: Must be ``True`` or ``False``. If ``True``, the *startdoc*
|
* *toctree_only*: Must be ``True`` or ``False``. If ``True``, the *startdoc*
|
||||||
document itself is not included in the output, only the documents
|
document itself is not included in the output, only the documents
|
||||||
@@ -1182,7 +1185,8 @@ These options influence LaTeX output.
|
|||||||
``'\\printindex'``. Override if you want to generate the index
|
``'\\printindex'``. Override if you want to generate the index
|
||||||
differently or append some content after the index.
|
differently or append some content after the index.
|
||||||
|
|
||||||
* Keys that are set by other options and therefore should not be overridden are:
|
* Keys that are set by other options and therefore should not be overridden
|
||||||
|
are:
|
||||||
|
|
||||||
``'docclass'``
|
``'docclass'``
|
||||||
``'classoptions'``
|
``'classoptions'``
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ This is the current list of contributed extensions in that repository:
|
|||||||
- paverutils: an alternate integration of Sphinx with Paver_.
|
- paverutils: an alternate integration of Sphinx with Paver_.
|
||||||
- phpdomain: an extension for PHP support
|
- phpdomain: an extension for PHP support
|
||||||
- plantuml: embed UML diagram by using PlantUML_
|
- plantuml: embed UML diagram by using PlantUML_
|
||||||
- py_directive: Execute python code in a ``py`` directive and return a math node.
|
- py_directive: Execute python code in a ``py`` directive and return a math
|
||||||
|
node.
|
||||||
- rawfiles: copy raw files, like a CNAME.
|
- rawfiles: copy raw files, like a CNAME.
|
||||||
- requirements: declare requirements wherever you need (e.g. in test
|
- requirements: declare requirements wherever you need (e.g. in test
|
||||||
docstrings), mark statuses and collect them in a single list
|
docstrings), mark statuses and collect them in a single list
|
||||||
|
|||||||
@@ -113,8 +113,8 @@ These are the basic steps needed to start developing on Sphinx.
|
|||||||
* For bug fixes, first add a test that fails without your changes and passes
|
* For bug fixes, first add a test that fails without your changes and passes
|
||||||
after they are applied.
|
after they are applied.
|
||||||
|
|
||||||
#. Please add a bullet point to :file:`CHANGES` if the fix or feature is not trivial
|
#. Please add a bullet point to :file:`CHANGES` if the fix or feature is not
|
||||||
(small doc updates, typo fixes). Then commit::
|
trivial (small doc updates, typo fixes). Then commit::
|
||||||
|
|
||||||
hg commit -m '#42: Add useful new feature that does this.'
|
hg commit -m '#42: Add useful new feature that does this.'
|
||||||
|
|
||||||
@@ -191,9 +191,9 @@ identifier and put ``sphinx.po`` in there. Don't forget to update the possible
|
|||||||
values for :confval:`language` in ``doc/config.rst``.
|
values for :confval:`language` in ``doc/config.rst``.
|
||||||
|
|
||||||
The Sphinx core messages can also be translated on `Transifex
|
The Sphinx core messages can also be translated on `Transifex
|
||||||
<https://www.transifex.com/>`_. There exists a client tool named ``tx`` in the Python
|
<https://www.transifex.com/>`_. There exists a client tool named ``tx`` in the
|
||||||
package "transifex_client", which can be used to pull translations in ``.po``
|
Python package "transifex_client", which can be used to pull translations in
|
||||||
format from Transifex. To do this, go to ``sphinx/locale`` and then run
|
``.po`` format from Transifex. To do this, go to ``sphinx/locale`` and then run
|
||||||
``tx pull -f -l LANG`` where LANG is an existing language identifier. It is
|
``tx pull -f -l LANG`` where LANG is an existing language identifier. It is
|
||||||
good practice to run ``python setup.py update_catalog`` afterwards to make sure
|
good practice to run ``python setup.py update_catalog`` afterwards to make sure
|
||||||
the ``.po`` file has the canonical Babel formatting.
|
the ``.po`` file has the canonical Babel formatting.
|
||||||
|
|||||||
@@ -127,7 +127,8 @@ declarations:
|
|||||||
|
|
||||||
This directive marks the beginning of the description of a module (or package
|
This directive marks the beginning of the description of a module (or package
|
||||||
submodule, in which case the name should be fully qualified, including the
|
submodule, in which case the name should be fully qualified, including the
|
||||||
package name). It does not create content (like e.g. :rst:dir:`py:class` does).
|
package name). It does not create content (like e.g. :rst:dir:`py:class`
|
||||||
|
does).
|
||||||
|
|
||||||
This directive will also cause an entry in the global module index.
|
This directive will also cause an entry in the global module index.
|
||||||
|
|
||||||
@@ -655,9 +656,9 @@ There is a set of directives allowing documenting command-line programs:
|
|||||||
|
|
||||||
.. rst:directive:: .. program:: name
|
.. rst:directive:: .. program:: name
|
||||||
|
|
||||||
Like :rst:dir:`py:currentmodule`, this directive produces no output. Instead, it
|
Like :rst:dir:`py:currentmodule`, this directive produces no output.
|
||||||
serves to notify Sphinx that all following :rst:dir:`option` directives
|
Instead, it serves to notify Sphinx that all following :rst:dir:`option`
|
||||||
document options for the program called *name*.
|
directives document options for the program called *name*.
|
||||||
|
|
||||||
If you use :rst:dir:`program`, you have to qualify the references in your
|
If you use :rst:dir:`program`, you have to qualify the references in your
|
||||||
:rst:role:`option` roles by the program name, so if you have the following
|
:rst:role:`option` roles by the program name, so if you have the following
|
||||||
|
|||||||
@@ -274,13 +274,14 @@ inserting them into the page source under a suitable :rst:dir:`py:module`,
|
|||||||
"""Docstring for instance attribute spam."""
|
"""Docstring for instance attribute spam."""
|
||||||
|
|
||||||
.. versionchanged:: 0.6
|
.. versionchanged:: 0.6
|
||||||
:rst:dir:`autodata` and :rst:dir:`autoattribute` can now extract docstrings.
|
:rst:dir:`autodata` and :rst:dir:`autoattribute` can now extract
|
||||||
|
docstrings.
|
||||||
.. versionchanged:: 1.1
|
.. versionchanged:: 1.1
|
||||||
Comment docs are now allowed on the same line after an assignment.
|
Comment docs are now allowed on the same line after an assignment.
|
||||||
|
|
||||||
.. versionchanged:: 1.2
|
.. versionchanged:: 1.2
|
||||||
:rst:dir:`autodata` and :rst:dir:`autoattribute` have
|
:rst:dir:`autodata` and :rst:dir:`autoattribute` have an ``annotation``
|
||||||
an ``annotation`` option
|
option.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -413,8 +414,8 @@ autodoc provides the following additional events:
|
|||||||
``noindex`` that are true if the flag option of same name was given to the
|
``noindex`` that are true if the flag option of same name was given to the
|
||||||
auto directive
|
auto directive
|
||||||
:param signature: function signature, as a string of the form
|
:param signature: function signature, as a string of the form
|
||||||
``"(parameter_1, parameter_2)"``, or ``None`` if introspection didn't succeed
|
``"(parameter_1, parameter_2)"``, or ``None`` if introspection didn't
|
||||||
and signature wasn't specified in the directive.
|
succeed and signature wasn't specified in the directive.
|
||||||
:param return_annotation: function return annotation as a string of the form
|
:param return_annotation: function return annotation as a string of the form
|
||||||
``" -> annotation"``, or ``None`` if there is no return annotation
|
``" -> annotation"``, or ``None`` if there is no return annotation
|
||||||
|
|
||||||
@@ -445,8 +446,8 @@ member should be included in the documentation by using the following event:
|
|||||||
``"attribute"``)
|
``"attribute"``)
|
||||||
:param name: the fully qualified name of the object
|
:param name: the fully qualified name of the object
|
||||||
:param obj: the object itself
|
:param obj: the object itself
|
||||||
:param skip: a boolean indicating if autodoc will skip this member if the user
|
:param skip: a boolean indicating if autodoc will skip this member if the
|
||||||
handler does not override the decision
|
user handler does not override the decision
|
||||||
:param options: the options given to the directive: an object with attributes
|
:param options: the options given to the directive: an object with attributes
|
||||||
``inherited_members``, ``undoc_members``, ``show_inheritance`` and
|
``inherited_members``, ``undoc_members``, ``show_inheritance`` and
|
||||||
``noindex`` that are true if the flag option of same name was given to the
|
``noindex`` that are true if the flag option of same name was given to the
|
||||||
|
|||||||
@@ -15,15 +15,15 @@ one of them on a separate page makes them easier to read.
|
|||||||
|
|
||||||
The :mod:`sphinx.ext.autosummary` extension does this in two parts:
|
The :mod:`sphinx.ext.autosummary` extension does this in two parts:
|
||||||
|
|
||||||
1. There is an :rst:dir:`autosummary` directive for generating summary listings that
|
1. There is an :rst:dir:`autosummary` directive for generating summary listings
|
||||||
contain links to the documented items, and short summary blurbs extracted
|
that contain links to the documented items, and short summary blurbs
|
||||||
from their docstrings.
|
extracted from their docstrings.
|
||||||
|
|
||||||
2. Optionally, the convenience script :program:`sphinx-autogen` or the new
|
2. Optionally, the convenience script :program:`sphinx-autogen` or the new
|
||||||
:confval:`autosummary_generate` config value can be used to generate short
|
:confval:`autosummary_generate` config value can be used to generate short
|
||||||
"stub" files for the entries listed in the :rst:dir:`autosummary` directives.
|
"stub" files for the entries listed in the :rst:dir:`autosummary` directives.
|
||||||
These files by default contain only the corresponding :mod:`sphinx.ext.autodoc`
|
These files by default contain only the corresponding
|
||||||
directive, but can be customized with templates.
|
:mod:`sphinx.ext.autodoc` directive, but can be customized with templates.
|
||||||
|
|
||||||
|
|
||||||
.. rst:directive:: autosummary
|
.. rst:directive:: autosummary
|
||||||
@@ -62,8 +62,8 @@ The :mod:`sphinx.ext.autosummary` extension does this in two parts:
|
|||||||
|
|
||||||
**Options**
|
**Options**
|
||||||
|
|
||||||
* If you want the :rst:dir:`autosummary` table to also serve as a :rst:dir:`toctree`
|
* If you want the :rst:dir:`autosummary` table to also serve as a
|
||||||
entry, use the ``toctree`` option, for example::
|
:rst:dir:`toctree` entry, use the ``toctree`` option, for example::
|
||||||
|
|
||||||
.. autosummary::
|
.. autosummary::
|
||||||
:toctree: DIRNAME
|
:toctree: DIRNAME
|
||||||
@@ -78,8 +78,8 @@ The :mod:`sphinx.ext.autosummary` extension does this in two parts:
|
|||||||
directory. If no argument is given, output is placed in the same directory
|
directory. If no argument is given, output is placed in the same directory
|
||||||
as the file that contains the directive.
|
as the file that contains the directive.
|
||||||
|
|
||||||
* If you don't want the :rst:dir:`autosummary` to show function signatures in the
|
* If you don't want the :rst:dir:`autosummary` to show function signatures in
|
||||||
listing, include the ``nosignatures`` option::
|
the listing, include the ``nosignatures`` option::
|
||||||
|
|
||||||
.. autosummary::
|
.. autosummary::
|
||||||
:nosignatures:
|
:nosignatures:
|
||||||
@@ -112,8 +112,8 @@ For example, the command ::
|
|||||||
|
|
||||||
$ sphinx-autogen -o generated *.rst
|
$ sphinx-autogen -o generated *.rst
|
||||||
|
|
||||||
will read all :rst:dir:`autosummary` tables in the :file:`*.rst` files that have the
|
will read all :rst:dir:`autosummary` tables in the :file:`*.rst` files that have
|
||||||
``:toctree:`` option set, and output corresponding stub pages in directory
|
the ``:toctree:`` option set, and output corresponding stub pages in directory
|
||||||
``generated`` for all documented items. The generated pages by default contain
|
``generated`` for all documented items. The generated pages by default contain
|
||||||
text of the form::
|
text of the form::
|
||||||
|
|
||||||
|
|||||||
@@ -142,8 +142,8 @@ names.
|
|||||||
|
|
||||||
|
|
||||||
The following is an example for the usage of the directives. The test via
|
The following is an example for the usage of the directives. The test via
|
||||||
:rst:dir:`doctest` and the test via :rst:dir:`testcode` and :rst:dir:`testoutput` are
|
:rst:dir:`doctest` and the test via :rst:dir:`testcode` and
|
||||||
equivalent. ::
|
:rst:dir:`testoutput` are equivalent. ::
|
||||||
|
|
||||||
The parrot module
|
The parrot module
|
||||||
=================
|
=================
|
||||||
@@ -236,5 +236,5 @@ There are also these config values for customizing the doctest extension:
|
|||||||
Note though that you can't have blank lines in reST doctest blocks. They
|
Note though that you can't have blank lines in reST doctest blocks. They
|
||||||
will be interpreted as one block ending and another one starting. Also,
|
will be interpreted as one block ending and another one starting. Also,
|
||||||
removal of ``<BLANKLINE>`` and ``# doctest:`` options only works in
|
removal of ``<BLANKLINE>`` and ``# doctest:`` options only works in
|
||||||
:rst:dir:`doctest` blocks, though you may set :confval:`trim_doctest_flags` to
|
:rst:dir:`doctest` blocks, though you may set :confval:`trim_doctest_flags`
|
||||||
achieve that in all code blocks with Python console content.
|
to achieve that in all code blocks with Python console content.
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ linking:
|
|||||||
|
|
||||||
This will read the inventory from :file:`python-inv.txt` in the source
|
This will read the inventory from :file:`python-inv.txt` in the source
|
||||||
directory, but still generate links to the pages under
|
directory, but still generate links to the pages under
|
||||||
``http://docs.python.org/3.2``. It is up to you to update the inventory file as
|
``http://docs.python.org/3.2``. It is up to you to update the inventory file
|
||||||
new objects are added to the Python documentation.
|
as new objects are added to the Python documentation.
|
||||||
|
|
||||||
.. confval:: intersphinx_cache_limit
|
.. confval:: intersphinx_cache_limit
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ function that returns an URL based on the object.
|
|||||||
- ``py``: ``module`` (name of the module), ``fullname`` (name of the object)
|
- ``py``: ``module`` (name of the module), ``fullname`` (name of the object)
|
||||||
- ``c``: ``names`` (list of names for the object)
|
- ``c``: ``names`` (list of names for the object)
|
||||||
- ``cpp``: ``names`` (list of names for the object)
|
- ``cpp``: ``names`` (list of names for the object)
|
||||||
- ``javascript``: ``object`` (name of the object), ``fullname`` (name of the item)
|
- ``javascript``: ``object`` (name of the object), ``fullname``
|
||||||
|
(name of the item)
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ source code files.
|
|||||||
Getting Started
|
Getting Started
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
1. After :doc:`setting up Sphinx <../tutorial>` to build your docs, enable napoleon in the
|
1. After :doc:`setting up Sphinx <../tutorial>` to build your docs, enable
|
||||||
Sphinx `conf.py` file::
|
napoleon in the Sphinx `conf.py` file::
|
||||||
|
|
||||||
# conf.py
|
# conf.py
|
||||||
|
|
||||||
|
|||||||
@@ -26,5 +26,5 @@ There is also an additional config value:
|
|||||||
|
|
||||||
.. confval:: todo_include_todos
|
.. confval:: todo_include_todos
|
||||||
|
|
||||||
If this is ``True``, :rst:dir:`todo` and :rst:dir:`todolist` produce output, else
|
If this is ``True``, :rst:dir:`todo` and :rst:dir:`todolist` produce output,
|
||||||
they produce nothing. The default is ``False``.
|
else they produce nothing. The default is ``False``.
|
||||||
|
|||||||
@@ -16,4 +16,5 @@ descriptions that leads to the source code of the described object. A link back
|
|||||||
from the source to the description will also be inserted.
|
from the source to the description will also be inserted.
|
||||||
|
|
||||||
There are currently no configuration values for this extension; you just need to
|
There are currently no configuration values for this extension; you just need to
|
||||||
add ``'sphinx.ext.viewcode'`` to your :confval:`extensions` value for it to work.
|
add ``'sphinx.ext.viewcode'`` to your :confval:`extensions` value for it to
|
||||||
|
work.
|
||||||
|
|||||||
@@ -131,8 +131,8 @@ package.
|
|||||||
The directive class must inherit from the class
|
The directive class must inherit from the class
|
||||||
``docutils.parsers.rst.Directive``.
|
``docutils.parsers.rst.Directive``.
|
||||||
|
|
||||||
For example, the (already existing) :rst:dir:`literalinclude` directive would be
|
For example, the (already existing) :rst:dir:`literalinclude` directive would
|
||||||
added like this:
|
be added like this:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
@@ -232,8 +232,8 @@ package.
|
|||||||
directive it generates must be empty, and will produce no output.
|
directive it generates must be empty, and will produce no output.
|
||||||
|
|
||||||
That means that you can add semantic targets to your sources, and refer to
|
That means that you can add semantic targets to your sources, and refer to
|
||||||
them using custom roles instead of generic ones (like :rst:role:`ref`). Example
|
them using custom roles instead of generic ones (like :rst:role:`ref`).
|
||||||
call::
|
Example call::
|
||||||
|
|
||||||
app.add_crossref_type('topic', 'topic', 'single: %s', docutils.nodes.emphasis)
|
app.add_crossref_type('topic', 'topic', 'single: %s', docutils.nodes.emphasis)
|
||||||
|
|
||||||
|
|||||||
25
doc/faq.rst
25
doc/faq.rst
@@ -10,9 +10,9 @@ How do I...
|
|||||||
-----------
|
-----------
|
||||||
|
|
||||||
... create PDF files without LaTeX?
|
... create PDF files without LaTeX?
|
||||||
You can use `rst2pdf <http://rst2pdf.googlecode.com>`_ version 0.12 or greater
|
You can use `rst2pdf <http://rst2pdf.googlecode.com>`_ version 0.12 or
|
||||||
which comes with built-in Sphinx integration. See the :ref:`builders`
|
greater which comes with built-in Sphinx integration. See the
|
||||||
section for details.
|
:ref:`builders` section for details.
|
||||||
|
|
||||||
... get section numbers?
|
... get section numbers?
|
||||||
They are automatic in LaTeX output; for HTML, give a ``:numbered:`` option to
|
They are automatic in LaTeX output; for HTML, give a ``:numbered:`` option to
|
||||||
@@ -32,9 +32,9 @@ How do I...
|
|||||||
See the :ref:`extension tutorial <exttut>`.
|
See the :ref:`extension tutorial <exttut>`.
|
||||||
|
|
||||||
... convert from my existing docs using MoinMoin markup?
|
... convert from my existing docs using MoinMoin markup?
|
||||||
The easiest way is to convert to xhtml, then convert `xhtml to reST`_. You'll
|
The easiest way is to convert to xhtml, then convert `xhtml to reST`_.
|
||||||
still need to mark up classes and such, but the headings and code examples
|
You'll still need to mark up classes and such, but the headings and code
|
||||||
come through cleanly.
|
examples come through cleanly.
|
||||||
|
|
||||||
... create HTML slides from Sphinx documents?
|
... create HTML slides from Sphinx documents?
|
||||||
See the "Hieroglyph" package at https://github.com/nyergler/hieroglyph.
|
See the "Hieroglyph" package at https://github.com/nyergler/hieroglyph.
|
||||||
@@ -50,10 +50,11 @@ Using Sphinx with...
|
|||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
Read the Docs
|
Read the Docs
|
||||||
https://readthedocs.org is a documentation hosting service based around Sphinx.
|
https://readthedocs.org is a documentation hosting service based around
|
||||||
They will host sphinx documentation, along with supporting a number of other
|
Sphinx. They will host sphinx documentation, along with supporting a number
|
||||||
features including version support, PDF generation, and more. The `Getting
|
of other features including version support, PDF generation, and more. The
|
||||||
Started <http://read-the-docs.readthedocs.org/en/latest/getting_started.html>`_
|
`Getting Started
|
||||||
|
<http://read-the-docs.readthedocs.org/en/latest/getting_started.html>`_
|
||||||
guide is a good place to start.
|
guide is a good place to start.
|
||||||
|
|
||||||
Epydoc
|
Epydoc
|
||||||
@@ -70,8 +71,8 @@ SCons
|
|||||||
|
|
||||||
PyPI
|
PyPI
|
||||||
Jannis Leidel wrote a `setuptools command
|
Jannis Leidel wrote a `setuptools command
|
||||||
<https://pypi.python.org/pypi/Sphinx-PyPI-upload>`_ that automatically uploads
|
<https://pypi.python.org/pypi/Sphinx-PyPI-upload>`_ that automatically
|
||||||
Sphinx documentation to the PyPI package documentation area at
|
uploads Sphinx documentation to the PyPI package documentation area at
|
||||||
http://pythonhosted.org/.
|
http://pythonhosted.org/.
|
||||||
|
|
||||||
GitHub Pages
|
GitHub Pages
|
||||||
|
|||||||
@@ -37,11 +37,11 @@ Glossary
|
|||||||
document name
|
document name
|
||||||
Since reST source files can have different extensions (some people like
|
Since reST source files can have different extensions (some people like
|
||||||
``.txt``, some like ``.rst`` -- the extension can be configured with
|
``.txt``, some like ``.rst`` -- the extension can be configured with
|
||||||
:confval:`source_suffix`) and different OSes have different path separators,
|
:confval:`source_suffix`) and different OSes have different path
|
||||||
Sphinx abstracts them: :dfn:`document names` are always relative to the
|
separators, Sphinx abstracts them: :dfn:`document names` are always
|
||||||
:term:`source directory`, the extension is stripped, and path separators
|
relative to the :term:`source directory`, the extension is stripped, and
|
||||||
are converted to slashes. All values, parameters and such referring to
|
path separators are converted to slashes. All values, parameters and such
|
||||||
"documents" expect such document names.
|
referring to "documents" expect such document names.
|
||||||
|
|
||||||
Examples for document names are ``index``, ``library/zipfile``, or
|
Examples for document names are ``index``, ``library/zipfile``, or
|
||||||
``reference/datamodel/types``. Note that there is no leading or trailing
|
``reference/datamodel/types``. Note that there is no leading or trailing
|
||||||
@@ -70,8 +70,8 @@ Glossary
|
|||||||
|
|
||||||
object
|
object
|
||||||
The basic building block of Sphinx documentation. Every "object
|
The basic building block of Sphinx documentation. Every "object
|
||||||
directive" (e.g. :rst:dir:`function` or :rst:dir:`object`) creates such a block;
|
directive" (e.g. :rst:dir:`function` or :rst:dir:`object`) creates such a
|
||||||
and most objects can be cross-referenced to.
|
block; and most objects can be cross-referenced to.
|
||||||
|
|
||||||
role
|
role
|
||||||
A reStructuredText markup element that allows marking a piece of text.
|
A reStructuredText markup element that allows marking a piece of text.
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ task to split up paragraphs which are too large as there is no sane automated
|
|||||||
way to do that.
|
way to do that.
|
||||||
|
|
||||||
After Sphinx successfully ran the
|
After Sphinx successfully ran the
|
||||||
:class:`~sphinx.builders.gettext.MessageCatalogBuilder` you will find a collection
|
:class:`~sphinx.builders.gettext.MessageCatalogBuilder` you will find a
|
||||||
of ``.pot`` files in your output directory. These are **catalog templates**
|
collection of ``.pot`` files in your output directory. These are **catalog
|
||||||
and contain messages in your original language *only*.
|
templates** and contain messages in your original language *only*.
|
||||||
|
|
||||||
They can be delivered to translators which will transform them to ``.po`` files
|
They can be delivered to translators which will transform them to ``.po`` files
|
||||||
--- so called **message catalogs** --- containing a mapping from the original
|
--- so called **message catalogs** --- containing a mapping from the original
|
||||||
|
|||||||
@@ -83,8 +83,8 @@ The :program:`sphinx-build` script has several options:
|
|||||||
|
|
||||||
.. option:: -t tag
|
.. option:: -t tag
|
||||||
|
|
||||||
Define the tag *tag*. This is relevant for :rst:dir:`only` directives that only
|
Define the tag *tag*. This is relevant for :rst:dir:`only` directives that
|
||||||
include their content if this tag is set.
|
only include their content if this tag is set.
|
||||||
|
|
||||||
.. versionadded:: 0.6
|
.. versionadded:: 0.6
|
||||||
|
|
||||||
|
|||||||
@@ -102,12 +102,14 @@ Options
|
|||||||
Configuration can only be set with the -D option.
|
Configuration can only be set with the -D option.
|
||||||
-D <setting=value> Override a setting from the configuration file.
|
-D <setting=value> Override a setting from the configuration file.
|
||||||
-t <tag> Define *tag* for use in "only" blocks.
|
-t <tag> Define *tag* for use in "only" blocks.
|
||||||
-A <name=value> Pass a value into the HTML templates (only for HTML builders).
|
-A <name=value> Pass a value into the HTML templates (only for HTML
|
||||||
|
builders).
|
||||||
-n Run in nit-picky mode, warn about all missing references.
|
-n Run in nit-picky mode, warn about all missing references.
|
||||||
-v Increase verbosity (can be repeated).
|
-v Increase verbosity (can be repeated).
|
||||||
-N Prevent colored output.
|
-N Prevent colored output.
|
||||||
-q Quiet operation, just print warnings and errors on stderr.
|
-q Quiet operation, just print warnings and errors on stderr.
|
||||||
-Q Very quiet operation, don't print anything except for errors.
|
-Q Very quiet operation, don't print anything except for
|
||||||
|
errors.
|
||||||
-w <file> Write warnings and errors into the given file, in addition
|
-w <file> Write warnings and errors into the given file, in addition
|
||||||
to stderr.
|
to stderr.
|
||||||
-W Turn warnings into errors.
|
-W Turn warnings into errors.
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ option::
|
|||||||
|
|
||||||
This will produce line numbers for all code blocks longer than five lines.
|
This will produce line numbers for all code blocks longer than five lines.
|
||||||
|
|
||||||
For :rst:dir:`code-block` blocks, a ``linenos`` flag option can be given to switch
|
For :rst:dir:`code-block` blocks, a ``linenos`` flag option can be given to
|
||||||
on line numbers for the individual block::
|
switch on line numbers for the individual block::
|
||||||
|
|
||||||
.. code-block:: ruby
|
.. code-block:: ruby
|
||||||
:linenos:
|
:linenos:
|
||||||
@@ -119,10 +119,10 @@ Includes
|
|||||||
|
|
||||||
.. rst:directive:: .. literalinclude:: filename
|
.. rst:directive:: .. literalinclude:: filename
|
||||||
|
|
||||||
Longer displays of verbatim text may be included by storing the example text in
|
Longer displays of verbatim text may be included by storing the example text
|
||||||
an external file containing only plain text. The file may be included using the
|
in an external file containing only plain text. The file may be included
|
||||||
``literalinclude`` directive. [1]_ For example, to include the Python source file
|
using the ``literalinclude`` directive. [1]_ For example, to include the
|
||||||
:file:`example.py`, use::
|
Python source file :file:`example.py`, use::
|
||||||
|
|
||||||
.. literalinclude:: example.py
|
.. literalinclude:: example.py
|
||||||
|
|
||||||
|
|||||||
@@ -102,9 +102,10 @@ Cross-referencing arbitrary locations
|
|||||||
to, but you must give the link an explicit title, using this syntax:
|
to, but you must give the link an explicit title, using this syntax:
|
||||||
``:ref:`Link title <label-name>```.
|
``:ref:`Link title <label-name>```.
|
||||||
|
|
||||||
Using :rst:role:`ref` is advised over standard reStructuredText links to sections
|
Using :rst:role:`ref` is advised over standard reStructuredText links to
|
||||||
(like ```Section title`_``) because it works across files, when section
|
sections (like ```Section title`_``) because it works across files, when
|
||||||
headings are changed, and for all builders that support cross-references.
|
section headings are changed, and for all builders that support
|
||||||
|
cross-references.
|
||||||
|
|
||||||
|
|
||||||
Cross-referencing documents
|
Cross-referencing documents
|
||||||
@@ -349,8 +350,8 @@ the standard reST markup for that purpose.
|
|||||||
Substitutions
|
Substitutions
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
The documentation system provides three substitutions that are defined by default.
|
The documentation system provides three substitutions that are defined by
|
||||||
They are set in the build configuration file.
|
default. They are set in the build configuration file.
|
||||||
|
|
||||||
.. describe:: |release|
|
.. describe:: |release|
|
||||||
|
|
||||||
|
|||||||
@@ -58,10 +58,10 @@ Meta-information markup
|
|||||||
|
|
||||||
.. rst:directive:: .. codeauthor:: name <email>
|
.. rst:directive:: .. codeauthor:: name <email>
|
||||||
|
|
||||||
The :rst:dir:`codeauthor` directive, which can appear multiple times, names the
|
The :rst:dir:`codeauthor` directive, which can appear multiple times, names
|
||||||
authors of the described code, just like :rst:dir:`sectionauthor` names the
|
the authors of the described code, just like :rst:dir:`sectionauthor` names
|
||||||
author(s) of a piece of documentation. It too only produces output if the
|
the author(s) of a piece of documentation. It too only produces output if
|
||||||
:confval:`show_authors` configuration value is True.
|
the :confval:`show_authors` configuration value is True.
|
||||||
|
|
||||||
|
|
||||||
Index-generating markup
|
Index-generating markup
|
||||||
|
|||||||
@@ -70,12 +70,12 @@ units as well as normal text:
|
|||||||
external documents. These lists are created using the :rst:dir:`seealso`
|
external documents. These lists are created using the :rst:dir:`seealso`
|
||||||
directive.
|
directive.
|
||||||
|
|
||||||
The :rst:dir:`seealso` directive is typically placed in a section just before any
|
The :rst:dir:`seealso` directive is typically placed in a section just before
|
||||||
sub-sections. For the HTML output, it is shown boxed off from the main flow
|
any subsections. For the HTML output, it is shown boxed off from the main
|
||||||
of the text.
|
flow of the text.
|
||||||
|
|
||||||
The content of the :rst:dir:`seealso` directive should be a reST definition list.
|
The content of the :rst:dir:`seealso` directive should be a reST definition
|
||||||
Example::
|
list. Example::
|
||||||
|
|
||||||
.. seealso::
|
.. seealso::
|
||||||
|
|
||||||
@@ -206,8 +206,8 @@ the definition of the symbol. There is this directive:
|
|||||||
continuation line must begin with a colon placed at the same column as in the
|
continuation line must begin with a colon placed at the same column as in the
|
||||||
first line.
|
first line.
|
||||||
|
|
||||||
The argument to :rst:dir:`productionlist` serves to distinguish different sets of
|
The argument to :rst:dir:`productionlist` serves to distinguish different
|
||||||
production lists that belong to different grammars.
|
sets of production lists that belong to different grammars.
|
||||||
|
|
||||||
Blank lines are not allowed within ``productionlist`` directive arguments.
|
Blank lines are not allowed within ``productionlist`` directive arguments.
|
||||||
|
|
||||||
|
|||||||
@@ -484,5 +484,6 @@ There are some problems one commonly runs into while authoring reST documents:
|
|||||||
|
|
||||||
.. rubric:: Footnotes
|
.. rubric:: Footnotes
|
||||||
|
|
||||||
.. [1] When the default domain contains a :rst:dir:`class` directive, this directive
|
.. [1] When the default domain contains a :rst:dir:`class` directive, this
|
||||||
will be shadowed. Therefore, Sphinx re-exports it as :rst:dir:`rst-class`.
|
directive will be shadowed. Therefore, Sphinx re-exports it as
|
||||||
|
:rst:dir:`rst-class`.
|
||||||
|
|||||||
Reference in New Issue
Block a user