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: 2005-12-23 00:47:07 +0100 (Fri, 23 Dec 2005) $
7
:Revision: $Revision: 4230 $
8
:Description: This is a "docinfo block", or bibliographic field list
12
Section titles are underlined or overlined & underlined.
18
+--------------------------------+-----------------------------------+
19
| Paragraphs are flush-left, | Literal block, preceded by "::":: |
20
| separated by blank lines. | |
22
| Block quotes are indented. | |
23
+--------------------------------+ or:: |
24
| >>> print 'Doctest block' | |
25
| Doctest block | > Quoted |
26
+--------------------------------+-----------------------------------+
27
| | Line blocks preserve line breaks & indents. [new in 0.3.6] |
28
| | Useful for addresses, verse, and adornment-free lists; long |
29
| lines can be wrapped with continuation lines. |
30
+--------------------------------------------------------------------+
34
================ ============================================================
36
================ ============================================================
37
Bullet list * items begin with "-", "+", or "*"
38
Enumerated list 1. items use any variation of "1.", "A)", and "(i)"
39
#. also auto-enumerated
40
Definition list Term is flush-left : optional classifier
41
Definition is indented, no blank line between
42
Field list :field name: field body
43
Option list -o at least 2 spaces between option & description
44
================ ============================================================
46
================ ============================================================
47
Explicit Markup Examples (visible in the `text source <cheatsheet.txt>`_)
48
================ ============================================================
49
Footnote .. [1] Manually numbered or [#] auto-numbered
50
(even [#labelled]) or [*] auto-symbol
51
Citation .. [CIT2002] A citation.
52
Hyperlink Target .. _reStructuredText: http://docutils.sf.net/rst.html
53
.. _indirect target: reStructuredText_
55
Anonymous Target __ http://docutils.sf.net/docs/ref/rst/restructuredtext.html
56
Directive ("::") .. image:: images/biohazard.png
57
Substitution Def .. |substitution| replace:: like an inline directive
58
Comment .. is anything else
59
================ ============================================================
63
*emphasis*; **strong emphasis**; `interpreted text`; `interpreted text
64
with role`:emphasis:; ``inline literal text``; standalone hyperlink,
65
http://docutils.sourceforge.net; named reference, reStructuredText_;
66
`anonymous reference`__; footnote reference, [1]_; citation reference,
67
[CIT2002]_; |substitution|; _`inline internal target`.
69
Directive Quick Reference
70
=========================
71
See <http://docutils.sf.net/docs/ref/rst/directives.html> for full info.
73
================ ============================================================
74
Directive Name Description (Docutils version added to, in [brackets])
75
================ ============================================================
76
attention Specific admonition; also "caution", "danger",
77
"error", "hint", "important", "note", "tip", "warning"
78
admonition Generic titled admonition: ``.. admonition:: By The Way``
79
image ``.. image:: picture.png``; many options possible
80
figure Like "image", but with optional caption and legend
81
topic ``.. topic:: Title``; like a mini section
82
sidebar ``.. sidebar:: Title``; like a mini parallel document
83
parsed-literal A literal block with parsed inline markup
84
rubric ``.. rubric:: Informal Heading``
85
epigraph Block quote with class="epigraph"
86
highlights Block quote with class="highlights"
87
pull-quote Block quote with class="pull-quote"
88
compound Compound paragraphs [0.3.6]
89
container Generic block-level container element [0.3.10]
90
table Create a titled table [0.3.1]
91
list-table Create a table from a uniform two-level bullet list [0.3.8]
92
csv-table Create a table from CSV data (requires Python 2.3+) [0.3.4]
93
contents Generate a table of contents
94
sectnum Automatically number sections, subsections, etc.
95
header, footer Create document decorations [0.3.8]
96
target-notes Create an explicit footnote for each external target
97
meta HTML-specific metadata
98
include Read an external reST file as if it were inline
99
raw Non-reST data passed untouched to the Writer
100
replace Replacement text for substitution definitions
101
unicode Unicode character code conversion for substitution defs
102
date Generates today's date; for substitution defs
103
class Set a "class" attribute on the next element
104
role Create a custom interpreted text role [0.3.2]
105
default-role Set the default interpreted text role [0.3.10]
106
title Set the metadata document title [0.3.10]
107
================ ============================================================
109
Interpreted Text Role Quick Reference
110
=====================================
111
See <http://docutils.sf.net/docs/ref/rst/roles.html> for full info.
113
================ ============================================================
114
Role Name Description
115
================ ============================================================
116
emphasis Equivalent to *emphasis*
117
literal Equivalent to ``literal`` but processes backslash escapes
118
PEP Reference to a numbered Python Enhancement Proposal
119
RFC Reference to a numbered Internet Request For Comments
120
raw For non-reST data; cannot be used directly (see docs) [0.3.6]
121
strong Equivalent to **strong**
124
title Title reference (book, etc.); standard default role
125
================ ============================================================