reStructuredText Cheat Sheet¶
Note
Above Table of Contents is generated like so:
.. contents::
:local:
HTML metadata given like so (best at the top of the page)
.. meta::
:description: Sphinx/reStructured text markup cheat sheet
:keywords: sphinx, restructured text, cheat sheet
Further Information¶
Links¶
Local Documents¶
:doc:`../index`
|
|
:doc:`index`
|
|
:doc:`/index`
|
|
:doc:`Overridden Title </index>`
|
External Links¶
`LWN.net (my favorite site) <https://lwn.net/>`__
|
Section References¶
References to a section in the middle of a document requires
Adding a section label
Referring to that label using the
:ref:
role (either from inside the same document, or from any other document)
Note
Section label must be unique across the tree
Example follows …
Section That We Refer To¶
This section is referred to by the next section. It requires a section label, like so:
.. _dummy-section:
Dummy Section That We Refer To
``````````````````````````````
This section is referred to by the next section.
Another Section Contains a Link To The Referred Section Above¶
One refers to the label we created in the section above using the :ref:
role:
:ref:`dummy-section`
|
|
:ref:`Custom referred-to link name <dummy-section>`
|
Footnotes¶
A reference to a footnote [1]:
A reference to a footnote [#a_footnote]_:
A “Footnotes” footer block:
Footnotes
.. rubric:: Footnotes
.. [#a_footnote] Blah