reStructuredText#
Headlines#
Underline the title with punctuation marks
==========================================
Change the punctuation mark for subtitles
-----------------------------------------
Paragraphs#
A paragraph consists of one or more lines of non-indented text, separated from the material above and below by blank lines.
A paragraph consists of one or more lines of non-indented text, separated
from the material above and below by blank lines.
Inline markup#
Italic, bold and preformatted
*Italic*, **bold** and ``preformatted``
Links#
External links#
`hyperlink <http://en.wikipedia.org/wiki/Hyperlink>`_ `link`_
.. _link: http://en.wikipedia.org/wiki/Link_(The_Legend_of_Zelda)
Note
A directive starting with ..
must always be preceded by a blank line.
Internal links#
Cross-referencing locations#
Section to reference#
To refer to the section, use Section to reference.
.. _my-reference-label:
Section to reference
....................
To refer to the section, use :ref:`my-reference-label`.
Referencing documents#
Link to start page or Docstrings.
Link to :doc:`start page <../index>` or :doc:`docstrings`.
Download documents#
Link to a document, not rendered by Sphinx, for example
docstrings-example.rst
.
Link to a document, not rendered by Sphinx, for example
:download:`docstrings-example.rst`.
Images#
.. image:: uml/activity-diagram.svg
Other semantic markup#
File listing#
/Users/NAME/python-basics
:file:`/Users/{NAME}/python-basics`
Lists#
Numbered lists#
First
Second
Third
#. First
#. Second
#. Third
Unnumbered lists#
Each entry in a list begins with an Asterisk (
*
).List items can be displayed for multiple lines as long as the list items remain indented.
* Each entry in a list begins with an Asterisk (``*``).
* List items can be displayed for multiple lines as long as the list items
remain indented.
Definition lists#
- Term
Definition of the term
- Different term
…and its definition
Term
Definition of the term
Different term
…and its definition
Nested lists#
Lists can also be nested
and contain subitems
* Lists can also be nested
* and contain subitems
Literal blocks#
«Block quotation marks look like paragraphs, but are indented with one or more spaces.»
«Block quotation marks look like paragraphs, but are indented with one
or more spaces.»
Line blocks#
| Because of the pipe character, this becomes one line.
| And this will be another line.
Code blocks#
Blocks of code are introduced and indented with a colon:
import docutils
print help(docutils)
>>> print 'But doctests start with ">>>" and don’t need to be indented.'
Blocks of code are introduced and indented with a colon::
import docutils
print help(docutils)
>>> print 'But doctests start with ">>>" and don’t need to be indented.'
See also
Tables#
Column heading |
Column heading |
Column heading |
Column heading |
---|---|---|---|
body row 1, column 1 |
body row 1, column 2 |
body row 1, column 3 |
body row 1, column 4 |
body row 2, column 1 |
body row 2, column 2 |
body row 2, column 3, colspan 2 |
|
body row 3, column 1 |
body row 3, column 2 |
body row 3, column 3, rowspan 2 |
body row 4, column 4 |
body row 5, column 1 |
body row 5, column 2 |
body row 5, column 4 |
+----------------+----------------+----------------+----------------+
| Column heading | Column heading | Column heading | Column heading |
+================+================+================+================+
| body row 1, | body row 1, | body row 1, | body row 1, |
| column 1 | column 2 | column 3 | column 4 |
+----------------+----------------+----------------+----------------+
| body row 2, | body row 2, | body row 2, |
| column 1 | column 2 | column 3, colspan 2 |
+----------------+----------------+----------------+----------------+
| body row 3, | body row 3, | body row 3, | body row 4, |
| column 1 | column 2 | column 3, | column 4 |
+----------------+----------------+ rowspan 2 +----------------+
| body row 5, | body row 5, | | body row 5, |
| column 1 | column 2 | | column 4 |
+----------------+----------------+----------------+----------------+
Comments#
.. A comment block begins with two points and can be indented further