root / PyCon07 / material / cheatsheet.txt

Revision 19:8f9db9946360, 6.7 kB (checked in by Tarek Ziad?? <tarek@…>, 21 months ago)

added reST cheatsheet

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