1 =====================================================
2 The reStructuredText_ Cheat Sheet: Syntax Reminders
3 =====================================================
4 :Info: See <http://docutils.sf.net/rst.html> for introductory docs.
5 :Author: David Goodger <goodger@python.org>
6 :Date: $Date: 2021-03-05 22:14:40 +0100 (Fr, 05. Mär 2021) $
7 :Revision: $Revision: 8631 $
8 :Description: This is a "docinfo block", or bibliographic field list
10 .. NOTE:: If you are reading this as HTML, please read
11 `<index.rst>`_ instead to see the input syntax examples!
15 Section titles are underlined or overlined & underlined.
21 +--------------------------------+-----------------------------------+
22 | Paragraphs are flush-left, | Literal block, preceded by "::":: |
23 | separated by blank lines. | |
25 | Block quotes are indented. | |
26 +--------------------------------+ or:: |
27 | >>> print 'Doctest block' | |
28 | Doctest block | > Quoted |
29 +--------------------------------+-----------------------------------+
30 | | Line blocks preserve line breaks & indents. [new in 0.3.6] |
31 | | Useful for addresses, verse, and adornment-free lists; long |
32 | lines can be wrapped with continuation lines. |
33 +--------------------------------------------------------------------+
37 ================ ============================================================
38 List Type Examples (syntax in the `text source <index.rst>`_)
39 ================ ============================================================
40 Bullet list * items begin with "-", "+", or "*"
41 Enumerated list 1. items use any variation of "1.", "A)", and "(i)"
42 #. also auto-enumerated
43 Definition list Term is flush-left : optional classifier
44 Definition is indented, no blank line between
45 Field list :field name: field body
46 Option list -o at least 2 spaces between option & description
47 ================ ============================================================
49 ================ ============================================================
50 Explicit Markup Examples (visible in the `text source`_)
51 ================ ============================================================
52 Footnote .. [1] Manually numbered or [#] auto-numbered
53 (even [#labelled]) or [*] auto-symbol
54 Citation .. [CIT2002] A citation.
55 Hyperlink Target .. _reStructuredText: http://docutils.sf.net/rst.html
56 .. _indirect target: reStructuredText_
58 Anonymous Target __ http://docutils.sf.net/docs/ref/rst/restructuredtext.html
59 Directive ("::") .. image:: images/biohazard.png
60 Substitution Def .. |substitution| replace:: like an inline directive
61 Comment .. is anything else
62 Empty Comment (".." on a line by itself, with blank lines before & after,
63 used to separate indentation contexts)
64 ================ ============================================================
68 *emphasis*; **strong emphasis**; `interpreted text`; `interpreted text
69 with role`:emphasis:; ``inline literal text``; standalone hyperlink,
70 http://docutils.sourceforge.net; named reference, reStructuredText_;
71 `anonymous reference`__; footnote reference, [1]_; citation reference,
72 [CIT2002]_; |substitution|; _`inline internal target`.
74 Directive Quick Reference
75 =========================
76 See <http://docutils.sf.net/docs/ref/rst/directives.html> for full info.
78 ================ ============================================================
79 Directive Name Description (Docutils version added to, in [brackets])
80 ================ ============================================================
81 attention Specific admonition; also "caution", "danger",
82 "error", "hint", "important", "note", "tip", "warning"
83 admonition Generic titled admonition: ``.. admonition:: By The Way``
84 image ``.. image:: picture.png``; many options possible
85 figure Like "image", but with optional caption and legend
86 topic ``.. topic:: Title``; like a mini section
87 sidebar ``.. sidebar:: Title``; like a mini parallel document
88 parsed-literal A literal block with parsed inline markup
89 rubric ``.. rubric:: Informal Heading``
90 epigraph Block quote with class="epigraph"
91 highlights Block quote with class="highlights"
92 pull-quote Block quote with class="pull-quote"
93 compound Compound paragraphs [0.3.6]
94 container Generic block-level container element [0.3.10]
95 table Create a titled table [0.3.1]
96 list-table Create a table from a uniform two-level bullet list [0.3.8]
97 csv-table Create a table from CSV data [0.3.4]
98 contents Generate a table of contents
99 sectnum Automatically number sections, subsections, etc.
100 header, footer Create document decorations [0.3.8]
101 target-notes Create an explicit footnote for each external target
102 math Mathematical notation (input in LaTeX format)
103 meta Document metadata
104 include Read an external reST file as if it were inline
105 raw Non-reST data passed untouched to the Writer
106 replace Replacement text for substitution definitions
107 unicode Unicode character code conversion for substitution defs
108 date Generates today's date; for substitution defs
109 class Set a "class" attribute on the next element
110 role Create a custom interpreted text role [0.3.2]
111 default-role Set the default interpreted text role [0.3.10]
112 title Set the metadata document title [0.3.10]
113 ================ ============================================================
115 Interpreted Text Role Quick Reference
116 =====================================
117 See <http://docutils.sf.net/docs/ref/rst/roles.html> for full info.
119 ================ ============================================================
120 Role Name Description
121 ================ ============================================================
122 emphasis Equivalent to *emphasis*
123 literal Equivalent to ``literal`` but processes backslash escapes
124 math Mathematical notation (input in LaTeX format)
125 PEP Reference to a numbered Python Enhancement Proposal
126 RFC Reference to a numbered Internet Request For Comments
127 raw For non-reST data; cannot be used directly (see docs) [0.3.6]
128 strong Equivalent to **strong**
131 title Title reference (book, etc.); standard default role
132 ================ ============================================================