1 <?xml version=
"1.0" encoding=
"utf-8" ?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
6 <meta name=
"generator" content=
"Docutils 0.13: http://docutils.sourceforge.net/" />
7 <title>reStructuredText Test Document
</title>
8 <meta name=
"author" content=
"David Goodger" />
9 <meta name=
"authors" content=
"Me Myself I" />
10 <meta name=
"organization" content=
"humankind" />
11 <meta name=
"date" content=
"Now, or yesterday. Or maybe even before yesterday." />
12 <meta name=
"copyright" content=
"This document has been placed in the public domain. You may do with it as you wish. You may copy, modify, redistribute, reattribute, sell, buy, rent, lease, destroy, or improve it, quote it at length, excerpt, incorporate, collate, fold, staple, or mutilate it, or do anything else to it that your or anyone else's heart desires." />
13 <meta content=
"reStructuredText, test, parser" name=
"keywords" />
14 <meta content=
"A test document, containing at least one example of each reStructuredText construct." lang=
"en" name=
"description" />
15 <link rel=
"stylesheet" href=
"../input/data/html4css1.css" type=
"text/css" />
16 <link rel=
"stylesheet" href=
"../input/data/math.css" type=
"text/css" />
23 <div class=
"document" id=
"restructuredtext-test-document">
24 <span id=
"doctitle"></span>
25 <h1 class=
"title">reStructuredText Test Document
</h1>
26 <h2 class=
"subtitle" id=
"examples-of-syntax-constructs"><span id=
"subtitle"></span>Examples of Syntax Constructs
</h2>
27 <table class=
"docinfo" frame=
"void" rules=
"none">
28 <col class=
"docinfo-name" />
29 <col class=
"docinfo-content" />
31 <tr><th class=
"docinfo-name">Author:
</th>
32 <td>David Goodger
</td></tr>
33 <tr><th class=
"docinfo-name">Address:
</th>
34 <td><pre class=
"address">
40 <tr><th class=
"docinfo-name">Contact:
</th>
41 <td><a class=
"first last reference external" href=
"mailto:goodger@python.org">goodger
@python.org
</a></td></tr>
42 <tr><th class=
"docinfo-name">Authors:
</th>
46 <tr><th class=
"docinfo-name">Organization:
</th>
47 <td>humankind
</td></tr>
48 <tr><th class=
"docinfo-name">Date:
</th>
49 <td>Now, or yesterday. Or maybe even
<em>before
</em> yesterday.
</td></tr>
50 <tr><th class=
"docinfo-name">Status:
</th>
51 <td>This is a
"work in progress
"</td></tr>
52 <tr><th class=
"docinfo-name">Revision:
</th>
53 <td>is managed by a version control system.
</td></tr>
54 <tr><th class=
"docinfo-name">Version:
</th>
56 <tr><th class=
"docinfo-name">Copyright:
</th>
57 <td>This document has been placed in the public domain. You
58 may do with it as you wish. You may copy, modify,
59 redistribute, reattribute, sell, buy, rent, lease,
60 destroy, or improve it, quote it at length, excerpt,
61 incorporate, collate, fold, staple, or mutilate it, or do
62 anything else to it that your or anyone else's heart
64 <tr class=
"field"><th class=
"docinfo-name">field name:
</th><td class=
"field-body">This is a
"generic bibliographic field
".
</td>
66 <tr class=
"field"><th class=
"docinfo-name">field name
"2":
</th><td class=
"field-body"><p class=
"first">Generic bibliographic fields may contain multiple body elements.
</p>
67 <p class=
"last">Like this.
</p>
72 <div class=
"dedication topic">
73 <p class=
"topic-title first">Dedication
</p>
74 <p>For Docutils users
& co-developers.
</p>
76 <div class=
"abstract topic">
77 <p class=
"topic-title first">Abstract
</p>
78 <p>This is a test document, containing at least one example of each
79 reStructuredText construct.
</p>
81 <!-- This is a comment. Note how any initial comments are moved by
82 transforms to after the document title, subtitle, and docinfo. -->
83 <!-- Above is the document title, and below is the subtitle.
84 They are transformed from section titles after parsing. -->
85 <!-- bibliographic fields (which also require a transform): -->
86 <div class=
"contents topic" id=
"table-of-contents">
87 <p class=
"topic-title first">Table of Contents
</p>
88 <ul class=
"auto-toc simple">
89 <li><a class=
"reference internal" href=
"#structural-elements" id=
"id34">1 Structural Elements
</a><ul class=
"auto-toc">
90 <li><a class=
"reference internal" href=
"#section-title" id=
"id35">1.1 Section Title
</a></li>
91 <li><a class=
"reference internal" href=
"#empty-section" id=
"id36">1.2 Empty Section
</a></li>
92 <li><a class=
"reference internal" href=
"#transitions" id=
"id37">1.3 Transitions
</a></li>
95 <li><a class=
"reference internal" href=
"#body-elements" id=
"id38">2 Body Elements
</a><ul class=
"auto-toc">
96 <li><a class=
"reference internal" href=
"#paragraphs" id=
"id39">2.1 Paragraphs
</a><ul class=
"auto-toc">
97 <li><a class=
"reference internal" href=
"#inline-markup" id=
"id40">2.1.1 Inline Markup
</a></li>
100 <li><a class=
"reference internal" href=
"#bullet-lists" id=
"id41">2.2 Bullet Lists
</a></li>
101 <li><a class=
"reference internal" href=
"#enumerated-lists" id=
"id42">2.3 Enumerated Lists
</a></li>
102 <li><a class=
"reference internal" href=
"#definition-lists" id=
"id43">2.4 Definition Lists
</a></li>
103 <li><a class=
"reference internal" href=
"#field-lists" id=
"id44">2.5 Field Lists
</a></li>
104 <li><a class=
"reference internal" href=
"#option-lists" id=
"id45">2.6 Option Lists
</a></li>
105 <li><a class=
"reference internal" href=
"#literal-blocks" id=
"id46">2.7 Literal Blocks
</a></li>
106 <li><a class=
"reference internal" href=
"#line-blocks" id=
"id47">2.8 Line Blocks
</a></li>
107 <li><a class=
"reference internal" href=
"#block-quotes" id=
"id48">2.9 Block Quotes
</a></li>
108 <li><a class=
"reference internal" href=
"#doctest-blocks" id=
"id49">2.10 Doctest Blocks
</a></li>
109 <li><a class=
"reference internal" href=
"#footnotes" id=
"id50">2.11 Footnotes
</a></li>
110 <li><a class=
"reference internal" href=
"#citations" id=
"id51">2.12 Citations
</a></li>
111 <li><a class=
"reference internal" href=
"#targets" id=
"id52">2.13 Targets
</a><ul class=
"auto-toc">
112 <li><a class=
"reference internal" href=
"#duplicate-target-names" id=
"id53">2.13.1 Duplicate Target Names
</a></li>
113 <li><a class=
"reference internal" href=
"#id21" id=
"id54">2.13.2 Duplicate Target Names
</a></li>
116 <li><a class=
"reference internal" href=
"#directives" id=
"id55">2.14 Directives
</a><ul class=
"auto-toc">
117 <li><a class=
"reference internal" href=
"#document-parts" id=
"id56">2.14.1 Document Parts
</a></li>
118 <li><a class=
"reference internal" href=
"#images-and-figures" id=
"id57">2.14.2 Images and Figures
</a></li>
119 <li><a class=
"reference internal" href=
"#admonitions" id=
"id58">2.14.3 Admonitions
</a></li>
120 <li><a class=
"reference internal" href=
"#topics-sidebars-and-rubrics" id=
"id59">2.14.4 Topics, Sidebars, and Rubrics
</a></li>
121 <li><a class=
"reference internal" href=
"#target-footnotes" id=
"id60">2.14.5 Target Footnotes
</a></li>
122 <li><a class=
"reference internal" href=
"#replacement-text" id=
"id61">2.14.6 Replacement Text
</a></li>
123 <li><a class=
"reference internal" href=
"#compound-paragraph" id=
"id62">2.14.7 Compound Paragraph
</a></li>
124 <li><a class=
"reference internal" href=
"#parsed-literal-blocks" id=
"id63">2.14.8 Parsed Literal Blocks
</a></li>
125 <li><a class=
"reference internal" href=
"#code" id=
"id64">2.14.9 Code
</a></li>
128 <li><a class=
"reference internal" href=
"#substitution-definitions" id=
"id65">2.15 Substitution Definitions
</a></li>
129 <li><a class=
"reference internal" href=
"#comments" id=
"id66">2.16 Comments
</a></li>
130 <li><a class=
"reference internal" href=
"#raw-text" id=
"id67">2.17 Raw text
</a></li>
131 <li><a class=
"reference internal" href=
"#container" id=
"id68">2.18 Container
</a></li>
132 <li><a class=
"reference internal" href=
"#colspanning-tables" id=
"id69">2.19 Colspanning tables
</a></li>
133 <li><a class=
"reference internal" href=
"#rowspanning-tables" id=
"id70">2.20 Rowspanning tables
</a></li>
134 <li><a class=
"reference internal" href=
"#complex-tables" id=
"id71">2.21 Complex tables
</a></li>
135 <li><a class=
"reference internal" href=
"#list-tables" id=
"id72">2.22 List Tables
</a></li>
136 <li><a class=
"reference internal" href=
"#custom-roles" id=
"id73">2.23 Custom Roles
</a></li>
137 <li><a class=
"reference internal" href=
"#svg-images" id=
"id74">2.24 SVG Images
</a></li>
138 <li><a class=
"reference internal" href=
"#swf-images" id=
"id75">2.25 SWF Images
</a></li>
141 <li><a class=
"reference internal" href=
"#error-handling" id=
"id76">3 Error Handling
</a></li>
144 <div class=
"section" id=
"structural-elements">
145 <h1><a class=
"toc-backref" href=
"#id34">1 Structural Elements
</a></h1>
146 <div class=
"section" id=
"section-title">
147 <h2 class=
"with-subtitle"><a class=
"toc-backref" href=
"#id35">1.1 Section Title
</a></h2>
148 <h2 class=
"section-subtitle" id=
"section-subtitle"><span class=
"section-subtitle">Section Subtitle
</span></h2>
149 <p>Lone subsections are converted to a section subtitle by a transform
150 activated with the
<tt class=
"docutils literal"><span class=
"pre">--section-subtitles
</span></tt> command line option or the
151 <tt class=
"docutils literal"><span class=
"pre">sectsubtitle-xform
</span></tt> configuration value.
</p>
153 <div class=
"section" id=
"empty-section">
154 <h2><a class=
"toc-backref" href=
"#id36">1.2 Empty Section
</a></h2>
156 <div class=
"section" id=
"transitions">
157 <h2><a class=
"toc-backref" href=
"#id37">1.3 Transitions
</a></h2>
158 <p>Here's a transition:
</p>
159 <hr class=
"docutils" />
160 <p>It divides the section. Transitions may also occur between sections:
</p>
163 <hr class=
"docutils" />
164 <div class=
"section" id=
"body-elements">
165 <h1><a class=
"toc-backref" href=
"#id38">2 Body Elements
</a></h1>
166 <div class=
"section" id=
"paragraphs">
167 <h2><a class=
"toc-backref" href=
"#id39">2.1 Paragraphs
</a></h2>
169 <div class=
"section" id=
"inline-markup">
170 <h3><a class=
"toc-backref" href=
"#id40">2.1.1 Inline Markup
</a></h3>
171 <p>Paragraphs contain text and may contain inline markup:
<em>emphasis
</em>,
172 <strong>strong emphasis
</strong>,
<tt class=
"docutils literal">inline literals
</tt>, standalone hyperlinks
173 (
<a class=
"reference external" href=
"http://www.python.org">http://www.python.org
</a>), external hyperlinks (
<a class=
"reference external" href=
"http://www.python.org/">Python
</a> <a class=
"footnote-reference" href=
"#id25" id=
"id26">[
5]
</a>), internal
174 cross-references (
<a class=
"reference internal" href=
"#example">example
</a>), external hyperlinks with embedded URIs
175 (
<a class=
"reference external" href=
"http://www.python.org">Python web site
</a>),
<a class=
"reference external" href=
"http://www.python.org/">anonymous hyperlink
176 references
</a> <a class=
"footnote-reference" href=
"#id25" id=
"id31">[
5]
</a> (
<a class=
"reference external" href=
"http://docutils.sourceforge.net/">a second reference
</a> <a class=
"footnote-reference" href=
"#id32" id=
"id33">[
7]
</a>), footnote references (manually
177 numbered
<a class=
"footnote-reference" href=
"#id8" id=
"id1">[
1]
</a>, anonymous auto-numbered
<a class=
"footnote-reference" href=
"#id12" id=
"id2">[
3]
</a>, labeled auto-numbered
178 <a class=
"footnote-reference" href=
"#label" id=
"id3">[
2]
</a>, or symbolic
<a class=
"footnote-reference" href=
"#id13" id=
"id4">[*]
</a>), citation references (
<a class=
"citation-reference" href=
"#cit2002" id=
"id5">[CIT2002]
</a>),
179 substitution references (
<img alt=
"EXAMPLE" src=
"../../../docs/user/rst/images/biohazard.png" />), and
<span class=
"target" id=
"inline-hyperlink-targets">inline hyperlink targets
</span>
180 (see
<a class=
"reference internal" href=
"#targets">Targets
</a> below for a reference back to here). Character-level
181 inline markup is also possible (although exceedingly ugly!) in
<em>re
</em><tt class=
"docutils literal">Structured
</tt><em>Text
</em>. Problems are indicated by
<a href=
"#id23"><span class=
"problematic" id=
"id24">|problematic|
</span></a> text
182 (generated by processing errors; this one is intentional). Here is a
183 reference to the
<a class=
"reference internal" href=
"#doctitle">doctitle
</a> and the
<a class=
"reference internal" href=
"#subtitle">subtitle
</a>.
</p>
184 <p>The default role for interpreted text is
<cite>Title Reference
</cite>. Here are
185 some explicit interpreted text roles: a PEP reference (
<a class=
"reference external" href=
"http://www.python.org/dev/peps/pep-0287">PEP
287</a>); an
186 RFC reference (
<a class=
"reference external" href=
"http://tools.ietf.org/html/rfc2822.html">RFC
2822</a>); an abbreviation (
<abbr>abb.
</abbr>), an acronym
187 (
<acronym>reST
</acronym>), code (
<code>print
"hello world
"</code>); a
<sub>subscript
</sub>;
188 a
<sup>superscript
</sup> and explicit roles for
<cite>Docutils
</cite>'
189 <em>standard
</em> <strong>inline
</strong> <tt class=
"docutils literal">markup
</tt>.
</p>
190 <!-- DO NOT RE-WRAP THE FOLLOWING PARAGRAPH! -->
191 <p>Let's test wrapping and whitespace significance in inline literals:
192 <tt class=
"docutils literal">This is an example of
<span class=
"pre">--inline-literal
</span> <span class=
"pre">--text,
</span> <span class=
"pre">--including
</span> <span class=
"pre">some--
</span>
193 <span class=
"pre">strangely--hyphenated-words.
</span> <span class=
"pre">Adjust-the-width-of-your-browser-window
</span>
194 to see how the text is wrapped.
<span class=
"pre">--
</span> <span class=
"pre">----
</span> <span class=
"pre">--------
</span> Now note
the
195 spacing
between the
words of
this sentence
(words
196 should
be grouped
in pairs).
</tt></p>
197 <p>If the
<tt class=
"docutils literal"><span class=
"pre">--pep-references
</span></tt> option was supplied, there should be a
198 live link to PEP
258 here.
</p>
201 <div class=
"section" id=
"bullet-lists">
202 <h2><a class=
"toc-backref" href=
"#id41">2.2 Bullet Lists
</a></h2>
204 <li><p class=
"first">A bullet list
</p>
206 <li>Nested bullet list.
</li>
207 <li>Nested item
2.
</li>
210 <li><p class=
"first">Item
2.
</p>
211 <p>Paragraph
2 of item
2.
</p>
213 <li>Nested bullet list.
</li>
214 <li>Nested item
2.
<ul>
215 <li>Third level.
</li>
219 <li>Nested item
3.
</li>
220 <li>This nested list should be compacted by the HTML writer.
<span class=
"target" id=
"target"></span><!-- Even if this item contains a target and a comment. -->
226 <div class=
"section" id=
"enumerated-lists">
227 <h2><a class=
"toc-backref" href=
"#id42">2.3 Enumerated Lists
</a></h2>
229 <li><p class=
"first">Arabic numerals.
</p>
230 <ol class=
"loweralpha simple">
231 <li>lower alpha)
<ol class=
"lowerroman">
232 <li>(lower roman)
<ol class=
"upperalpha">
233 <li>upper alpha.
<ol class=
"upperroman">
234 <li>upper roman)
</li>
243 <li><p class=
"first">Lists that don't start at
1:
</p>
244 <ol class=
"arabic simple" start=
"3">
248 <ol class=
"upperalpha simple" start=
"3">
252 <ol class=
"lowerroman simple" start=
"3">
259 <div class=
"section" id=
"definition-lists">
260 <h2><a class=
"toc-backref" href=
"#id43">2.4 Definition Lists
</a></h2>
261 <dl class=
"docutils">
264 <dt>Term
<span class=
"classifier-delimiter">:
</span> <span class=
"classifier">classifier
</span></dt>
265 <dd><p class=
"first">Definition paragraph
1.
</p>
266 <p class=
"last">Definition paragraph
2.
</p>
270 <dt>Term
<span class=
"classifier-delimiter">:
</span> <span class=
"classifier">classifier one
</span> <span class=
"classifier-delimiter">:
</span> <span class=
"classifier">classifier two
</span></dt>
274 <div class=
"section" id=
"field-lists">
275 <h2><a class=
"toc-backref" href=
"#id44">2.5 Field Lists
</a></h2>
276 <table class=
"docutils field-list" frame=
"void" rules=
"none">
277 <col class=
"field-name" />
278 <col class=
"field-body" />
280 <tr class=
"field"><th class=
"field-name">what:
</th><td class=
"field-body"><p class=
"first">Field lists map field names to field bodies, like database
281 records. They are often part of an extension syntax. They are
282 an unambiguous variant of RFC
2822 fields.
</p>
285 <tr class=
"field"><th class=
"field-name">how arg1 arg2:
</th><td class=
"field-body"><p class=
"first">The field marker is a colon, the field name, and a colon.
</p>
286 <p>The field body may contain one or more body elements, indented
287 relative to the field marker.
</p>
290 <tr class=
"field"><th class=
"field-name">credits:
</th><td class=
"field-body"><p class=
"credits first last">This paragraph has the
<cite>credits
</cite> class set. (This is actually not
291 about credits but just for ensuring that the class attribute
292 doesn't get stripped away.)
</p>
298 <div class=
"section" id=
"option-lists">
299 <h2><a class=
"toc-backref" href=
"#id45">2.6 Option Lists
</a></h2>
300 <p>For listing command-line options:
</p>
301 <table class=
"docutils option-list" frame=
"void" rules=
"none">
302 <col class=
"option" />
303 <col class=
"description" />
305 <tr><td class=
"option-group">
306 <kbd><span class=
"option">-a
</span></kbd></td>
307 <td>command-line option
"a
"</td></tr>
308 <tr><td class=
"option-group">
309 <kbd><span class=
"option">-b
<var>file
</var></span></kbd></td>
310 <td>options can have arguments
311 and long descriptions
</td></tr>
312 <tr><td class=
"option-group">
313 <kbd><span class=
"option">--long
</span></kbd></td>
314 <td>options can be long also
</td></tr>
315 <tr><td class=
"option-group">
316 <kbd><span class=
"option">--input=
<var>file
</var></span></kbd></td>
317 <td>long options can also have
319 <tr><td class=
"option-group" colspan=
"2">
320 <kbd><span class=
"option">--very-long-option
</span></kbd></td>
322 <tr><td> </td><td><p class=
"first">The description can also start on the next line.
</p>
323 <p class=
"last">The description may contain multiple body elements,
324 regardless of where it starts.
</p>
326 <tr><td class=
"option-group">
327 <kbd><span class=
"option">-x
</span>,
<span class=
"option">-y
</span>,
<span class=
"option">-z
</span></kbd></td>
328 <td>Multiple options are an
"option group
".
</td></tr>
329 <tr><td class=
"option-group">
330 <kbd><span class=
"option">-v
</span>,
<span class=
"option">--verbose
</span></kbd></td>
331 <td>Commonly-seen: short
& long options.
</td></tr>
332 <tr><td class=
"option-group" colspan=
"2">
333 <kbd><span class=
"option">-
1 <var>file
</var></span>,
<span class=
"option">--one=
<var>file
</var></span>,
<span class=
"option">--two
<var>file
</var></span></kbd></td>
335 <tr><td> </td><td>Multiple options with arguments.
</td></tr>
336 <tr><td class=
"option-group">
337 <kbd><span class=
"option">/V
</span></kbd></td>
338 <td>DOS/VMS-style options too
</td></tr>
341 <p>There must be at least two spaces between the option and the
344 <div class=
"section" id=
"literal-blocks">
345 <h2><a class=
"toc-backref" href=
"#id46">2.7 Literal Blocks
</a></h2>
346 <p>Literal blocks are indicated with a double-colon (
"::
") at the end of
347 the preceding paragraph (over there
<tt class=
"docutils literal"><span class=
"pre">--
></span></tt>). They can be indented:
</p>
348 <pre class=
"literal-block">
350 text = 'is left as-is'
351 spaces_and_linebreaks = 'are preserved'
352 markup_processing = None
354 <p>Or they can be quoted without indentation:
</p>
355 <pre class=
"literal-block">
358 > Why didn't I think of that?
361 <div class=
"section" id=
"line-blocks">
362 <h2><a class=
"toc-backref" href=
"#id47">2.8 Line Blocks
</a></h2>
363 <p>This section tests line blocks. Line blocks are body elements which
364 consist of lines and other line blocks. Nested line blocks cause
366 <div class=
"line-block">
367 <div class=
"line">This is a line block. It ends with a blank line.
</div>
368 <div class=
"line-block">
369 <div class=
"line">New lines begin with a vertical bar (
"|
").
</div>
370 <div class=
"line">Line breaks and initial indent are significant, and preserved.
</div>
371 <div class=
"line-block">
372 <div class=
"line">Continuation lines are also possible. A long line that is intended
373 to wrap should begin with a space in place of the vertical bar.
</div>
375 <div class=
"line">The left edge of a continuation line need not be aligned with
376 the left edge of the text above it.
</div>
379 <div class=
"line-block">
380 <div class=
"line">This is a second line block.
</div>
381 <div class=
"line"><br /></div>
382 <div class=
"line">Blank lines are permitted internally, but they must begin with a
"|
".
</div>
384 <p>Another line block, surrounded by paragraphs:
</p>
385 <div class=
"line-block">
386 <div class=
"line">And it's no good waiting by the window
</div>
387 <div class=
"line">It's no good waiting for the sun
</div>
388 <div class=
"line">Please believe me, the things you dream of
</div>
389 <div class=
"line">They don't fall in the lap of no-one
</div>
391 <p>Take it away, Eric the Orchestra Leader!
</p>
393 <div class=
"line-block">
394 <div class=
"line">A one, two, a one two three four
</div>
395 <div class=
"line"><br /></div>
396 <div class=
"line">Half a bee, philosophically,
</div>
397 <div class=
"line-block">
398 <div class=
"line">must,
<em>ipso facto
</em>, half not be.
</div>
400 <div class=
"line">But half the bee has got to be,
</div>
401 <div class=
"line-block">
402 <div class=
"line"><em>vis a vis
</em> its entity. D'you see?
</div>
403 <div class=
"line"><br /></div>
405 <div class=
"line">But can a bee be said to be
</div>
406 <div class=
"line-block">
407 <div class=
"line">or not to be an entire bee,
</div>
408 <div class=
"line-block">
409 <div class=
"line">when half the bee is not a bee,
</div>
410 <div class=
"line-block">
411 <div class=
"line">due to some ancient injury?
</div>
412 <div class=
"line"><br /></div>
416 <div class=
"line">Singing...
</div>
419 <p>A line block, like the following poem by Christian Morgenstern, can
420 also be centre-aligned:
</p>
421 <div class=
"align-center line-block" lang=
"de">
422 <div class=
"line"><strong>Die Trichter
</strong></div>
423 <div class=
"line"><br /></div>
424 <div class=
"line">Zwei Trichter wandeln durch die Nacht.
</div>
425 <div class=
"line">Durch ihres Rumpfs verengten Schacht
</div>
426 <div class=
"line">fließt weißes Mondlicht
</div>
427 <div class=
"line">still und heiter
</div>
428 <div class=
"line">auf
ihren
</div>
429 <div class=
"line">Waldweg
</div>
430 <div class=
"line">u. s.
</div>
431 <div class=
"line">w.
</div>
432 <div class=
"line"><br /></div>
435 <div class=
"section" id=
"block-quotes">
436 <h2><a class=
"toc-backref" href=
"#id48">2.9 Block Quotes
</a></h2>
437 <p>Block quotes consist of indented body elements:
</p>
439 <p>My theory by A. Elk. Brackets Miss, brackets. This theory goes
440 as follows and begins now. All brontosauruses are thin at one
441 end, much much thicker in the middle and then thin again at the
442 far end. That is my theory, it is mine, and belongs to me and I
443 own it, and what it is too.
</p>
444 <p class=
"attribution">—Anne Elk (Miss)
</p>
446 <p>The language of a quote (like any other object) can be specified by
447 a class attribute:
</p>
449 <blockquote lang=
"fr">
450 ReStructuredText est un langage de balisage léger utilisé
451 notamment dans la documentation du langage Python.
</blockquote>
453 <div class=
"section" id=
"doctest-blocks">
454 <h2><a class=
"toc-backref" href=
"#id49">2.10 Doctest Blocks
</a></h2>
455 <pre class=
"doctest-block">
456 >>> print 'Python-specific usage examples; begun with
">>>"'
457 Python-specific usage examples; begun with
">>>"
458 >>> print '(cut and pasted from interactive Python sessions)'
459 (cut and pasted from interactive Python sessions)
462 <div class=
"section" id=
"footnotes">
463 <h2><a class=
"toc-backref" href=
"#id50">2.11 Footnotes
</a></h2>
464 <table class=
"docutils footnote" frame=
"void" id=
"id8" rules=
"none">
465 <colgroup><col class=
"label" /><col /></colgroup>
467 <tr><td class=
"label">[
1]
</td><td><em>(
<a class=
"fn-backref" href=
"#id1">1</a>,
<a class=
"fn-backref" href=
"#id9">2</a>,
<a class=
"fn-backref" href=
"#id22">3</a>)
</em> <p>A footnote contains body elements, consistently indented by at
469 <p class=
"last">This is the footnote's second paragraph.
</p>
473 <table class=
"docutils footnote" frame=
"void" id=
"label" rules=
"none">
474 <colgroup><col class=
"label" /><col /></colgroup>
476 <tr><td class=
"label">[
2]
</td><td><em>(
<a class=
"fn-backref" href=
"#id3">1</a>,
<a class=
"fn-backref" href=
"#id10">2</a>)
</em> Footnotes may be numbered, either manually (as in
<a class=
"footnote-reference" href=
"#id8" id=
"id9">[
1]
</a>) or
477 automatically using a
"#
"-prefixed label. This footnote has a
478 label so it can be referred to from multiple places, both as a
479 footnote reference (
<a class=
"footnote-reference" href=
"#label" id=
"id10">[
2]
</a>) and as a
<a class=
"reference internal" href=
"#label">hyperlink reference
</a>.
</td></tr>
482 <table class=
"docutils footnote" frame=
"void" id=
"id12" rules=
"none">
483 <colgroup><col class=
"label" /><col /></colgroup>
485 <tr><td class=
"label"><a class=
"fn-backref" href=
"#id2">[
3]
</a></td><td><p class=
"first">This footnote is numbered automatically and anonymously using a
486 label of
"#
" only.
</p>
487 <p>This is the second paragraph.
</p>
488 <p class=
"last">And this is the third paragraph.
</p>
492 <table class=
"docutils footnote" frame=
"void" id=
"id13" rules=
"none">
493 <colgroup><col class=
"label" /><col /></colgroup>
495 <tr><td class=
"label"><a class=
"fn-backref" href=
"#id4">[*]
</a></td><td>Footnotes may also use symbols, specified with a
"*
" label.
496 Here's a reference to the next footnote:
<a class=
"footnote-reference" href=
"#id15" id=
"id14">[†]
</a>.
</td></tr>
499 <table class=
"docutils footnote" frame=
"void" id=
"id15" rules=
"none">
500 <colgroup><col class=
"label" /><col /></colgroup>
502 <tr><td class=
"label"><a class=
"fn-backref" href=
"#id14">[†]
</a></td><td>This footnote shows the next symbol in the sequence.
</td></tr>
505 <table class=
"docutils footnote" frame=
"void" id=
"id16" rules=
"none">
506 <colgroup><col class=
"label" /><col /></colgroup>
508 <tr><td class=
"label">[
4]
</td><td>Here's an unreferenced footnote, with a reference to a
509 nonexistent footnote:
<a href=
"#id86"><span class=
"problematic" id=
"id87"><span id=
"id17"></span>[
5]_
</span></a>.
</td></tr>
513 <div class=
"section" id=
"citations">
514 <h2><a class=
"toc-backref" href=
"#id51">2.12 Citations
</a></h2>
515 <table class=
"docutils citation" frame=
"void" id=
"cit2002" rules=
"none">
516 <colgroup><col class=
"label" /><col /></colgroup>
518 <tr><td class=
"label">[CIT2002]
</td><td><em>(
<a class=
"fn-backref" href=
"#id5">1</a>,
<a class=
"fn-backref" href=
"#id18">2</a>)
</em> Citations are text-labeled footnotes. They may be
519 rendered separately and differently from footnotes.
</td></tr>
522 <p>Here's a reference to the above,
<a class=
"citation-reference" href=
"#cit2002" id=
"id18">[CIT2002]
</a>, and a
<a href=
"#id88"><span class=
"problematic" id=
"id89"><span id=
"id19"></span>[nonexistent]_
</span></a>
525 <div class=
"section" id=
"targets">
526 <span id=
"another-target"></span><h2><a class=
"toc-backref" href=
"#id52">2.13 Targets
</a></h2>
527 <p id=
"example">This paragraph is pointed to by the explicit
"example
" target. A
528 reference can be found under
<a class=
"reference internal" href=
"#inline-markup">Inline Markup
</a>, above.
<a class=
"reference internal" href=
"#inline-hyperlink-targets">Inline
529 hyperlink targets
</a> are also possible.
</p>
530 <p>Section headers are implicit targets, referred to by name. See
531 <a class=
"reference internal" href=
"#targets">Targets
</a>, which is a subsection of
<a class=
"reference internal" href=
"#body-elements">Body Elements
</a>.
</p>
532 <p>Explicit external targets are interpolated into references such as
533 "<a class=
"reference external" href=
"http://www.python.org/">Python
</a> <a class=
"footnote-reference" href=
"#id25" id=
"id27">[
5]
</a>".
</p>
534 <p>Targets may be indirect and anonymous. Thus
<a class=
"reference internal" href=
"#targets">this phrase
</a> may also
535 refer to the
<a class=
"reference internal" href=
"#targets">Targets
</a> section.
</p>
536 <p>Here's a
<a href=
"#id90"><span class=
"problematic" id=
"id91">`hyperlink reference without a target`_
</span></a>, which generates an
538 <div class=
"section" id=
"duplicate-target-names">
539 <h3><a class=
"toc-backref" href=
"#id53">2.13.1 Duplicate Target Names
</a></h3>
540 <p>Duplicate names in section headers or other implicit targets will
541 generate
"info
" (level-
1) system messages. Duplicate names in
542 explicit targets will generate
"warning
" (level-
2) system messages.
</p>
544 <div class=
"section" id=
"id21">
545 <h3><a class=
"toc-backref" href=
"#id54">2.13.2 Duplicate Target Names
</a></h3>
546 <p>Since there are two
"Duplicate Target Names
" section headers, we
547 cannot uniquely refer to either of them by name. If we try to (like
548 this:
<a href=
"#id92"><span class=
"problematic" id=
"id93">`Duplicate Target Names`_
</span></a>), an error is generated.
</p>
551 <div class=
"section" id=
"directives">
552 <h2><a class=
"toc-backref" href=
"#id55">2.14 Directives
</a></h2>
553 <div class=
"contents local topic" id=
"contents">
554 <ul class=
"auto-toc simple">
555 <li><a class=
"reference internal" href=
"#document-parts" id=
"id77">2.14.1 Document Parts
</a></li>
556 <li><a class=
"reference internal" href=
"#images-and-figures" id=
"id78">2.14.2 Images and Figures
</a></li>
557 <li><a class=
"reference internal" href=
"#admonitions" id=
"id79">2.14.3 Admonitions
</a></li>
558 <li><a class=
"reference internal" href=
"#topics-sidebars-and-rubrics" id=
"id80">2.14.4 Topics, Sidebars, and Rubrics
</a></li>
559 <li><a class=
"reference internal" href=
"#target-footnotes" id=
"id81">2.14.5 Target Footnotes
</a></li>
560 <li><a class=
"reference internal" href=
"#replacement-text" id=
"id82">2.14.6 Replacement Text
</a></li>
561 <li><a class=
"reference internal" href=
"#compound-paragraph" id=
"id83">2.14.7 Compound Paragraph
</a></li>
562 <li><a class=
"reference internal" href=
"#parsed-literal-blocks" id=
"id84">2.14.8 Parsed Literal Blocks
</a></li>
563 <li><a class=
"reference internal" href=
"#code" id=
"id85">2.14.9 Code
</a></li>
566 <p>These are just a sample of the many reStructuredText Directives. For
568 <a class=
"reference external" href=
"http://docutils.sourceforge.net/docs/ref/rst/directives.html">http://docutils.sourceforge.net/docs/ref/rst/directives.html
</a>.
</p>
569 <div class=
"section" id=
"document-parts">
570 <h3><a class=
"toc-backref" href=
"#id77">2.14.1 Document Parts
</a></h3>
571 <p>An example of the
"contents
" directive can be seen above this section
572 (a local, untitled table of
<a class=
"reference internal" href=
"#contents">contents
</a>) and at the beginning of the
573 document (a document-wide
<a class=
"reference internal" href=
"#table-of-contents">table of contents
</a>).
</p>
575 <div class=
"section" id=
"images-and-figures">
576 <h3><a class=
"toc-backref" href=
"#id78">2.14.2 Images and Figures
</a></h3>
577 <p>An image directive (also clickable -- a hyperlink reference):
</p>
578 <a class=
"reference internal image-reference" href=
"#directives"><img alt=
"../../../docs/user/rst/images/title.png" class=
"class1 class2" src=
"../../../docs/user/rst/images/title.png" /></a>
579 <p>Image with multiple IDs:
</p>
580 <span id=
"image-target-2"></span><span id=
"image-target-1"></span><img alt=
"../../../docs/user/rst/images/title.png" id=
"image-target-3" src=
"../../../docs/user/rst/images/title.png" />
581 <p>A centered image:
</p>
582 <img alt=
"../../../docs/user/rst/images/biohazard.png" class=
"align-center" src=
"../../../docs/user/rst/images/biohazard.png" />
583 <p>A left-aligned image:
</p>
584 <img alt=
"../../../docs/user/rst/images/biohazard.png" class=
"align-left" src=
"../../../docs/user/rst/images/biohazard.png" />
585 <p>This paragraph might flow around the image.
586 The specific behavior depends upon the style sheet and
587 the browser or rendering software used.
</p>
588 <p>A right-aligned image:
</p>
589 <img alt=
"../../../docs/user/rst/images/biohazard.png" class=
"align-right" src=
"../../../docs/user/rst/images/biohazard.png" />
590 <p>This paragraph might flow around the image.
591 The specific behavior depends upon the style sheet and
592 the browser or rendering software used.
</p>
593 <p>For inline images see
<a class=
"reference internal" href=
"#substitution-definitions">Substitution Definitions
</a>.
</p>
595 <p>An image
2 em wide:
</p>
596 <img alt=
"../../../docs/user/rst/images/biohazard.png" src=
"../../../docs/user/rst/images/biohazard.png" style=
"width: 2em;" />
597 <p>An image
2 em wide and
15 pixel high:
</p>
598 <img alt=
"../../../docs/user/rst/images/biohazard.png" src=
"../../../docs/user/rst/images/biohazard.png" style=
"width: 2em; height: 15px;" />
599 <p>An image occupying
50% of the line width:
</p>
600 <img alt=
"../../../docs/user/rst/images/title.png" src=
"../../../docs/user/rst/images/title.png" style=
"width: 50%;" />
601 <p>An image
2 cm high:
</p>
602 <img alt=
"../../../docs/user/rst/images/biohazard.png" src=
"../../../docs/user/rst/images/biohazard.png" style=
"height: 2cm;" />
603 <p>A
<em>figure
</em> is an image with a caption and/or a legend. With page-based output
604 media, figures might float to a different position if this helps the page
606 <div class=
"figclass1 figclass2 figure">
607 <img alt=
"reStructuredText, the markup syntax" class=
"class1 class2" src=
"../../../docs/user/rst/images/title.png" style=
"width: 258px;" />
608 <p class=
"caption">Plaintext markup syntax and parser system.
</p>
610 <table border=
"1" class=
"docutils">
617 <td>Revised, revisited, based on 're' module.
</td>
619 <tr><td>Structured
</td>
620 <td>Structure-enhanced text, structuredtext.
</td>
623 <td>Well it is, isn't it?
</td>
627 <p>This paragraph is also part of the legend.
</p>
630 <p>A left-aligned figure:
</p>
631 <div class=
"figclass1 figclass2 figure align-left" style=
"width: 70%">
632 <img alt=
"reStructuredText, the markup syntax" class=
"class1 class2" src=
"../../../docs/user/rst/images/biohazard.png" style=
"width: 40px;" />
633 <p class=
"caption">This is the caption.
</p>
635 <p>This is the legend.
</p>
636 <p>The legend may consist of several paragraphs.
</p>
639 <p>This paragraph might flow around the figure.
</p>
640 <p>The specific behavior depends upon the style sheet and the browser or
641 rendering software used.
</p>
642 <p>A centered figure:
</p>
643 <div class=
"figure align-center">
644 <img alt=
"../../../docs/user/rst/images/biohazard.png" src=
"../../../docs/user/rst/images/biohazard.png" style=
"width: 40px;" />
645 <p class=
"caption">This is the caption.
</p>
647 <p>This is the legend.
</p>
648 <p>The legend may consist of several paragraphs.
</p>
651 <p>This paragraph might flow around the figure.
</p>
652 <p>The specific behavior depends upon the style sheet and the browser or
653 rendering software used.
</p>
654 <p>A right-aligned figure:
</p>
655 <div class=
"figure align-right">
656 <img alt=
"../../../docs/user/rst/images/biohazard.png" src=
"../../../docs/user/rst/images/biohazard.png" style=
"width: 40px;" />
657 <p class=
"caption">This is the caption.
</p>
659 <p>This is the legend.
</p>
660 <p>The legend may consist of several paragraphs.
</p>
663 <p>This paragraph might flow around the figure. The specific behavior depends
664 upon the style sheet and the browser or rendering software used.
</p>
666 <div class=
"section" id=
"admonitions">
667 <h3><a class=
"toc-backref" href=
"#id79">2.14.3 Admonitions
</a></h3>
668 <div class=
"admonition attention">
669 <p class=
"first admonition-title">Attention!
</p>
670 <p class=
"last">Directives at large.
</p>
672 <div class=
"admonition caution">
673 <p class=
"first admonition-title">Caution!
</p>
674 <p class=
"last">Don't take any wooden nickels.
</p>
676 <div class=
"admonition danger">
677 <p class=
"first admonition-title">!DANGER!
</p>
678 <p class=
"last">Mad scientist at work!
</p>
680 <div class=
"admonition error">
681 <p class=
"first admonition-title">Error
</p>
682 <p class=
"last">Does not compute.
</p>
684 <div class=
"admonition hint">
685 <p class=
"first admonition-title">Hint
</p>
686 <p class=
"last">It's bigger than a bread box.
</p>
688 <div class=
"admonition important">
689 <p class=
"first admonition-title">Important
</p>
690 <ul class=
"last simple">
691 <li>Wash behind your ears.
</li>
692 <li>Clean up your room.
</li>
693 <li>Call your mother.
</li>
694 <li>Back up your data.
</li>
697 <div class=
"admonition note">
698 <p class=
"first admonition-title">Note
</p>
699 <p class=
"last">This is a note.
</p>
701 <div class=
"admonition tip">
702 <p class=
"first admonition-title">Tip
</p>
703 <p class=
"last">15% if the service is good.
</p>
705 <div class=
"admonition warning">
706 <p class=
"first admonition-title">Warning
</p>
707 <p class=
"last">Strong prose may provoke extreme mental exertion.
708 Reader discretion is strongly advised.
</p>
710 <div class=
"admonition admonition-and-by-the-way">
711 <p class=
"first admonition-title">And, by the way...
</p>
712 <p class=
"last">You can make up your own admonition too.
</p>
715 <div class=
"section" id=
"topics-sidebars-and-rubrics">
716 <h3><a class=
"toc-backref" href=
"#id80">2.14.4 Topics, Sidebars, and Rubrics
</a></h3>
717 <p><em>Sidebars
</em> are like miniature, parallel documents.
</p>
718 <div class=
"sidebar">
719 <p class=
"first sidebar-title">Sidebar Title
</p>
720 <p class=
"sidebar-subtitle">Optional Subtitle
</p>
721 <p>This is a sidebar. It is for text outside the flow of the main
723 <p class=
"rubric">This is a rubric inside a sidebar
</p>
724 <p class=
"last">Sidebars often appear beside the main text with a border and a different
725 background or font color.
</p>
727 <p>A
<em>topic
</em> is like a block quote with a title, or a self-contained section
728 with no subsections.
</p>
730 <p class=
"topic-title first">Topic Title
</p>
731 <p>This is a topic.
</p>
733 <p>A
<em>rubric
</em> is like an informal heading that doesn't correspond to the
734 document's structure. It is typically highlighted in red (hence the name).
</p>
735 <p class=
"rubric">This is a rubric
</p>
736 <p>Topics and rubrics can be used at places where a
<a class=
"reference internal" href=
"#section-title">section title
</a> is not
737 allowed (e.g. inside a directive).
</p>
739 <div class=
"section" id=
"target-footnotes">
740 <h3><a class=
"toc-backref" href=
"#id81">2.14.5 Target Footnotes
</a></h3>
741 <table class=
"docutils footnote" frame=
"void" id=
"id25" rules=
"none">
742 <colgroup><col class=
"label" /><col /></colgroup>
744 <tr><td class=
"label">[
5]
</td><td><em>(
<a class=
"fn-backref" href=
"#id26">1</a>,
<a class=
"fn-backref" href=
"#id27">2</a>,
<a class=
"fn-backref" href=
"#id28">3</a>,
<a class=
"fn-backref" href=
"#id31">4</a>)
</em> <a class=
"reference external" href=
"http://www.python.org/">http://www.python.org/
</a></td></tr>
747 <table class=
"docutils footnote" frame=
"void" id=
"id29" rules=
"none">
748 <colgroup><col class=
"label" /><col /></colgroup>
750 <tr><td class=
"label"><a class=
"fn-backref" href=
"#id30">[
6]
</a></td><td><a class=
"reference external" href=
"http://pygments.org/">http://pygments.org/
</a></td></tr>
753 <table class=
"docutils footnote" frame=
"void" id=
"id32" rules=
"none">
754 <colgroup><col class=
"label" /><col /></colgroup>
756 <tr><td class=
"label"><a class=
"fn-backref" href=
"#id33">[
7]
</a></td><td><a class=
"reference external" href=
"http://docutils.sourceforge.net/">http://docutils.sourceforge.net/
</a></td></tr>
760 <div class=
"section" id=
"replacement-text">
761 <h3><a class=
"toc-backref" href=
"#id82">2.14.6 Replacement Text
</a></h3>
762 <p>I recommend you try
<a class=
"reference external" href=
"http://www.python.org/">Python,
<em>the
</em> best language around
</a> <a class=
"footnote-reference" href=
"#id25" id=
"id28">[
5]
</a>.
</p>
764 <div class=
"section" id=
"compound-paragraph">
765 <h3><a class=
"toc-backref" href=
"#id83">2.14.7 Compound Paragraph
</a></h3>
766 <div class=
"some-class compound">
767 <p class=
"compound-first">Compound
1, paragraph
1.
</p>
768 <p class=
"compound-middle">Compound
1, paragraph
2.
</p>
769 <ul class=
"compound-last simple">
770 <li>Compound
1, list item one.
</li>
771 <li>Compound
1, list item two.
</li>
774 <p>Another compound statement:
</p>
775 <div class=
"compound">
776 <p class=
"compound-first">Compound
2, a literal block:
</p>
777 <pre class=
"compound-middle literal-block">
780 <p class=
"compound-last">Compound
2, this is a test.
</p>
782 <div class=
"compound">
783 <p>Compound
3, only consisting of one paragraph.
</p>
785 <div class=
"compound">
786 <pre class=
"compound-first literal-block">
788 This one starts with a literal block.
790 <p class=
"compound-last">Compound
4, a paragraph.
</p>
792 <p>Now something
<em>really
</em> perverted -- a nested compound block. This is
793 just to test that it works at all; the results don't have to be
795 <div class=
"compound">
796 <p class=
"compound-first">Compound
5, block
1 (a paragraph).
</p>
797 <div class=
"compound-middle compound">
798 <p class=
"compound-first">Compound
6, block
2 in compound
5.
</p>
799 <p class=
"compound-last">Compound
6, another paragraph.
</p>
801 <p class=
"compound-last">Compound
5, block
3 (a paragraph).
</p>
803 <div class=
"compound">
804 <p class=
"compound-first">Compound
7, with a table inside:
</p>
805 <table border=
"1" class=
"compound-middle docutils">
812 <tr><td><p class=
"first">Left cell, first
814 <p class=
"last">Left cell, second
821 <td><p class=
"first">Right cell.
</p>
823 <p class=
"last">Paragraph
3.
</p>
828 <p class=
"compound-middle">Compound
7, a paragraph after the table.
</p>
829 <p class=
"compound-last">Compound
7, another paragraph.
</p>
832 <div class=
"section" id=
"parsed-literal-blocks">
833 <h3><a class=
"toc-backref" href=
"#id84">2.14.8 Parsed Literal Blocks
</a></h3>
834 <pre class=
"literal-block">
835 This is a parsed literal block.
836 This line is indented. The next line is blank.
838 Inline markup is supported, e.g.
<em>emphasis
</em>,
<strong>strong
</strong>,
<tt class=
"docutils literal">literal
839 text
</tt>,
<sub>sub-
</sub> and
<sup>super
</sup>scripts,
840 inline formulas:
<span class=
"formula"><i>A
</i> = 
2<i>Ï€
</i><i>r
</i><sup>2</sup></span>,
841 footnotes
<a class=
"footnote-reference" href=
"#id8" id=
"id22">[
1]
</a>,
<span class=
"target" id=
"hyperlink-targets">hyperlink targets
</span>, and
<a class=
"reference external" href=
"http://www.python.org/">references
</a>.
844 <div class=
"section" id=
"code">
845 <h3><a class=
"toc-backref" href=
"#id85">2.14.9 Code
</a></h3>
846 <p>Blocks of source code can be set with the
<cite>code
</cite> directive. If the code
847 language is specified, the content is parsed and tagged by the
<a class=
"reference external" href=
"http://pygments.org/">Pygments
</a> <a class=
"footnote-reference" href=
"#id29" id=
"id30">[
6]
</a>
848 syntax highlighter and can be formatted with a style sheet. (Code parsing
849 is turned off using the
<tt class=
"docutils literal"><span class=
"pre">syntax-highlight
</span></tt> config setting in the test
850 conversions in order to get identical results with/without installed
851 Pygments highlighter.)
</p>
852 <pre class=
"code python literal-block">
853 print 'This is Python code.'
855 <p>The
<tt class=
"docutils literal"><span class=
"pre">:number-lines:
</span></tt> option (with optional start value) generates line
857 <pre class=
"code python literal-block">
858 <span class=
"ln"> 8 </span># print integers from
0 to
9:
859 <span class=
"ln"> 9 </span>for i in range(
10):
860 <span class=
"ln">10 </span> print i
862 <p>For inline code snippets, there is the
<cite>code
</cite> role, which can be used
863 directly (the code will not be parsed/tagged, as the language is not known)
864 or as base for special code roles, e.g. the LaTeX code in the next
866 <p>Docutils uses LaTeX syntax for math directives and roles:
867 <code class=
"tex">\alpha = f(x)
</code> prints
<span class=
"formula"><i>α
</i> = 
<i>f
</i>(
<i>x
</i>)
</span>.
</p>
868 <p>The
<tt class=
"docutils literal">:code:
</tt> option of the
<cite>include
</cite> directive sets the included content
869 as a code block, here the rst file
<tt class=
"docutils literal">header_footer.txt
</tt> with line numbers:
</p>
870 <pre class=
"code rst literal-block">
871 <span class=
"ln">1 </span>.. header:: Document header
872 <span class=
"ln">2 </span>.. footer:: Document footer
876 <div class=
"section" id=
"substitution-definitions">
877 <h2><a class=
"toc-backref" href=
"#id65">2.15 Substitution Definitions
</a></h2>
878 <p>An inline image (
<img alt=
"EXAMPLE" src=
"../../../docs/user/rst/images/biohazard.png" />) example:
</p>
879 <p>(Substitution definitions are not visible in the HTML source.)
</p>
881 <div class=
"section" id=
"comments">
882 <h2><a class=
"toc-backref" href=
"#id66">2.16 Comments
</a></h2>
884 <!-- Comments begin with two dots and a space. Anything may
885 follow, except for the syntax of footnotes, hyperlink
886 targets, directives, or substitution definitions.
888 Double-dashes - - "- -" - - must be escaped somehow in HTML output.
890 Comments may contain non-ASCII characters: ä ö ü æ ø å -->
891 <p>(View the HTML source to see the comment.)
</p>
893 <div class=
"section" id=
"raw-text">
894 <h2><a class=
"toc-backref" href=
"#id67">2.17 Raw text
</a></h2>
895 <p>This does not necessarily look nice, because there may be missing white space.
</p>
896 <p>It's just there to freeze the behavior.
</p>
897 A test.Second test.
<div class=
"myclass">Another test with myclass set.
</div><p>This is the
<span class=
"myrawroleclass">fourth test
</span> with myrawroleclass set.
</p>
898 Fifth test in HTML.
<br />Line two.
</div>
899 <div class=
"section" id=
"container">
900 <h2><a class=
"toc-backref" href=
"#id68">2.18 Container
</a></h2>
901 <div class=
"custom docutils container">
906 <div class=
"section" id=
"colspanning-tables">
907 <h2><a class=
"toc-backref" href=
"#id69">2.19 Colspanning tables
</a></h2>
908 <p>This table has a cell spanning two columns:
</p>
909 <table border=
"1" class=
"docutils">
915 <thead valign=
"bottom">
916 <tr><th class=
"head" colspan=
"2">Inputs
</th>
917 <th class=
"head">Output
</th>
919 <tr><th class=
"head">A
</th>
920 <th class=
"head">B
</th>
921 <th class=
"head">A or B
</th>
944 <div class=
"section" id=
"rowspanning-tables">
945 <h2><a class=
"toc-backref" href=
"#id70">2.20 Rowspanning tables
</a></h2>
946 <p>Here's a table with cells spanning several rows:
</p>
947 <table border=
"1" class=
"docutils">
953 <thead valign=
"bottom">
954 <tr><th class=
"head">Header row, column
1
955 (header rows optional)
</th>
956 <th class=
"head">Header
2</th>
957 <th class=
"head">Header
3</th>
961 <tr><td>body row
1, column
1</td>
965 <tr><td>body row
2</td>
966 <td rowspan=
"2">Cells may
968 <td rowspan=
"2">Another
972 <tr><td>body row
3</td>
977 <div class=
"section" id=
"complex-tables">
978 <h2><a class=
"toc-backref" href=
"#id71">2.21 Complex tables
</a></h2>
979 <p>Here's a complex table, which should test all features.
</p>
980 <table border=
"1" class=
"docutils">
987 <thead valign=
"bottom">
988 <tr><th class=
"head">Header row, column
1
989 (header rows optional)
</th>
990 <th class=
"head">Header
2</th>
991 <th class=
"head">Header
3</th>
992 <th class=
"head">Header
4</th>
996 <tr><td>body row
1, column
1</td>
1001 <tr><td>body row
2</td>
1002 <td colspan=
"3">Cells may span columns.
</td>
1004 <tr><td>body row
3</td>
1005 <td rowspan=
"2"><p class=
"first">Cells may
1007 <p class=
"last">Paragraph.
</p>
1009 <td colspan=
"2" rowspan=
"2"><ul class=
"first last simple">
1010 <li>Table cells
</li>
1012 <li>body elements.
</li>
1016 <tr><td>body row
4</td>
1018 <tr><td>body row
5</td>
1019 <td colspan=
"2">Cells may also be
1020 empty:
<tt class=
"docutils literal"><span class=
"pre">--
></span></tt></td>
1026 <div class=
"section" id=
"list-tables">
1027 <h2><a class=
"toc-backref" href=
"#id72">2.22 List Tables
</a></h2>
1028 <p>Here's a list table exercising all features:
</p>
1029 <table border=
"1" class=
"test docutils">
1030 <caption>list table with integral header
</caption>
1036 <thead valign=
"bottom">
1037 <tr><th class=
"head stub">Treat
</th>
1038 <th class=
"head">Quantity
</th>
1039 <th class=
"head">Description
</th>
1042 <tbody valign=
"top">
1043 <tr><th class=
"stub">Albatross
</th>
1045 <td>On a stick!
</td>
1047 <tr><th class=
"stub">Crunchy Frog
</th>
1049 <td>If we took the bones out, it wouldn't be
1050 crunchy, now would it?
</td>
1052 <tr><th class=
"stub">Gannet Ripple
</th>
1054 <td>On a stick!
</td>
1059 <div class=
"section" id=
"custom-roles">
1060 <h2><a class=
"toc-backref" href=
"#id73">2.23 Custom Roles
</a></h2>
1062 <li><p class=
"first">A role based on an existing role.
</p>
1063 <p><tt class=
"custom docutils literal">one
</tt> <tt class=
"custom docutils literal">two
</tt> <tt class=
"custom docutils literal">three
</tt></p>
1065 <li><p class=
"first">A new role.
</p>
1066 <p><span class=
"customnew">one two three
</span></p>
1068 <li><p class=
"first">A role with class attribute.
</p>
1069 <p><span class=
"special">interpreted text
</span></p>
1071 <li><p class=
"first">A language-switching role:
</p>
1072 <p>Let's count in German
<span lang=
"de">eins zwei drei
</span>.
</p>
1074 <li><p class=
"first">A role with multiple class attributes, styled with raw directives:
</p>
1075 <p>The following works in most browsers but does not validate
1076 (
<tt class=
"docutils literal"><style
></tt> is only allowed in the document head):
</p>
1077 <pre class=
"literal-block">
1080 <style type=
"text/css
"><!--
1081 .green {color: green;}
1082 .sc {font-variant: small-caps;}
1083 --
></style
>
1085 <p><span class=
"green sc" lang=
"en-gb">British colourful text in small-caps
</span>.
</p>
1089 <div class=
"section" id=
"svg-images">
1090 <h2><a class=
"toc-backref" href=
"#id74">2.24 SVG Images
</a></h2>
1091 <object class=
"align-left" data=
"../../../docs/user/rst/images/biohazard.svg" style=
"width: 48px; height: 48px;" type=
"image/svg+xml">
1092 ../../../docs/user/rst/images/biohazard.svg
</object>
1093 <p>Scalable vector graphics (SVG) images are the only standards-compliable way
1094 to include vector graphics in HTML documents. However, they are not
1095 supported by all backends/output formats. (E.g., LaTeX supports the
1096 PDF or Postscript formats for vector graphics instead.)
</p>
1097 <p>Rendering behaviour varies, depending on
</p>
1098 <ol class=
"loweralpha">
1099 <li><p class=
"first">The SVG image itself, e.g. fixed-size vs. scaling:
</p>
1100 <pre class=
"literal-block">
1101 width=
"280" viewBox=
"0 0 280 27"
1102 height=
"27" width=
"100%
"
1103 height=
"100%
"
1106 <li><p class=
"first">The method used to put the image in the document.
</p>
1107 <p>For HTML, there are several alternatives including:
</p>
1109 <li>using the HTML
<tt class=
"docutils literal"><img
></tt> tag (not for interactive/animated SVG),
</li>
1110 <li>using the HTML
<tt class=
"docutils literal"><object
></tt> tag,
</li>
1111 <li>including within SVG using the SVG
<tt class=
"docutils literal"><image
></tt> tag,
</li>
1112 <li>embedd the SVG code within HTML (inlining).
</li>
1114 <p>The
<cite>html4css1
</cite> writer uses
<tt class=
"docutils literal"><object
></tt> tags, the
<cite>html-base
</cite> and
<cite>xhtml11
</cite>
1115 writers use
<tt class=
"docutils literal"><img
></tt> tags.
</p>
1116 <!-- cf. http://edutechwiki.unige.ch/en/Using_SVG_with_HTML5_tutorial -->
1118 <li><p class=
"first">The viewing agent.
</p>
1119 <p>All up-to-date HTML browsers support SVG, however not all do this fully
1120 and in the same manner. Many older versions, especially IE
< 9, have
1121 deficiencies or require plug-ins (i.e. don't support the
<tt class=
"docutils literal"><img
></tt> tag).
</p>
1124 <p>If the image is wrapped in
<tt class=
"docutils literal"><object
></tt> or
<tt class=
"docutils literal"><svg
></tt> tags, it depends on the
1125 <tt class=
"docutils literal">viewBox
</tt> declaration inside the images root
<tt class=
"docutils literal"><svg
></tt> element whether an
1126 SVG image is scaled or clipped/padded. Images wrapped in
<tt class=
"docutils literal"><img
></tt> are
1129 <li><object class=
"first align-right" data=
"../../../docs/user/rst/images/title-scaling.svg" style=
"width: 50%;" type=
"image/svg+xml">
1130 ../../../docs/user/rst/images/title-scaling.svg
</object>
1131 <p>A scaling image (scales with the browser window), occupying
50% of the line
1132 width. The
<tt class=
"docutils literal">viewBox
</tt> setting in the image file enables auto-scaling also in
1133 <tt class=
"docutils literal"><object
></tt> tags and embedded SVG (if width and hight are set to
100% in the
1134 SVG
<image
> tag).
</p>
1136 <li><object class=
"first align-right" data=
"../../../docs/user/rst/images/title.svg" style=
"width: 50%; height: 15px;" type=
"image/svg+xml">
1137 ../../../docs/user/rst/images/title.svg
</object>
1138 <p>A fixed-size image in a box
50% wide and
15 pixles high. This image is
1139 scaled, if wrapped in an
<tt class=
"docutils literal"><img
></tt> tag but clipped in an
<tt class=
"docutils literal"><object
></tt> tag
1142 <li><object class=
"first align-right" data=
"../../../docs/user/rst/images/title-scaling.svg" style=
"width: 50%; height: 1.5em;" type=
"image/svg+xml">
1143 ../../../docs/user/rst/images/title-scaling.svg
</object>
1144 <p>A right aligned, scaling image
50% wide and
1.5 em high. (This SVG image
1145 keeps the aspect ratio.)
</p>
1147 <li><p class=
"first">An inline image
<object data=
"../../../docs/user/rst/images/biohazard-scaling.svg" style=
"height: 0.8em;" type=
"image/svg+xml">inline-svg
</object> scaled to a height of
0.8 em.
</p>
1149 <li><object class=
"first align-right" data=
"../../../docs/user/rst/images/biohazard-scaling.svg" style=
"height: 1em;" type=
"image/svg+xml">
1150 ../../../docs/user/rst/images/biohazard-scaling.svg
</object>
1151 <p>A scaling image
1 em high, right aligned:
</p>
1153 <li><p class=
"first">A scaling image
5 mm x
5 mm, centered, with hyperlink reference:
</p>
1154 <a class=
"reference external image-reference" href=
"SVGImages_"><object class=
"align-center" data=
"../../../docs/user/rst/images/biohazard-scaling.svg" style=
"width: 5mm; height: 5mm;" type=
"image/svg+xml">../../../docs/user/rst/images/biohazard-scaling.svg
</object></a>
1156 <li><object class=
"first align-right" data=
"../../../docs/user/rst/images/biohazard.svg" style=
"width: 4cm; height: 2em;" type=
"image/svg+xml">
1157 ../../../docs/user/rst/images/biohazard.svg
</object>
1158 <p>A fixed-size image in a
4 cm x
2 em box.
</p>
1161 <p>Older versions of
<cite>webkit
</cite> based browsers (chromium, safari, midori,
1162 konqueror) support the
<tt class=
"docutils literal"><img
></tt> tag but don't display contained bitmap
1163 images in this case.
</p>
1165 <li><object class=
"first align-right" data=
"../../../docs/user/rst/images/biohazard-bitmap.svg" style=
"width: 3em;" type=
"image/svg+xml">
1166 ../../../docs/user/rst/images/biohazard-bitmap.svg
</object>
1167 <p>A small, fixed-size SVG image with embedded bitmap, The
<tt class=
"docutils literal">:width:
</tt> is
1168 set to
3 em in the rST source. Does not scale if wrapped in
<tt class=
"docutils literal"><object
></tt>
1171 <li><object class=
"first align-right" data=
"../../../docs/user/rst/images/biohazard-bitmap-scaling.svg" style=
"width: 3em;" type=
"image/svg+xml">
1172 ../../../docs/user/rst/images/biohazard-bitmap-scaling.svg
</object>
1173 <p>A scaling SVG image with embedded bitmap,
3 em wide.
</p>
1176 <p>SVG images can also be put in figures:
</p>
1178 <div class=
"figure align-center">
1179 <object data=
"../../../docs/user/rst/images/title.svg" style=
"width: 290px; height: 28px;" type=
"image/svg+xml">
1180 reStructuredText, the markup syntax
</object>
1181 <p class=
"caption"><strong>Figure:
</strong> SVG image in a figure.
</p>
1185 <div class=
"section" id=
"swf-images">
1186 <h2><a class=
"toc-backref" href=
"#id75">2.25 SWF Images
</a></h2>
1187 <p>Shockwave Flash is an image/movie format that most modern web browsers
1188 support via a plugin. It is sometimes blocked due to privacy/security
1190 <p>Images with extension
<tt class=
"docutils literal">.swf
</tt> are placed inside
<object
> elements.
1191 For complete control over display options use raw HTML.
</p>
1192 <object class=
"align-left" data=
"../../../docs/user/rst/images/biohazard.swf" style=
"width: 4cm; height: 2em;" type=
"application/x-shockwave-flash">
1193 [biohazard.swf]
</object>
1194 <p>An SWF image in a
4 cm x
2 em box, left aligned.
</p>
1195 <p>An inline SWF image
<object data=
"../../../docs/user/rst/images/biohazard.swf" style=
"width: 0.8em; height: 0.8em;" type=
"application/x-shockwave-flash">inline-swf
</object> scaled to
0.8 em x
0.8 em.
</p>
1198 <div class=
"section" id=
"error-handling">
1199 <h1><a class=
"toc-backref" href=
"#id76">3 Error Handling
</a></h1>
1200 <p>Any errors caught during processing will generate system messages.
</p>
1201 <p>There should be five messages in the following, auto-generated
1202 section,
"Docutils System Messages
":
</p>
1203 <!-- section should be added by Docutils automatically -->
1205 <div class=
"system-messages section">
1206 <h1>Docutils System Messages
</h1>
1207 <div class=
"system-message" id=
"id23">
1208 <p class=
"system-message-title">System Message: ERROR/
3 (
<tt class=
"docutils">functional/input/data/standard.txt
</tt>, line
104);
<em><a href=
"#id24">backlink
</a></em></p>
1209 Undefined substitution referenced:
"problematic
".
</div>
1210 <div class=
"system-message" id=
"id86">
1211 <p class=
"system-message-title">System Message: ERROR/
3 (
<tt class=
"docutils">functional/input/data/standard.txt
</tt>, line
391);
<em><a href=
"#id87">backlink
</a></em></p>
1212 Unknown target name:
"5".
</div>
1213 <div class=
"system-message" id=
"id88">
1214 <p class=
"system-message-title">System Message: ERROR/
3 (
<tt class=
"docutils">functional/input/data/standard.txt
</tt>, line
400);
<em><a href=
"#id89">backlink
</a></em></p>
1215 Unknown target name:
"nonexistent
".
</div>
1216 <div class=
"system-message" id=
"id90">
1217 <p class=
"system-message-title">System Message: ERROR/
3 (
<tt class=
"docutils">functional/input/data/standard.txt
</tt>, line
427);
<em><a href=
"#id91">backlink
</a></em></p>
1218 Unknown target name:
"hyperlink reference without a target
".
</div>
1219 <div class=
"system-message" id=
"id92">
1220 <p class=
"system-message-title">System Message: ERROR/
3 (
<tt class=
"docutils">functional/input/data/standard.txt
</tt>, line
440);
<em><a href=
"#id93">backlink
</a></em></p>
1221 Duplicate target name, cannot be used as a unique reference:
"duplicate target names
".
</div>
1224 <div class=
"footer">
1225 <hr class=
"footer" />
1226 <p>Document footer
</p>
1227 <p><a class=
"reference external" href=
"http://validator.w3.org/check?uri=referer"><img alt=
"Valid XHTML 1.0!" src=
"http://www.w3.org/Icons/valid-xhtml10" style=
"width: 88px; height: 31px;" /></a> <a class=
"reference external" href=
"http://jigsaw.w3.org/css-validator/check/referer"><img alt=
"Valid CSS 2.1!" src=
"http://jigsaw.w3.org/css-validator/images/vcss" style=
"width: 88px; height: 31px;" /></a></p>