`` -
a local table of contents for the sections in the current file only;
* ``rubric`` -
a heading without relation to the document's sections
that won't be included in any table of contents;
* ``topic`` and ``sidebar`` - special highlighted body elements;
* ``epigraph`` - a block quote with optional attribution line;
* ``container`` - a container with a custom class,
useful to generate an outer ```````` in HTML output.
* Special directives:
* ``include`` - include reStructuredText from another file;
* ``raw`` - include raw target-format markup, such as LaTeX;
* ``class`` - assign a class attribute to the next element.
.. _rst-contents-ref:
Table of contents
====================
To include a table of contents within a given document,
use the directive ``contents``.
The following example creates a local table of contents
with a maximum of two levels (below the level where it is located)::
Part II
#######
Chapter 1
*********
.. contents::
:depth: 2
:local:
Heading 1
=========
The ``toctree`` directive creates a table of contents
that collets information from several files.
The following example creates a table of contents
from the sections of various documents (up to a depth of 3 levels).
The ``:glob:`` option allows all documents in the 'chapter2' folder
to be included (sorted according to their name)::
.. toctree::
:glob:
:maxdepth: 3
preamble
chapter1/part1
chapter1/conclusion
chapter2/*
references
.. _rst-images-ref:
Images
------
reST supports an image directive, used like so::
.. image:: myImage.png
:width: 100%
:align: middle
The filename must either be relative to the source file,
or absolute (which means that they are relative to the top source directory).
.. _rst-figures-ref:
Figures
-------
A ``figure`` consists of image data (including image options),
an optional caption (a single paragraph),
and an optional legend (arbitrary body elements)::
.. figure:: picture.png
:scale: 50 %
:alt: map to buried treasure
This is the caption of the figure (a simple paragraph).
The legend consists of all elements after the caption. In this
case, the legend consists of this paragraph and the following
table:
+-----------------------+-----------------------+
| Symbol | Meaning |
+=======================+=======================+
| .. image:: tent.png | Campground |
+-----------------------+-----------------------+
| .. image:: waves.png | Lake |
+-----------------------+-----------------------+
| .. image:: peak.png | Mountain |
+-----------------------+-----------------------+
There must be blank lines before the caption paragraph and before the legend.
To specify a legend without a caption,
use an empty comment (``..``) in place of the caption.
.. _rst-footnotes-ref:
Footnotes
---------
For footnotes, use ``[#name]_`` to mark the footnote
location, and add the footnote body at the bottom of the document after a
"Footnotes" rubric heading, like so::
Lorem ipsum [#first-footnote-name]_ dolor sit amet [#second-footnote-name]_
.. rubric:: Footnotes
.. [#first-footnote-name] Text of the first footnote.
.. [#fsecond-footnote-name] Text of the second footnote.
You can also explicitly number the footnotes (``[1]_``) or use auto-numbered
footnotes without names (``[#]_``).
.. tip::
To facilitate editing, auto-numbered footnotes should **not** be used.
Instead, use short descriptive names (that simplify cross-referencing).
.. _rst-citations-ref:
Citations
---------
Standard reST citations are supported::
Lorem ipsum [Ref]_ dolor sit amet.
.. [Ref] Book or article reference, URL or whatever.
Citation usage is similar to footnote usage,
but with a label that is not numeric or begins with ``#``.
When the documentation is built using the Sphinx_ document generator,
the citations are "global",
meaning that every citation can be referenced from any .rst files.
In this case, a separate file may be created (e.g. a ``references.rst`` file).
.. tip::
See :ref:`rst-biblio-ref` for further information.
.. _rst-substitutions-ref:
Substitutions
-------------
reST supports "substitutions",
which are pieces of text and/or markup referred to in the text by ``|name|``.
They are defined like footnotes with explicit markup blocks, like this::
.. |name| replace:: replacement *text*
or this::
.. |caution| image:: warning.png
:alt: Warning!
If you want to use some substitutions for all documents,
put them into a separate file
(e.g. ``substitutions.txt``)
and include it into all documents you want to use them in,
using the ``include`` directive.
Be sure to use a file name extension
which different from that of other source files,
to avoid Sphinx finding it as a standalone document.
For example, use the ``.rst`` file extension for the source files,
and the ``.txt`` file extension for the files which are to be included.
.. tip::
This is useful in technical documentation such as User's Manuals,
where a substitution file can be built for each localised version
of the interface elements (menus, messages, etc),
guaranteeing the consistency of the document translation
with the software's human user interface.
.. warning::
Substitutions do NOT work inside directives (or inside the options of a directive).
Do not try to google for a solution (...been there).
It is a design limitation: RST markup can not be nested. Period.
.. warning::
Substitutions can be used with the ``image`` directive,
which is an inline element.
Substitutions can **not** be used with the ``figure`` directive,
which creates a block-level element.
.. _rst-comments-ref:
Comments
--------
Every explicit markup block
which isn't a valid markup construct is regarded as a comment.
For example::
.. This is a comment.
You can indent text after a comment start to form multiline comments::
..
This whole indented block
is a comment.
Still in the comment.
..
.. admonition:: This is a style convention.
Comments can also be used as placeholders
to mark places within the document.
For example:
* the ``.. links-placeholder`` can mark the place
where hyperlinks are kept together at the end of the document;
* the ``.. metadata-placeholder`` can mark the place
where document metadata (author, date, etc)
is kept together at the beginning of the document.
.. links-placeholder
.. include:: ../_sharedFiles/Links.rst