Fix [ 3527842 ].
[docutils.git] / test / functional / expected / standalone_rst_html4css1.html
blob92c18b029f9d9602df7eca7288797173b335d02c
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">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Docutils 0.10: 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 <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
16 <link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
17 </head>
18 <body>
19 <div class="header">
20 Document header
21 <hr class="header"/>
22 </div>
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" />
30 <tbody valign="top">
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">
35 123 Example Street
36 Example, EX Canada
37 A1B 2C3
38 </pre>
39 </td></tr>
40 <tr><th class="docinfo-name">Contact:</th>
41 <td><a class="first last reference external" href="mailto:goodger&#64;python.org">goodger&#64;python.org</a></td></tr>
42 <tr><th class="docinfo-name">Authors:</th>
43 <td>Me
44 <br />Myself
45 <br />I</td></tr>
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 &quot;work in progress&quot;</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>
55 <td>1</td></tr>
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
63 desires.</td></tr>
64 <tr class="field"><th class="docinfo-name">field name:</th><td class="field-body">This is a &quot;generic bibliographic field&quot;.</td>
65 </tr>
66 <tr class="field"><th class="docinfo-name">field name &quot;2&quot;:</th><td class="field-body"><p class="first">Generic bibliographic fields may contain multiple body elements.</p>
67 <p class="last">Like this.</p>
68 </td>
69 </tr>
70 </tbody>
71 </table>
72 <div class="dedication topic">
73 <p class="topic-title first">Dedication</p>
74 <p>For Docutils users &amp; co-developers.</p>
75 </div>
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>
80 </div>
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&nbsp;&nbsp;&nbsp;Structural Elements</a><ul class="auto-toc">
90 <li><a class="reference internal" href="#section-title" id="id35">1.1&nbsp;&nbsp;&nbsp;Section Title</a></li>
91 <li><a class="reference internal" href="#empty-section" id="id36">1.2&nbsp;&nbsp;&nbsp;Empty Section</a></li>
92 <li><a class="reference internal" href="#transitions" id="id37">1.3&nbsp;&nbsp;&nbsp;Transitions</a></li>
93 </ul>
94 </li>
95 <li><a class="reference internal" href="#body-elements" id="id38">2&nbsp;&nbsp;&nbsp;Body Elements</a><ul class="auto-toc">
96 <li><a class="reference internal" href="#paragraphs" id="id39">2.1&nbsp;&nbsp;&nbsp;Paragraphs</a><ul class="auto-toc">
97 <li><a class="reference internal" href="#inline-markup" id="id40">2.1.1&nbsp;&nbsp;&nbsp;Inline Markup</a></li>
98 </ul>
99 </li>
100 <li><a class="reference internal" href="#bullet-lists" id="id41">2.2&nbsp;&nbsp;&nbsp;Bullet Lists</a></li>
101 <li><a class="reference internal" href="#enumerated-lists" id="id42">2.3&nbsp;&nbsp;&nbsp;Enumerated Lists</a></li>
102 <li><a class="reference internal" href="#definition-lists" id="id43">2.4&nbsp;&nbsp;&nbsp;Definition Lists</a></li>
103 <li><a class="reference internal" href="#field-lists" id="id44">2.5&nbsp;&nbsp;&nbsp;Field Lists</a></li>
104 <li><a class="reference internal" href="#option-lists" id="id45">2.6&nbsp;&nbsp;&nbsp;Option Lists</a></li>
105 <li><a class="reference internal" href="#literal-blocks" id="id46">2.7&nbsp;&nbsp;&nbsp;Literal Blocks</a></li>
106 <li><a class="reference internal" href="#line-blocks" id="id47">2.8&nbsp;&nbsp;&nbsp;Line Blocks</a></li>
107 <li><a class="reference internal" href="#block-quotes" id="id48">2.9&nbsp;&nbsp;&nbsp;Block Quotes</a></li>
108 <li><a class="reference internal" href="#doctest-blocks" id="id49">2.10&nbsp;&nbsp;&nbsp;Doctest Blocks</a></li>
109 <li><a class="reference internal" href="#footnotes" id="id50">2.11&nbsp;&nbsp;&nbsp;Footnotes</a></li>
110 <li><a class="reference internal" href="#citations" id="id51">2.12&nbsp;&nbsp;&nbsp;Citations</a></li>
111 <li><a class="reference internal" href="#targets" id="id52">2.13&nbsp;&nbsp;&nbsp;Targets</a><ul class="auto-toc">
112 <li><a class="reference internal" href="#duplicate-target-names" id="id53">2.13.1&nbsp;&nbsp;&nbsp;Duplicate Target Names</a></li>
113 <li><a class="reference internal" href="#id21" id="id54">2.13.2&nbsp;&nbsp;&nbsp;Duplicate Target Names</a></li>
114 </ul>
115 </li>
116 <li><a class="reference internal" href="#directives" id="id55">2.14&nbsp;&nbsp;&nbsp;Directives</a><ul class="auto-toc">
117 <li><a class="reference internal" href="#document-parts" id="id56">2.14.1&nbsp;&nbsp;&nbsp;Document Parts</a></li>
118 <li><a class="reference internal" href="#images-and-figures" id="id57">2.14.2&nbsp;&nbsp;&nbsp;Images and Figures</a></li>
119 <li><a class="reference internal" href="#admonitions" id="id58">2.14.3&nbsp;&nbsp;&nbsp;Admonitions</a></li>
120 <li><a class="reference internal" href="#topics-sidebars-and-rubrics" id="id59">2.14.4&nbsp;&nbsp;&nbsp;Topics, Sidebars, and Rubrics</a></li>
121 <li><a class="reference internal" href="#target-footnotes" id="id60">2.14.5&nbsp;&nbsp;&nbsp;Target Footnotes</a></li>
122 <li><a class="reference internal" href="#replacement-text" id="id61">2.14.6&nbsp;&nbsp;&nbsp;Replacement Text</a></li>
123 <li><a class="reference internal" href="#compound-paragraph" id="id62">2.14.7&nbsp;&nbsp;&nbsp;Compound Paragraph</a></li>
124 <li><a class="reference internal" href="#parsed-literal-blocks" id="id63">2.14.8&nbsp;&nbsp;&nbsp;Parsed Literal Blocks</a></li>
125 <li><a class="reference internal" href="#code" id="id64">2.14.9&nbsp;&nbsp;&nbsp;Code</a></li>
126 </ul>
127 </li>
128 <li><a class="reference internal" href="#substitution-definitions" id="id65">2.15&nbsp;&nbsp;&nbsp;Substitution Definitions</a></li>
129 <li><a class="reference internal" href="#comments" id="id66">2.16&nbsp;&nbsp;&nbsp;Comments</a></li>
130 <li><a class="reference internal" href="#raw-text" id="id67">2.17&nbsp;&nbsp;&nbsp;Raw text</a></li>
131 <li><a class="reference internal" href="#container" id="id68">2.18&nbsp;&nbsp;&nbsp;Container</a></li>
132 <li><a class="reference internal" href="#colspanning-tables" id="id69">2.19&nbsp;&nbsp;&nbsp;Colspanning tables</a></li>
133 <li><a class="reference internal" href="#rowspanning-tables" id="id70">2.20&nbsp;&nbsp;&nbsp;Rowspanning tables</a></li>
134 <li><a class="reference internal" href="#complex-tables" id="id71">2.21&nbsp;&nbsp;&nbsp;Complex tables</a></li>
135 <li><a class="reference internal" href="#list-tables" id="id72">2.22&nbsp;&nbsp;&nbsp;List Tables</a></li>
136 <li><a class="reference internal" href="#custom-roles" id="id73">2.23&nbsp;&nbsp;&nbsp;Custom Roles</a></li>
137 <li><a class="reference internal" href="#svg-images" id="id74">2.24&nbsp;&nbsp;&nbsp;SVG Images</a></li>
138 <li><a class="reference internal" href="#swf-images" id="id75">2.25&nbsp;&nbsp;&nbsp;SWF Images</a></li>
139 </ul>
140 </li>
141 <li><a class="reference internal" href="#error-handling" id="id76">3&nbsp;&nbsp;&nbsp;Error Handling</a></li>
142 </ul>
143 </div>
144 <div class="section" id="structural-elements">
145 <h1><a class="toc-backref" href="#id34">1&nbsp;&nbsp;&nbsp;Structural Elements</a></h1>
146 <div class="section" id="section-title">
147 <h2 class="with-subtitle"><a class="toc-backref" href="#id35">1.1&nbsp;&nbsp;&nbsp;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>
152 </div>
153 <div class="section" id="empty-section">
154 <h2><a class="toc-backref" href="#id36">1.2&nbsp;&nbsp;&nbsp;Empty Section</a></h2>
155 </div>
156 <div class="section" id="transitions">
157 <h2><a class="toc-backref" href="#id37">1.3&nbsp;&nbsp;&nbsp;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>
161 </div>
162 </div>
163 <hr class="docutils" />
164 <div class="section" id="body-elements">
165 <h1><a class="toc-backref" href="#id38">2&nbsp;&nbsp;&nbsp;Body Elements</a></h1>
166 <div class="section" id="paragraphs">
167 <h2><a class="toc-backref" href="#id39">2.1&nbsp;&nbsp;&nbsp;Paragraphs</a></h2>
168 <p>A paragraph.</p>
169 <div class="section" id="inline-markup">
170 <h3><a class="toc-backref" href="#id40">2.1.1&nbsp;&nbsp;&nbsp;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://www.faqs.org/rfcs/rfc2822.html">RFC 2822</a>); an abbreviation (<abbr>abb.</abbr>), an acronym
187 (<acronym>reST</acronym>), code (<tt class="code docutils literal">print &quot;hello world&quot;</tt>); 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>&nbsp; <span class="pre">Adjust-the-width-of-your-browser-window</span>
194 to see how the text is wrapped.&nbsp; <span class="pre">--</span> <span class="pre">----</span> <span class="pre">--------</span>&nbsp; Now note&nbsp;&nbsp;&nbsp; the
195 spacing&nbsp;&nbsp;&nbsp; between the&nbsp;&nbsp;&nbsp; words of&nbsp;&nbsp;&nbsp; this sentence&nbsp;&nbsp;&nbsp; (words
196 should&nbsp;&nbsp;&nbsp; be grouped&nbsp;&nbsp;&nbsp; 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>
199 </div>
200 </div>
201 <div class="section" id="bullet-lists">
202 <h2><a class="toc-backref" href="#id41">2.2&nbsp;&nbsp;&nbsp;Bullet Lists</a></h2>
203 <ul>
204 <li><p class="first">A bullet list</p>
205 <ul class="simple">
206 <li>Nested bullet list.</li>
207 <li>Nested item 2.</li>
208 </ul>
209 </li>
210 <li><p class="first">Item 2.</p>
211 <p>Paragraph 2 of item 2.</p>
212 <ul class="simple">
213 <li>Nested bullet list.</li>
214 <li>Nested item 2.<ul>
215 <li>Third level.</li>
216 <li>Item 2.</li>
217 </ul>
218 </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. -->
221 </li>
222 </ul>
223 </li>
224 </ul>
225 </div>
226 <div class="section" id="enumerated-lists">
227 <h2><a class="toc-backref" href="#id42">2.3&nbsp;&nbsp;&nbsp;Enumerated Lists</a></h2>
228 <ol class="arabic">
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>
235 </ol>
236 </li>
237 </ol>
238 </li>
239 </ol>
240 </li>
241 </ol>
242 </li>
243 <li><p class="first">Lists that don't start at 1:</p>
244 <ol class="arabic simple" start="3">
245 <li>Three</li>
246 <li>Four</li>
247 </ol>
248 <ol class="upperalpha simple" start="3">
249 <li>C</li>
250 <li>D</li>
251 </ol>
252 <ol class="lowerroman simple" start="3">
253 <li>iii</li>
254 <li>iv</li>
255 </ol>
256 </li>
257 </ol>
258 </div>
259 <div class="section" id="definition-lists">
260 <h2><a class="toc-backref" href="#id43">2.4&nbsp;&nbsp;&nbsp;Definition Lists</a></h2>
261 <dl class="docutils">
262 <dt>Term</dt>
263 <dd>Definition</dd>
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>
267 </dd>
268 <dt>Term</dt>
269 <dd>Definition</dd>
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>
271 <dd>Definition</dd>
272 </dl>
273 </div>
274 <div class="section" id="field-lists">
275 <h2><a class="toc-backref" href="#id44">2.5&nbsp;&nbsp;&nbsp;Field Lists</a></h2>
276 <table class="docutils field-list" frame="void" rules="none">
277 <col class="field-name" />
278 <col class="field-body" />
279 <tbody valign="top">
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>
283 </td>
284 </tr>
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>
288 </td>
289 </tr>
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>
293 </td>
294 </tr>
295 </tbody>
296 </table>
297 </div>
298 <div class="section" id="option-lists">
299 <h2><a class="toc-backref" href="#id45">2.6&nbsp;&nbsp;&nbsp;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" />
304 <tbody valign="top">
305 <tr><td class="option-group">
306 <kbd><span class="option">-a</span></kbd></td>
307 <td>command-line option &quot;a&quot;</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
318 arguments</td></tr>
319 <tr><td class="option-group" colspan="2">
320 <kbd><span class="option">--very-long-option</span></kbd></td>
321 </tr>
322 <tr><td>&nbsp;</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>
325 </td></tr>
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 &quot;option group&quot;.</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 &amp; 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>
334 </tr>
335 <tr><td>&nbsp;</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>
339 </tbody>
340 </table>
341 <p>There must be at least two spaces between the option and the
342 description.</p>
343 </div>
344 <div class="section" id="literal-blocks">
345 <h2><a class="toc-backref" href="#id46">2.7&nbsp;&nbsp;&nbsp;Literal Blocks</a></h2>
346 <p>Literal blocks are indicated with a double-colon (&quot;::&quot;) at the end of
347 the preceding paragraph (over there <tt class="docutils literal"><span class="pre">--&gt;</span></tt>). They can be indented:</p>
348 <pre class="literal-block">
349 if literal_block:
350 text = 'is left as-is'
351 spaces_and_linebreaks = 'are preserved'
352 markup_processing = None
353 </pre>
354 <p>Or they can be quoted without indentation:</p>
355 <pre class="literal-block">
356 &gt;&gt; Great idea!
357 &gt;
358 &gt; Why didn't I think of that?
359 </pre>
360 </div>
361 <div class="section" id="line-blocks">
362 <h2><a class="toc-backref" href="#id47">2.8&nbsp;&nbsp;&nbsp;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
365 indentation.</p>
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 (&quot;|&quot;).</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>
374 </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>
377 </div>
378 </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 &quot;|&quot;.</div>
383 </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>
390 </div>
391 <p>Take it away, Eric the Orchestra Leader!</p>
392 <blockquote>
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>
399 </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>
404 </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>
413 </div>
414 </div>
415 </div>
416 <div class="line">Singing...</div>
417 </div>
418 </blockquote>
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 &nbsp; 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>
433 </div>
434 </div>
435 <div class="section" id="block-quotes">
436 <h2><a class="toc-backref" href="#id48">2.9&nbsp;&nbsp;&nbsp;Block Quotes</a></h2>
437 <p>Block quotes consist of indented body elements:</p>
438 <blockquote>
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">&mdash;Anne Elk (Miss)</p>
445 </blockquote>
446 <p>The language of a quote (like any other object) can be specified by
447 a class attribute:</p>
448 <!-- -->
449 <blockquote lang="fr">
450 ReStructuredText est un langage de balisage léger utilisé
451 notamment dans la documentation du langage Python.</blockquote>
452 </div>
453 <div class="section" id="doctest-blocks">
454 <h2><a class="toc-backref" href="#id49">2.10&nbsp;&nbsp;&nbsp;Doctest Blocks</a></h2>
455 <pre class="doctest-block">
456 &gt;&gt;&gt; print 'Python-specific usage examples; begun with &quot;&gt;&gt;&gt;&quot;'
457 Python-specific usage examples; begun with &quot;&gt;&gt;&gt;&quot;
458 &gt;&gt;&gt; print '(cut and pasted from interactive Python sessions)'
459 (cut and pasted from interactive Python sessions)
460 </pre>
461 </div>
462 <div class="section" id="footnotes">
463 <h2><a class="toc-backref" href="#id50">2.11&nbsp;&nbsp;&nbsp;Footnotes</a></h2>
464 <table class="docutils footnote" frame="void" id="id8" rules="none">
465 <colgroup><col class="label" /><col /></colgroup>
466 <tbody valign="top">
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
468 least 3 spaces.</p>
469 <p class="last">This is the footnote's second paragraph.</p>
470 </td></tr>
471 </tbody>
472 </table>
473 <table class="docutils footnote" frame="void" id="label" rules="none">
474 <colgroup><col class="label" /><col /></colgroup>
475 <tbody valign="top">
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 &quot;#&quot;-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>
480 </tbody>
481 </table>
482 <table class="docutils footnote" frame="void" id="id12" rules="none">
483 <colgroup><col class="label" /><col /></colgroup>
484 <tbody valign="top">
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 &quot;#&quot; only.</p>
487 <p>This is the second paragraph.</p>
488 <p class="last">And this is the third paragraph.</p>
489 </td></tr>
490 </tbody>
491 </table>
492 <table class="docutils footnote" frame="void" id="id13" rules="none">
493 <colgroup><col class="label" /><col /></colgroup>
494 <tbody valign="top">
495 <tr><td class="label"><a class="fn-backref" href="#id4">[*]</a></td><td>Footnotes may also use symbols, specified with a &quot;*&quot; label.
496 Here's a reference to the next footnote: <a class="footnote-reference" href="#id15" id="id14">[†]</a>.</td></tr>
497 </tbody>
498 </table>
499 <table class="docutils footnote" frame="void" id="id15" rules="none">
500 <colgroup><col class="label" /><col /></colgroup>
501 <tbody valign="top">
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>
503 </tbody>
504 </table>
505 <table class="docutils footnote" frame="void" id="id16" rules="none">
506 <colgroup><col class="label" /><col /></colgroup>
507 <tbody valign="top">
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>
510 </tbody>
511 </table>
512 </div>
513 <div class="section" id="citations">
514 <h2><a class="toc-backref" href="#id51">2.12&nbsp;&nbsp;&nbsp;Citations</a></h2>
515 <table class="docutils citation" frame="void" id="cit2002" rules="none">
516 <colgroup><col class="label" /><col /></colgroup>
517 <tbody valign="top">
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>
520 </tbody>
521 </table>
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>
523 citation.</p>
524 </div>
525 <div class="section" id="targets">
526 <span id="another-target"></span><h2><a class="toc-backref" href="#id52">2.13&nbsp;&nbsp;&nbsp;Targets</a></h2>
527 <p id="example">This paragraph is pointed to by the explicit &quot;example&quot; 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 &quot;<a class="reference external" href="http://www.python.org/">Python</a> <a class="footnote-reference" href="#id25" id="id27">[5]</a>&quot;.</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
537 error.</p>
538 <div class="section" id="duplicate-target-names">
539 <h3><a class="toc-backref" href="#id53">2.13.1&nbsp;&nbsp;&nbsp;Duplicate Target Names</a></h3>
540 <p>Duplicate names in section headers or other implicit targets will
541 generate &quot;info&quot; (level-1) system messages. Duplicate names in
542 explicit targets will generate &quot;warning&quot; (level-2) system messages.</p>
543 </div>
544 <div class="section" id="id21">
545 <h3><a class="toc-backref" href="#id54">2.13.2&nbsp;&nbsp;&nbsp;Duplicate Target Names</a></h3>
546 <p>Since there are two &quot;Duplicate Target Names&quot; 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>
549 </div>
550 </div>
551 <div class="section" id="directives">
552 <h2><a class="toc-backref" href="#id55">2.14&nbsp;&nbsp;&nbsp;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&nbsp;&nbsp;&nbsp;Document Parts</a></li>
556 <li><a class="reference internal" href="#images-and-figures" id="id78">2.14.2&nbsp;&nbsp;&nbsp;Images and Figures</a></li>
557 <li><a class="reference internal" href="#admonitions" id="id79">2.14.3&nbsp;&nbsp;&nbsp;Admonitions</a></li>
558 <li><a class="reference internal" href="#topics-sidebars-and-rubrics" id="id80">2.14.4&nbsp;&nbsp;&nbsp;Topics, Sidebars, and Rubrics</a></li>
559 <li><a class="reference internal" href="#target-footnotes" id="id81">2.14.5&nbsp;&nbsp;&nbsp;Target Footnotes</a></li>
560 <li><a class="reference internal" href="#replacement-text" id="id82">2.14.6&nbsp;&nbsp;&nbsp;Replacement Text</a></li>
561 <li><a class="reference internal" href="#compound-paragraph" id="id83">2.14.7&nbsp;&nbsp;&nbsp;Compound Paragraph</a></li>
562 <li><a class="reference internal" href="#parsed-literal-blocks" id="id84">2.14.8&nbsp;&nbsp;&nbsp;Parsed Literal Blocks</a></li>
563 <li><a class="reference internal" href="#code" id="id85">2.14.9&nbsp;&nbsp;&nbsp;Code</a></li>
564 </ul>
565 </div>
566 <p>These are just a sample of the many reStructuredText Directives. For
567 others, please see
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&nbsp;&nbsp;&nbsp;Document Parts</a></h3>
571 <p>An example of the &quot;contents&quot; 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>
574 </div>
575 <div class="section" id="images-and-figures">
576 <h3><a class="toc-backref" href="#id78">2.14.2&nbsp;&nbsp;&nbsp;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>
594 <p>Image size:</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
605 layout.</p>
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>
609 <div class="legend">
610 <table border="1" class="docutils">
611 <colgroup>
612 <col width="20%" />
613 <col width="80%" />
614 </colgroup>
615 <tbody valign="top">
616 <tr><td>re</td>
617 <td>Revised, revisited, based on 're' module.</td>
618 </tr>
619 <tr><td>Structured</td>
620 <td>Structure-enhanced text, structuredtext.</td>
621 </tr>
622 <tr><td>Text</td>
623 <td>Well it is, isn't it?</td>
624 </tr>
625 </tbody>
626 </table>
627 <p>This paragraph is also part of the legend.</p>
628 </div>
629 </div>
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>
634 <div class="legend">
635 <p>This is the legend.</p>
636 <p>The legend may consist of several paragraphs.</p>
637 </div>
638 </div>
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>
646 <div class="legend">
647 <p>This is the legend.</p>
648 <p>The legend may consist of several paragraphs.</p>
649 </div>
650 </div>
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>
658 <div class="legend">
659 <p>This is the legend.</p>
660 <p>The legend may consist of several paragraphs.</p>
661 </div>
662 </div>
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>
665 </div>
666 <div class="section" id="admonitions">
667 <h3><a class="toc-backref" href="#id79">2.14.3&nbsp;&nbsp;&nbsp;Admonitions</a></h3>
668 <div class="attention">
669 <p class="first admonition-title">Attention!</p>
670 <p class="last">Directives at large.</p>
671 </div>
672 <div class="caution">
673 <p class="first admonition-title">Caution!</p>
674 <p class="last">Don't take any wooden nickels.</p>
675 </div>
676 <div class="danger">
677 <p class="first admonition-title">!DANGER!</p>
678 <p class="last">Mad scientist at work!</p>
679 </div>
680 <div class="error">
681 <p class="first admonition-title">Error</p>
682 <p class="last">Does not compute.</p>
683 </div>
684 <div class="hint">
685 <p class="first admonition-title">Hint</p>
686 <p class="last">It's bigger than a bread box.</p>
687 </div>
688 <div class="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>
695 </ul>
696 </div>
697 <div class="note">
698 <p class="first admonition-title">Note</p>
699 <p class="last">This is a note.</p>
700 </div>
701 <div class="tip">
702 <p class="first admonition-title">Tip</p>
703 <p class="last">15% if the service is good.</p>
704 </div>
705 <div class="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>
709 </div>
710 <div class="admonition-and-by-the-way admonition">
711 <p class="first admonition-title">And, by the way...</p>
712 <p class="last">You can make up your own admonition too.</p>
713 </div>
714 </div>
715 <div class="section" id="topics-sidebars-and-rubrics">
716 <h3><a class="toc-backref" href="#id80">2.14.4&nbsp;&nbsp;&nbsp;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
722 text.</p>
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>
726 </div>
727 <p>A <em>topic</em> is like a block quote with a title, or a self-contained section
728 with no subsections.</p>
729 <div class="topic">
730 <p class="topic-title first">Topic Title</p>
731 <p>This is a topic.</p>
732 </div>
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>
738 </div>
739 <div class="section" id="target-footnotes">
740 <h3><a class="toc-backref" href="#id81">2.14.5&nbsp;&nbsp;&nbsp;Target Footnotes</a></h3>
741 <table class="docutils footnote" frame="void" id="id25" rules="none">
742 <colgroup><col class="label" /><col /></colgroup>
743 <tbody valign="top">
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>
745 </tbody>
746 </table>
747 <table class="docutils footnote" frame="void" id="id29" rules="none">
748 <colgroup><col class="label" /><col /></colgroup>
749 <tbody valign="top">
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>
751 </tbody>
752 </table>
753 <table class="docutils footnote" frame="void" id="id32" rules="none">
754 <colgroup><col class="label" /><col /></colgroup>
755 <tbody valign="top">
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>
757 </tbody>
758 </table>
759 </div>
760 <div class="section" id="replacement-text">
761 <h3><a class="toc-backref" href="#id82">2.14.6&nbsp;&nbsp;&nbsp;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>
763 </div>
764 <div class="section" id="compound-paragraph">
765 <h3><a class="toc-backref" href="#id83">2.14.7&nbsp;&nbsp;&nbsp;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>
772 </ul>
773 </div>
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">
778 Compound 2, literal.
779 </pre>
780 <p class="compound-last">Compound 2, this is a test.</p>
781 </div>
782 <div class="compound">
783 <p>Compound 3, only consisting of one paragraph.</p>
784 </div>
785 <div class="compound">
786 <pre class="compound-first literal-block">
787 Compound 4.
788 This one starts with a literal block.
789 </pre>
790 <p class="compound-last">Compound 4, a paragraph.</p>
791 </div>
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
794 meaningful.</p>
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>
800 </div>
801 <p class="compound-last">Compound 5, block 3 (a paragraph).</p>
802 </div>
803 <div class="compound">
804 <p class="compound-first">Compound 7, with a table inside:</p>
805 <table border="1" class="compound-middle docutils">
806 <colgroup>
807 <col width="33%" />
808 <col width="33%" />
809 <col width="33%" />
810 </colgroup>
811 <tbody valign="top">
812 <tr><td><p class="first">Left cell, first
813 paragraph.</p>
814 <p class="last">Left cell, second
815 paragraph.</p>
816 </td>
817 <td>Middle cell,
818 consisting of
819 exactly one
820 paragraph.</td>
821 <td><p class="first">Right cell.</p>
822 <p>Paragraph 2.</p>
823 <p class="last">Paragraph 3.</p>
824 </td>
825 </tr>
826 </tbody>
827 </table>
828 <p class="compound-middle">Compound 7, a paragraph after the table.</p>
829 <p class="compound-last">Compound 7, another paragraph.</p>
830 </div>
831 </div>
832 <div class="section" id="parsed-literal-blocks">
833 <h3><a class="toc-backref" href="#id84">2.14.8&nbsp;&nbsp;&nbsp;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>, 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>.
840 </pre>
841 </div>
842 <div class="section" id="code">
843 <h3><a class="toc-backref" href="#id85">2.14.9&nbsp;&nbsp;&nbsp;Code</a></h3>
844 <p>Blocks of source code can be set with the <cite>code</cite> directive. If the code
845 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>
846 syntax highlighter and can be formatted with a style sheet. (Code parsing
847 is turned off using the <tt class="docutils literal"><span class="pre">syntax-highlight</span></tt> config setting in the test
848 conversions in order to get identical results with/without installed
849 Pygments highlighter.)</p>
850 <pre class="code python literal-block">
851 print 'This is Python code.'
852 </pre>
853 <p>The <tt class="docutils literal"><span class="pre">:number-lines:</span></tt> option (with optional start value) generates line
854 numbers:</p>
855 <pre class="code python literal-block">
856 <span class="ln"> 8 </span># print integers from 0 to 9:
857 <span class="ln"> 9 </span>for i in range(10):
858 <span class="ln">10 </span> print i
859 </pre>
860 <p>For inline code snippets, there is the <cite>code</cite> role, which can be used
861 directly (the code will not be parsed/tagged, as the language is not
862 known) or as base for special code roles, e.g.,</p>
863 <!-- -->
864 <blockquote>
865 Docutils uses LaTeX syntax for math directives and roles:
866 <tt class="code latex tex docutils literal">\alpha = f(x)</tt> prints <span class="math">
867 \(\alpha = f(x)\)</span>
868 .</blockquote>
869 <p>The <tt class="docutils literal">:code:</tt> option of the <cite>include</cite> directive sets the included content
870 as a code block, here the rst file <tt class="docutils literal">header_footer.txt</tt> with line numbers:</p>
871 <pre class="code rst literal-block">
872 <span class="ln">1 </span>.. header:: Document header
873 <span class="ln">2 </span>.. footer:: Document footer
874 </pre>
875 </div>
876 </div>
877 <div class="section" id="substitution-definitions">
878 <h2><a class="toc-backref" href="#id65">2.15&nbsp;&nbsp;&nbsp;Substitution Definitions</a></h2>
879 <p>An inline image (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" />) example:</p>
880 <p>(Substitution definitions are not visible in the HTML source.)</p>
881 </div>
882 <div class="section" id="comments">
883 <h2><a class="toc-backref" href="#id66">2.16&nbsp;&nbsp;&nbsp;Comments</a></h2>
884 <p>Here's one:</p>
885 <!-- Comments begin with two dots and a space. Anything may
886 follow, except for the syntax of footnotes, hyperlink
887 targets, directives, or substitution definitions.
889 Double-dashes - - "- -" - - must be escaped somehow in HTML output.
891 Comments may contain non-ASCII characters: ä ö ü æ ø å -->
892 <p>(View the HTML source to see the comment.)</p>
893 </div>
894 <div class="section" id="raw-text">
895 <h2><a class="toc-backref" href="#id67">2.17&nbsp;&nbsp;&nbsp;Raw text</a></h2>
896 <p>This does not necessarily look nice, because there may be missing white space.</p>
897 <p>It's just there to freeze the behavior.</p>
898 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>
899 Fifth test in HTML.<br />Line two.</div>
900 <div class="section" id="container">
901 <h2><a class="toc-backref" href="#id68">2.18&nbsp;&nbsp;&nbsp;Container</a></h2>
902 <div class="custom container">
903 <p>paragraph 1</p>
904 <p>paragraph 2</p>
905 </div>
906 </div>
907 <div class="section" id="colspanning-tables">
908 <h2><a class="toc-backref" href="#id69">2.19&nbsp;&nbsp;&nbsp;Colspanning tables</a></h2>
909 <p>This table has a cell spanning two columns:</p>
910 <table border="1" class="docutils">
911 <colgroup>
912 <col width="31%" />
913 <col width="31%" />
914 <col width="38%" />
915 </colgroup>
916 <thead valign="bottom">
917 <tr><th class="head" colspan="2">Inputs</th>
918 <th class="head">Output</th>
919 </tr>
920 <tr><th class="head">A</th>
921 <th class="head">B</th>
922 <th class="head">A or B</th>
923 </tr>
924 </thead>
925 <tbody valign="top">
926 <tr><td>False</td>
927 <td>False</td>
928 <td>False</td>
929 </tr>
930 <tr><td>True</td>
931 <td>False</td>
932 <td>True</td>
933 </tr>
934 <tr><td>False</td>
935 <td>True</td>
936 <td>True</td>
937 </tr>
938 <tr><td>True</td>
939 <td>True</td>
940 <td>True</td>
941 </tr>
942 </tbody>
943 </table>
944 </div>
945 <div class="section" id="rowspanning-tables">
946 <h2><a class="toc-backref" href="#id70">2.20&nbsp;&nbsp;&nbsp;Rowspanning tables</a></h2>
947 <p>Here's a table with cells spanning several rows:</p>
948 <table border="1" class="docutils">
949 <colgroup>
950 <col width="44%" />
951 <col width="22%" />
952 <col width="33%" />
953 </colgroup>
954 <thead valign="bottom">
955 <tr><th class="head">Header row, column 1
956 (header rows optional)</th>
957 <th class="head">Header 2</th>
958 <th class="head">Header 3</th>
959 </tr>
960 </thead>
961 <tbody valign="top">
962 <tr><td>body row 1, column 1</td>
963 <td>column 2</td>
964 <td>column 3</td>
965 </tr>
966 <tr><td>body row 2</td>
967 <td rowspan="2">Cells may
968 span rows.</td>
969 <td rowspan="2">Another
970 rowspanning
971 cell.</td>
972 </tr>
973 <tr><td>body row 3</td>
974 </tr>
975 </tbody>
976 </table>
977 </div>
978 <div class="section" id="complex-tables">
979 <h2><a class="toc-backref" href="#id71">2.21&nbsp;&nbsp;&nbsp;Complex tables</a></h2>
980 <p>Here's a complex table, which should test all features.</p>
981 <table border="1" class="docutils">
982 <colgroup>
983 <col width="43%" />
984 <col width="21%" />
985 <col width="18%" />
986 <col width="18%" />
987 </colgroup>
988 <thead valign="bottom">
989 <tr><th class="head">Header row, column 1
990 (header rows optional)</th>
991 <th class="head">Header 2</th>
992 <th class="head">Header 3</th>
993 <th class="head">Header 4</th>
994 </tr>
995 </thead>
996 <tbody valign="top">
997 <tr><td>body row 1, column 1</td>
998 <td>column 2</td>
999 <td>column 3</td>
1000 <td>column 4</td>
1001 </tr>
1002 <tr><td>body row 2</td>
1003 <td colspan="3">Cells may span columns.</td>
1004 </tr>
1005 <tr><td>body row 3</td>
1006 <td rowspan="2"><p class="first">Cells may
1007 span rows.</p>
1008 <p class="last">Paragraph.</p>
1009 </td>
1010 <td colspan="2" rowspan="2"><ul class="first last simple">
1011 <li>Table cells</li>
1012 <li>contain</li>
1013 <li>body elements.</li>
1014 </ul>
1015 </td>
1016 </tr>
1017 <tr><td>body row 4</td>
1018 </tr>
1019 <tr><td>body row 5</td>
1020 <td colspan="2">Cells may also be
1021 empty: <tt class="docutils literal"><span class="pre">--&gt;</span></tt></td>
1022 <td>&nbsp;</td>
1023 </tr>
1024 </tbody>
1025 </table>
1026 </div>
1027 <div class="section" id="list-tables">
1028 <h2><a class="toc-backref" href="#id72">2.22&nbsp;&nbsp;&nbsp;List Tables</a></h2>
1029 <p>Here's a list table exercising all features:</p>
1030 <table border="1" class="test docutils">
1031 <caption>list table with integral header</caption>
1032 <colgroup>
1033 <col width="17%" />
1034 <col width="33%" />
1035 <col width="50%" />
1036 </colgroup>
1037 <thead valign="bottom">
1038 <tr><th class="head stub">Treat</th>
1039 <th class="head">Quantity</th>
1040 <th class="head">Description</th>
1041 </tr>
1042 </thead>
1043 <tbody valign="top">
1044 <tr><th class="stub">Albatross</th>
1045 <td>2.99</td>
1046 <td>On a stick!</td>
1047 </tr>
1048 <tr><th class="stub">Crunchy Frog</th>
1049 <td>1.49</td>
1050 <td>If we took the bones out, it wouldn't be
1051 crunchy, now would it?</td>
1052 </tr>
1053 <tr><th class="stub">Gannet Ripple</th>
1054 <td>1.99</td>
1055 <td>On a stick!</td>
1056 </tr>
1057 </tbody>
1058 </table>
1059 </div>
1060 <div class="section" id="custom-roles">
1061 <h2><a class="toc-backref" href="#id73">2.23&nbsp;&nbsp;&nbsp;Custom Roles</a></h2>
1062 <ul>
1063 <li><p class="first">A role based on an existing role.</p>
1064 <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>
1066 <li><p class="first">A new role.</p>
1067 <p><span class="customnew">one two three</span></p>
1068 </li>
1069 <li><p class="first">A role with class attribute.</p>
1070 <p><span class="special">interpreted text</span></p>
1071 </li>
1072 <li><p class="first">A language-switching role:</p>
1073 <p>Let's count in German <span lang="de">eins zwei drei</span>.</p>
1074 </li>
1075 <li><p class="first">A role with multiple class attributes, styled with raw directives:</p>
1076 <p>The following works in most browsers but does not validate
1077 (<tt class="docutils literal">&lt;style&gt;</tt> is only allowed in the document head):</p>
1078 <pre class="literal-block">
1079 .. raw:: html
1081 &lt;style type=&quot;text/css&quot;&gt;&lt;!--
1082 .green {color: green;}
1083 .sc {font-variant: small-caps;}
1084 --&gt;&lt;/style&gt;
1085 </pre>
1086 <p><span class="green sc" lang="en-gb">British colourful text in small-caps</span>.</p>
1087 </li>
1088 </ul>
1089 </div>
1090 <div class="section" id="svg-images">
1091 <h2><a class="toc-backref" href="#id74">2.24&nbsp;&nbsp;&nbsp;SVG Images</a></h2>
1092 <object data="../../../docs/user/rst/images/biohazard.svg" style="width: 48px; height: 48px;" type="image/svg+xml">
1093 ../../../docs/user/rst/images/biohazard.svg</object>
1094 <p>Scalable vector graphics (SVG) images are not supported by all backends.
1095 Rendering depends partially on the backend, especially if the size is
1096 not explicitely given.</p>
1097 <object class="align-left" data="../../../docs/user/rst/images/title-scaling.svg" style="width: 50%;" type="image/svg+xml">
1098 ../../../docs/user/rst/images/title-scaling.svg</object>
1099 <p>A scaling image occupying 50% of the line width (scales with the
1100 browser window).</p>
1101 <p>Whether an SVG image is scaled or clipped/padded cannot be set in the
1102 containing HTML. It depends on the viewport declaration inside its
1103 root &lt;svg&gt; element.</p>
1104 <p>An inline SVG 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>
1105 <object class="align-right" data="../../../docs/user/rst/images/title-scaling.svg" style="width: 50%; height: 1.2em;" type="image/svg+xml">
1106 ../../../docs/user/rst/images/title-scaling.svg</object>
1107 <p>A scaling image occupying 50% of the line width and 1.2 em high,
1108 right aligned (this SVG image keeps the aspect ratio):</p>
1109 <object class="align-left" data="../../../docs/user/rst/images/biohazard-scaling.svg" style="height: 1em;" type="image/svg+xml">
1110 ../../../docs/user/rst/images/biohazard-scaling.svg</object>
1111 <p>A scaling image 1 em high, left aligned.</p>
1112 <p>A scaling image 5 mm x 5 mm, centered, with hyperlink reference:</p>
1113 <a class="reference internal image-reference" href="#directives"><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>
1114 <object class="align-left" data="../../../docs/user/rst/images/biohazard.svg" style="width: 4cm; height: 2em;" type="image/svg+xml">
1115 ../../../docs/user/rst/images/biohazard.svg</object>
1116 <p>A fixed-size image in a 4 cm x 2 em box.</p>
1117 <object class="align-left" data="../../../docs/user/rst/images/title.svg" style="width: 50%; height: 15px;" type="image/svg+xml">
1118 ../../../docs/user/rst/images/title.svg</object>
1119 <p>A fixed-size image in a box 50% the line width and 15 pixle high.</p>
1120 <div class="figure">
1121 <object data="../../../docs/user/rst/images/title.svg" style="width: 290px; height: 28px;" type="image/svg+xml">
1122 reStructuredText, the markup syntax</object>
1123 <p class="caption">SVG image in a figure.</p>
1124 </div>
1125 </div>
1126 <div class="section" id="swf-images">
1127 <h2><a class="toc-backref" href="#id75">2.25&nbsp;&nbsp;&nbsp;SWF Images</a></h2>
1128 <p>Shockwave Flash is an image/movie format that most modern web browsers
1129 support via a plugin. It is sometimes blocked due to privacy/security
1130 concerns.</p>
1131 <p>Images with extension <tt class="docutils literal">.swf</tt> are placed inside &lt;object&gt; elements.
1132 For complete control over display options use raw HTML.</p>
1133 <object class="align-left" data="../../../docs/user/rst/images/biohazard.swf" style="width: 4cm; height: 2em;" type="application/x-shockwave-flash">
1134 [biohazard.swf]</object>
1135 <p>An SWF image in a 4 cm x 2 em box, left aligned.</p>
1136 <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>
1137 </div>
1138 </div>
1139 <div class="section" id="error-handling">
1140 <h1><a class="toc-backref" href="#id76">3&nbsp;&nbsp;&nbsp;Error Handling</a></h1>
1141 <p>Any errors caught during processing will generate system messages.</p>
1142 <p>There should be five messages in the following, auto-generated
1143 section, &quot;Docutils System Messages&quot;:</p>
1144 <!-- section should be added by Docutils automatically -->
1145 </div>
1146 <div class="system-messages section">
1147 <h1>Docutils System Messages</h1>
1148 <div class="system-message" id="id23">
1149 <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>
1150 Undefined substitution referenced: &quot;problematic&quot;.</div>
1151 <div class="system-message" id="id86">
1152 <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>
1153 Unknown target name: &quot;5&quot;.</div>
1154 <div class="system-message" id="id88">
1155 <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>
1156 Unknown target name: &quot;nonexistent&quot;.</div>
1157 <div class="system-message" id="id90">
1158 <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>
1159 Unknown target name: &quot;hyperlink reference without a target&quot;.</div>
1160 <div class="system-message" id="id92">
1161 <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>
1162 Duplicate target name, cannot be used as a unique reference: &quot;duplicate target names&quot;.</div>
1163 </div>
1164 </div>
1165 <div class="footer">
1166 <hr class="footer" />
1167 <p>Document footer</p>
1168 <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>
1170 </div>
1171 </body>
1172 </html>