1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">
3 <!-- Generated by Docutils 0.13.2a -->
4 <document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_docutils_xml.txt" title="reStructuredText Test Document">
5 <title>reStructuredText Test Document</title>
6 <subtitle ids="examples-of-syntax-constructs subtitle" names="examples\ of\ syntax\ constructs subtitle">Examples of Syntax Constructs</subtitle>
9 <paragraph>Document header</paragraph>
12 <paragraph>Document footer</paragraph>
16 <author>David Goodger</author>
17 <address xml:space="preserve">123 Example Street
20 <contact><reference refuri="mailto:goodger@python.org">goodger@python.org</reference></contact>
23 <author>Myself</author>
26 <organization>humankind</organization>
27 <date>Now, or yesterday. Or maybe even <emphasis>before</emphasis> yesterday.</date>
28 <status>This is a "work in progress"</status>
29 <revision>is managed by a version control system.</revision>
31 <copyright>This document has been placed in the public domain. You
32 may do with it as you wish. You may copy, modify,
33 redistribute, reattribute, sell, buy, rent, lease,
34 destroy, or improve it, quote it at length, excerpt,
35 incorporate, collate, fold, staple, or mutilate it, or do
36 anything else to it that your or anyone else's heart
38 <field classes="field-name">
39 <field_name>field name</field_name>
41 <paragraph>This is a "generic bibliographic field".</paragraph>
44 <field classes="field-name-2">
45 <field_name>field name "2"</field_name>
47 <paragraph>Generic bibliographic fields may contain multiple body elements.</paragraph>
48 <paragraph>Like this.</paragraph>
52 <topic classes="dedication">
53 <title>Dedication</title>
54 <paragraph>For Docutils users & co-developers.</paragraph>
56 <topic classes="abstract">
57 <title>Abstract</title>
58 <paragraph>This is a test document, containing at least one example of each
59 reStructuredText construct.</paragraph>
61 <comment xml:space="preserve">This is a comment. Note how any initial comments are moved by
62 transforms to after the document title, subtitle, and docinfo.</comment>
63 <target refid="doctitle"></target>
64 <comment xml:space="preserve">Above is the document title, and below is the subtitle.
65 They are transformed from section titles after parsing.</comment>
66 <target refid="subtitle"></target>
67 <comment xml:space="preserve">bibliographic fields (which also require a transform):</comment>
68 <raw format="latex" xml:space="preserve">\pagebreak[4] % start ToC on new page</raw>
69 <topic classes="contents" ids="table-of-contents" names="table\ of\ contents">
70 <title>Table of Contents</title>
71 <bullet_list classes="auto-toc">
73 <paragraph><reference ids="id34" refid="structural-elements"><generated classes="sectnum">1 </generated>Structural Elements</reference></paragraph>
74 <bullet_list classes="auto-toc">
76 <paragraph><reference ids="id35" refid="section-title"><generated classes="sectnum">1.1 </generated>Section Title</reference></paragraph>
79 <paragraph><reference ids="id36" refid="empty-section"><generated classes="sectnum">1.2 </generated>Empty Section</reference></paragraph>
82 <paragraph><reference ids="id37" refid="transitions"><generated classes="sectnum">1.3 </generated>Transitions</reference></paragraph>
87 <paragraph><reference ids="id38" refid="body-elements"><generated classes="sectnum">2 </generated>Body Elements</reference></paragraph>
88 <bullet_list classes="auto-toc">
90 <paragraph><reference ids="id39" refid="paragraphs"><generated classes="sectnum">2.1 </generated>Paragraphs</reference></paragraph>
91 <bullet_list classes="auto-toc">
93 <paragraph><reference ids="id40" refid="inline-markup"><generated classes="sectnum">2.1.1 </generated>Inline Markup</reference></paragraph>
98 <paragraph><reference ids="id41" refid="bullet-lists"><generated classes="sectnum">2.2 </generated>Bullet Lists</reference></paragraph>
101 <paragraph><reference ids="id42" refid="enumerated-lists"><generated classes="sectnum">2.3 </generated>Enumerated Lists</reference></paragraph>
104 <paragraph><reference ids="id43" refid="definition-lists"><generated classes="sectnum">2.4 </generated>Definition Lists</reference></paragraph>
107 <paragraph><reference ids="id44" refid="field-lists"><generated classes="sectnum">2.5 </generated>Field Lists</reference></paragraph>
110 <paragraph><reference ids="id45" refid="option-lists"><generated classes="sectnum">2.6 </generated>Option Lists</reference></paragraph>
113 <paragraph><reference ids="id46" refid="literal-blocks"><generated classes="sectnum">2.7 </generated>Literal Blocks</reference></paragraph>
116 <paragraph><reference ids="id47" refid="line-blocks"><generated classes="sectnum">2.8 </generated>Line Blocks</reference></paragraph>
119 <paragraph><reference ids="id48" refid="block-quotes"><generated classes="sectnum">2.9 </generated>Block Quotes</reference></paragraph>
122 <paragraph><reference ids="id49" refid="doctest-blocks"><generated classes="sectnum">2.10 </generated>Doctest Blocks</reference></paragraph>
125 <paragraph><reference ids="id50" refid="footnotes"><generated classes="sectnum">2.11 </generated>Footnotes</reference></paragraph>
128 <paragraph><reference ids="id51" refid="citations"><generated classes="sectnum">2.12 </generated>Citations</reference></paragraph>
131 <paragraph><reference ids="id52" refid="targets"><generated classes="sectnum">2.13 </generated>Targets</reference></paragraph>
132 <bullet_list classes="auto-toc">
134 <paragraph><reference ids="id53" refid="duplicate-target-names"><generated classes="sectnum">2.13.1 </generated>Duplicate Target Names</reference></paragraph>
137 <paragraph><reference ids="id54" refid="id21"><generated classes="sectnum">2.13.2 </generated>Duplicate Target Names</reference></paragraph>
142 <paragraph><reference ids="id55" refid="directives"><generated classes="sectnum">2.14 </generated>Directives</reference></paragraph>
143 <bullet_list classes="auto-toc">
145 <paragraph><reference ids="id56" refid="document-parts"><generated classes="sectnum">2.14.1 </generated>Document Parts</reference></paragraph>
148 <paragraph><reference ids="id57" refid="images-and-figures"><generated classes="sectnum">2.14.2 </generated>Images and Figures</reference></paragraph>
151 <paragraph><reference ids="id58" refid="admonitions"><generated classes="sectnum">2.14.3 </generated>Admonitions</reference></paragraph>
154 <paragraph><reference ids="id59" refid="topics-sidebars-and-rubrics"><generated classes="sectnum">2.14.4 </generated>Topics, Sidebars, and Rubrics</reference></paragraph>
157 <paragraph><reference ids="id60" refid="target-footnotes"><generated classes="sectnum">2.14.5 </generated>Target Footnotes</reference></paragraph>
160 <paragraph><reference ids="id61" refid="replacement-text"><generated classes="sectnum">2.14.6 </generated>Replacement Text</reference></paragraph>
163 <paragraph><reference ids="id62" refid="compound-paragraph"><generated classes="sectnum">2.14.7 </generated>Compound Paragraph</reference></paragraph>
166 <paragraph><reference ids="id63" refid="parsed-literal-blocks"><generated classes="sectnum">2.14.8 </generated>Parsed Literal Blocks</reference></paragraph>
169 <paragraph><reference ids="id64" refid="code"><generated classes="sectnum">2.14.9 </generated>Code</reference></paragraph>
174 <paragraph><reference ids="id65" refid="substitution-definitions"><generated classes="sectnum">2.15 </generated>Substitution Definitions</reference></paragraph>
177 <paragraph><reference ids="id66" refid="comments"><generated classes="sectnum">2.16 </generated>Comments</reference></paragraph>
180 <paragraph><reference ids="id67" refid="raw-text"><generated classes="sectnum">2.17 </generated>Raw text</reference></paragraph>
183 <paragraph><reference ids="id68" refid="container"><generated classes="sectnum">2.18 </generated>Container</reference></paragraph>
186 <paragraph><reference ids="id69" refid="colspanning-tables"><generated classes="sectnum">2.19 </generated>Colspanning tables</reference></paragraph>
189 <paragraph><reference ids="id70" refid="rowspanning-tables"><generated classes="sectnum">2.20 </generated>Rowspanning tables</reference></paragraph>
192 <paragraph><reference ids="id71" refid="complex-tables"><generated classes="sectnum">2.21 </generated>Complex tables</reference></paragraph>
195 <paragraph><reference ids="id72" refid="list-tables"><generated classes="sectnum">2.22 </generated>List Tables</reference></paragraph>
200 <paragraph><reference ids="id73" refid="error-handling"><generated classes="sectnum">3 </generated>Error Handling</reference></paragraph>
204 <section ids="structural-elements" names="structural\ elements">
205 <title auto="1" refid="id34"><generated classes="sectnum">1 </generated>Structural Elements</title>
206 <section ids="section-title" names="section\ title">
207 <title auto="1" refid="id35"><generated classes="sectnum">1.1 </generated>Section Title</title>
208 <subtitle ids="section-subtitle" names="section\ subtitle">Section Subtitle</subtitle>
209 <paragraph>Lone subsections are converted to a section subtitle by a transform
210 activated with the <literal>--section-subtitles</literal> command line option or the
211 <literal>sectsubtitle-xform</literal> configuration value.</paragraph>
213 <section ids="empty-section" names="empty\ section">
214 <title auto="1" refid="id36"><generated classes="sectnum">1.2 </generated>Empty Section</title>
216 <section ids="transitions" names="transitions">
217 <title auto="1" refid="id37"><generated classes="sectnum">1.3 </generated>Transitions</title>
218 <paragraph>Here's a transition:</paragraph>
219 <transition></transition>
220 <paragraph>It divides the section. Transitions may also occur between sections:</paragraph>
223 <transition></transition>
224 <section ids="body-elements" names="body\ elements">
225 <title auto="1" refid="id38"><generated classes="sectnum">2 </generated>Body Elements</title>
226 <section ids="paragraphs" names="paragraphs">
227 <title auto="1" refid="id39"><generated classes="sectnum">2.1 </generated>Paragraphs</title>
228 <paragraph>A paragraph.</paragraph>
229 <section ids="inline-markup" names="inline\ markup">
230 <title auto="1" refid="id40"><generated classes="sectnum">2.1.1 </generated>Inline Markup</title>
231 <paragraph>Paragraphs contain text and may contain inline markup: <emphasis>emphasis</emphasis>,
232 <strong>strong emphasis</strong>, <literal>inline literals</literal>, standalone hyperlinks
233 (<reference refuri="http://www.python.org">http://www.python.org</reference>), external hyperlinks (<reference name="Python" refuri="http://www.python.org/">Python</reference> <footnote_reference auto="1" ids="id26" refid="id25">5</footnote_reference>), internal
234 cross-references (<reference name="example" refid="example">example</reference>), external hyperlinks with embedded URIs
235 (<reference name="Python web site" refuri="http://www.python.org">Python web site</reference>), <reference anonymous="1" name="anonymous hyperlink references" refuri="http://www.python.org/">anonymous hyperlink
236 references</reference> <footnote_reference auto="1" ids="id31" refid="id25">5</footnote_reference> (<reference anonymous="1" name="a second reference" refuri="http://docutils.sourceforge.net/">a second reference</reference> <footnote_reference auto="1" ids="id33" refid="id32">7</footnote_reference>), footnote references (manually
237 numbered <footnote_reference ids="id1" refid="id8">1</footnote_reference>, anonymous auto-numbered <footnote_reference auto="1" ids="id2" refid="id12">3</footnote_reference>, labeled auto-numbered
238 <footnote_reference auto="1" ids="id3" refid="label">2</footnote_reference>, or symbolic <footnote_reference auto="*" ids="id4" refid="id13">*</footnote_reference>), citation references (<citation_reference ids="id5" refid="cit2002">CIT2002</citation_reference>),
239 substitution references (<image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png"></image>), and <target ids="inline-hyperlink-targets" names="inline\ hyperlink\ targets">inline hyperlink targets</target>
240 (see <reference name="Targets" refid="targets">Targets</reference> below for a reference back to here). Character-level
241 inline markup is also possible (although exceedingly ugly!) in <emphasis>re</emphasis><literal>Structured</literal><emphasis>Text</emphasis>. Problems are indicated by <problematic ids="id24" refid="id23">|problematic|</problematic> text
242 (generated by processing errors; this one is intentional). Here is a
243 reference to the <reference name="doctitle" refid="doctitle">doctitle</reference> and the <reference name="subtitle" refid="subtitle">subtitle</reference>.</paragraph>
244 <target anonymous="1" ids="id6" refuri="http://www.python.org/"></target>
245 <target anonymous="1" ids="id7" refuri="http://docutils.sourceforge.net/"></target>
246 <paragraph>The default role for interpreted text is <title_reference>Title Reference</title_reference>. Here are
247 some explicit interpreted text roles: a PEP reference (<reference refuri="http://www.python.org/dev/peps/pep-0287">PEP 287</reference>); an
248 RFC reference (<reference refuri="http://tools.ietf.org/html/rfc2822.html">RFC 2822</reference>); an abbreviation (<abbreviation>abb.</abbreviation>), an acronym
249 (<acronym>reST</acronym>), code (<literal classes="code">print "hello world"</literal>); a <subscript>subscript</subscript>;
250 a <superscript>superscript</superscript> and explicit roles for <title_reference>Docutils</title_reference>'
251 <emphasis>standard</emphasis> <strong>inline</strong> <literal>markup</literal>.</paragraph>
252 <comment xml:space="preserve">DO NOT RE-WRAP THE FOLLOWING PARAGRAPH!</comment>
253 <paragraph>Let's test wrapping and whitespace significance in inline literals:
254 <literal>This is an example of --inline-literal --text, --including some--
255 strangely--hyphenated-words. Adjust-the-width-of-your-browser-window
256 to see how the text is wrapped. -- ---- -------- Now note the
257 spacing between the words of this sentence (words
258 should be grouped in pairs).</literal></paragraph>
259 <paragraph>If the <literal>--pep-references</literal> option was supplied, there should be a
260 live link to PEP 258 here.</paragraph>
263 <section ids="bullet-lists" names="bullet\ lists">
264 <title auto="1" refid="id41"><generated classes="sectnum">2.2 </generated>Bullet Lists</title>
265 <bullet_list bullet="-">
267 <paragraph>A bullet list</paragraph>
268 <bullet_list bullet="+">
270 <paragraph>Nested bullet list.</paragraph>
273 <paragraph>Nested item 2.</paragraph>
278 <paragraph>Item 2.</paragraph>
279 <paragraph>Paragraph 2 of item 2.</paragraph>
280 <bullet_list bullet="*">
282 <paragraph>Nested bullet list.</paragraph>
285 <paragraph>Nested item 2.</paragraph>
286 <bullet_list bullet="-">
288 <paragraph>Third level.</paragraph>
291 <paragraph>Item 2.</paragraph>
296 <paragraph>Nested item 3.</paragraph>
299 <paragraph>This nested list should be compacted by the HTML writer.</paragraph>
300 <target ids="target" names="target"></target>
301 <comment xml:space="preserve">Even if this item contains a target and a comment.</comment>
307 <section ids="enumerated-lists" names="enumerated\ lists">
308 <title auto="1" refid="id42"><generated classes="sectnum">2.3 </generated>Enumerated Lists</title>
309 <enumerated_list enumtype="arabic" prefix="" suffix=".">
311 <paragraph>Arabic numerals.</paragraph>
312 <enumerated_list enumtype="loweralpha" prefix="" suffix=")">
314 <paragraph>lower alpha)</paragraph>
315 <enumerated_list enumtype="lowerroman" prefix="(" suffix=")">
317 <paragraph>(lower roman)</paragraph>
318 <enumerated_list enumtype="upperalpha" prefix="" suffix=".">
320 <paragraph>upper alpha.</paragraph>
321 <enumerated_list enumtype="upperroman" prefix="" suffix=")">
323 <paragraph>upper roman)</paragraph>
334 <paragraph>Lists that don't start at 1:</paragraph>
335 <enumerated_list enumtype="arabic" prefix="" start="3" suffix=".">
337 <paragraph>Three</paragraph>
340 <paragraph>Four</paragraph>
343 <system_message level="1" line="8" source="functional/input/data/standard.txt" type="INFO">
344 <paragraph>Enumerated list start value not ordinal-1: "3" (ordinal 3)</paragraph>
346 <enumerated_list enumtype="upperalpha" prefix="" start="3" suffix=".">
348 <paragraph>C</paragraph>
351 <paragraph>D</paragraph>
354 <system_message level="1" line="8" source="functional/input/data/standard.txt" type="INFO">
355 <paragraph>Enumerated list start value not ordinal-1: "C" (ordinal 3)</paragraph>
357 <enumerated_list enumtype="lowerroman" prefix="" start="3" suffix=".">
359 <paragraph>iii</paragraph>
362 <paragraph>iv</paragraph>
365 <system_message level="1" line="8" source="functional/input/data/standard.txt" type="INFO">
366 <paragraph>Enumerated list start value not ordinal-1: "iii" (ordinal 3)</paragraph>
371 <section ids="definition-lists" names="definition\ lists">
372 <title auto="1" refid="id43"><generated classes="sectnum">2.4 </generated>Definition Lists</title>
374 <definition_list_item>
377 <paragraph>Definition</paragraph>
379 </definition_list_item>
380 <definition_list_item>
382 <classifier>classifier</classifier>
384 <paragraph>Definition paragraph 1.</paragraph>
385 <paragraph>Definition paragraph 2.</paragraph>
387 </definition_list_item>
388 <definition_list_item>
391 <paragraph>Definition</paragraph>
393 </definition_list_item>
394 <definition_list_item>
396 <classifier>classifier one</classifier>
397 <classifier>classifier two</classifier>
399 <paragraph>Definition</paragraph>
401 </definition_list_item>
404 <section ids="field-lists" names="field\ lists">
405 <title auto="1" refid="id44"><generated classes="sectnum">2.5 </generated>Field Lists</title>
408 <field_name>what</field_name>
410 <paragraph>Field lists map field names to field bodies, like database
411 records. They are often part of an extension syntax. They are
412 an unambiguous variant of RFC 2822 fields.</paragraph>
416 <field_name>how arg1 arg2</field_name>
418 <paragraph>The field marker is a colon, the field name, and a colon.</paragraph>
419 <paragraph>The field body may contain one or more body elements, indented
420 relative to the field marker.</paragraph>
424 <field_name>credits</field_name>
426 <paragraph classes="credits">This paragraph has the <title_reference>credits</title_reference> class set. (This is actually not
427 about credits but just for ensuring that the class attribute
428 doesn't get stripped away.)</paragraph>
433 <section ids="option-lists" names="option\ lists">
434 <title auto="1" refid="id45"><generated classes="sectnum">2.6 </generated>Option Lists</title>
435 <paragraph>For listing command-line options:</paragraph>
440 <option_string>-a</option_string>
444 <paragraph>command-line option "a"</paragraph>
450 <option_string>-b</option_string>
451 <option_argument delimiter=" ">file</option_argument>
455 <paragraph>options can have arguments
456 and long descriptions</paragraph>
462 <option_string>--long</option_string>
466 <paragraph>options can be long also</paragraph>
472 <option_string>--input</option_string>
473 <option_argument delimiter="=">file</option_argument>
477 <paragraph>long options can also have
478 arguments</paragraph>
484 <option_string>--very-long-option</option_string>
488 <paragraph>The description can also start on the next line.</paragraph>
489 <paragraph>The description may contain multiple body elements,
490 regardless of where it starts.</paragraph>
496 <option_string>-x</option_string>
499 <option_string>-y</option_string>
502 <option_string>-z</option_string>
506 <paragraph>Multiple options are an "option group".</paragraph>
512 <option_string>-v</option_string>
515 <option_string>--verbose</option_string>
519 <paragraph>Commonly-seen: short & long options.</paragraph>
525 <option_string>-1</option_string>
526 <option_argument delimiter=" ">file</option_argument>
529 <option_string>--one</option_string>
530 <option_argument delimiter="=">file</option_argument>
533 <option_string>--two</option_string>
534 <option_argument delimiter=" ">file</option_argument>
538 <paragraph>Multiple options with arguments.</paragraph>
544 <option_string>/V</option_string>
548 <paragraph>DOS/VMS-style options too</paragraph>
552 <paragraph>There must be at least two spaces between the option and the
553 description.</paragraph>
555 <section ids="literal-blocks" names="literal\ blocks">
556 <title auto="1" refid="id46"><generated classes="sectnum">2.7 </generated>Literal Blocks</title>
557 <paragraph>Literal blocks are indicated with a double-colon ("::") at the end of
558 the preceding paragraph (over there <literal>--></literal>). They can be indented:</paragraph>
559 <literal_block xml:space="preserve">if literal_block:
560 text = 'is left as-is'
561 spaces_and_linebreaks = 'are preserved'
562 markup_processing = None</literal_block>
563 <paragraph>Or they can be quoted without indentation:</paragraph>
564 <literal_block xml:space="preserve">>> Great idea!
566 > Why didn't I think of that?</literal_block>
568 <section ids="line-blocks" names="line\ blocks">
569 <title auto="1" refid="id47"><generated classes="sectnum">2.8 </generated>Line Blocks</title>
570 <paragraph>This section tests line blocks. Line blocks are body elements which
571 consist of lines and other line blocks. Nested line blocks cause
572 indentation.</paragraph>
574 <line>This is a line block. It ends with a blank line.</line>
576 <line>New lines begin with a vertical bar ("|").</line>
577 <line>Line breaks and initial indent are significant, and preserved.</line>
579 <line>Continuation lines are also possible. A long line that is intended
580 to wrap should begin with a space in place of the vertical bar.</line>
582 <line>The left edge of a continuation line need not be aligned with
583 the left edge of the text above it.</line>
587 <line>This is a second line block.</line>
589 <line>Blank lines are permitted internally, but they must begin with a "|".</line>
591 <paragraph>Another line block, surrounded by paragraphs:</paragraph>
593 <line>And it's no good waiting by the window</line>
594 <line>It's no good waiting for the sun</line>
595 <line>Please believe me, the things you dream of</line>
596 <line>They don't fall in the lap of no-one</line>
598 <paragraph>Take it away, Eric the Orchestra Leader!</paragraph>
601 <line>A one, two, a one two three four</line>
603 <line>Half a bee, philosophically,</line>
605 <line>must, <emphasis>ipso facto</emphasis>, half not be.</line>
607 <line>But half the bee has got to be,</line>
609 <line><emphasis>vis a vis</emphasis> its entity. D'you see?</line>
612 <line>But can a bee be said to be</line>
614 <line>or not to be an entire bee,</line>
616 <line>when half the bee is not a bee,</line>
618 <line>due to some ancient injury?</line>
623 <line>Singing...</line>
626 <paragraph>A line block, like the following poem by Christian Morgenstern, can
627 also be centre-aligned:</paragraph>
628 <line_block classes="language-de align-center">
629 <line><strong>Die Trichter</strong></line>
631 <line>Zwei Trichter wandeln durch die Nacht.</line>
632 <line>Durch ihres Rumpfs verengten Schacht</line>
633 <line>fließt weißes Mondlicht</line>
634 <line>still und heiter</line>
635 <line>auf ihren</line>
642 <section ids="block-quotes" names="block\ quotes">
643 <title auto="1" refid="id48"><generated classes="sectnum">2.9 </generated>Block Quotes</title>
644 <paragraph>Block quotes consist of indented body elements:</paragraph>
646 <paragraph>My theory by A. Elk. Brackets Miss, brackets. This theory goes
647 as follows and begins now. All brontosauruses are thin at one
648 end, much much thicker in the middle and then thin again at the
649 far end. That is my theory, it is mine, and belongs to me and I
650 own it, and what it is too.</paragraph>
651 <attribution>Anne Elk (Miss)</attribution>
653 <paragraph>The language of a quote (like any other object) can be specified by
654 a class attribute:</paragraph>
655 <comment xml:space="preserve"></comment>
656 <block_quote classes="language-fr">
657 <paragraph>ReStructuredText est un langage de balisage léger utilisé
658 notamment dans la documentation du langage Python.</paragraph>
661 <section ids="doctest-blocks" names="doctest\ blocks">
662 <title auto="1" refid="id49"><generated classes="sectnum">2.10 </generated>Doctest Blocks</title>
663 <doctest_block xml:space="preserve">>>> print 'Python-specific usage examples; begun with ">>>"'
664 Python-specific usage examples; begun with ">>>"
665 >>> print '(cut and pasted from interactive Python sessions)'
666 (cut and pasted from interactive Python sessions)</doctest_block>
668 <section ids="footnotes" names="footnotes">
669 <title auto="1" refid="id50"><generated classes="sectnum">2.11 </generated>Footnotes</title>
670 <footnote backrefs="id1 id9 id22" ids="id8" names="1">
672 <paragraph>A footnote contains body elements, consistently indented by at
673 least 3 spaces.</paragraph>
674 <paragraph>This is the footnote's second paragraph.</paragraph>
676 <footnote auto="1" backrefs="id3 id10" ids="label" names="label">
678 <paragraph>Footnotes may be numbered, either manually (as in <footnote_reference ids="id9" refid="id8">1</footnote_reference>) or
679 automatically using a "#"-prefixed label. This footnote has a
680 label so it can be referred to from multiple places, both as a
681 footnote reference (<footnote_reference auto="1" ids="id10" refid="label">2</footnote_reference>) and as a <reference anonymous="1" name="hyperlink reference" refid="label">hyperlink reference</reference>.</paragraph>
682 <target anonymous="1" ids="id11" refid="label"></target>
684 <footnote auto="1" backrefs="id2" ids="id12" names="3">
686 <paragraph>This footnote is numbered automatically and anonymously using a
687 label of "#" only.</paragraph>
688 <paragraph>This is the second paragraph.</paragraph>
689 <paragraph>And this is the third paragraph.</paragraph>
691 <footnote auto="*" backrefs="id4" ids="id13">
693 <paragraph>Footnotes may also use symbols, specified with a "*" label.
694 Here's a reference to the next footnote: <footnote_reference auto="*" ids="id14" refid="id15">†</footnote_reference>.</paragraph>
696 <footnote auto="*" backrefs="id14" ids="id15">
698 <paragraph>This footnote shows the next symbol in the sequence.</paragraph>
700 <footnote ids="id16" names="4">
702 <paragraph>Here's an unreferenced footnote, with a reference to a
703 nonexistent footnote: <problematic ids="id84 id17" refid="id83">[5]_</problematic>.</paragraph>
706 <section ids="citations" names="citations">
707 <title auto="1" refid="id51"><generated classes="sectnum">2.12 </generated>Citations</title>
708 <citation backrefs="id5 id18" ids="cit2002" names="cit2002">
709 <label>CIT2002</label>
710 <paragraph>Citations are text-labeled footnotes. They may be
711 rendered separately and differently from footnotes.</paragraph>
713 <paragraph>Here's a reference to the above, <citation_reference ids="id18" refid="cit2002">CIT2002</citation_reference>, and a <problematic ids="id86 id19" refid="id85">[nonexistent]_</problematic>
714 citation.</paragraph>
715 <target refid="another-target"></target>
717 <section ids="targets another-target" names="targets another\ target">
718 <title auto="1" refid="id52"><generated classes="sectnum">2.13 </generated>Targets</title>
719 <target refid="example"></target>
720 <paragraph ids="example" names="example">This paragraph is pointed to by the explicit "example" target. A
721 reference can be found under <reference name="Inline Markup" refid="inline-markup">Inline Markup</reference>, above. <reference name="Inline hyperlink targets" refid="inline-hyperlink-targets">Inline
722 hyperlink targets</reference> are also possible.</paragraph>
723 <paragraph>Section headers are implicit targets, referred to by name. See
724 <reference name="Targets" refid="targets">Targets</reference>, which is a subsection of <reference name="Body Elements" refid="body-elements">Body Elements</reference>.</paragraph>
725 <paragraph>Explicit external targets are interpolated into references such as
726 "<reference name="Python" refuri="http://www.python.org/">Python</reference> <footnote_reference auto="1" ids="id27" refid="id25">5</footnote_reference>".</paragraph>
727 <target ids="python" names="python" refuri="http://www.python.org/"></target>
728 <paragraph>Targets may be indirect and anonymous. Thus <reference anonymous="1" name="this phrase" refid="targets">this phrase</reference> may also
729 refer to the <reference name="Targets" refid="targets">Targets</reference> section.</paragraph>
730 <target anonymous="1" ids="id20" refid="targets"></target>
731 <paragraph>Here's a <problematic ids="id88" refid="id87">`hyperlink reference without a target`_</problematic>, which generates an
733 <section dupnames="duplicate\ target\ names" ids="duplicate-target-names">
734 <title auto="1" refid="id53"><generated classes="sectnum">2.13.1 </generated>Duplicate Target Names</title>
735 <paragraph>Duplicate names in section headers or other implicit targets will
736 generate "info" (level-1) system messages. Duplicate names in
737 explicit targets will generate "warning" (level-2) system messages.</paragraph>
739 <section dupnames="duplicate\ target\ names" ids="id21">
740 <title auto="1" refid="id54"><generated classes="sectnum">2.13.2 </generated>Duplicate Target Names</title>
741 <system_message backrefs="id21" level="1" line="438" source="functional/input/data/standard.txt" type="INFO">
742 <paragraph>Duplicate implicit target name: "duplicate target names".</paragraph>
744 <paragraph>Since there are two "Duplicate Target Names" section headers, we
745 cannot uniquely refer to either of them by name. If we try to (like
746 this: <problematic ids="id90" refid="id89">`Duplicate Target Names`_</problematic>), an error is generated.</paragraph>
749 <section ids="directives" names="directives">
750 <title auto="1" refid="id55"><generated classes="sectnum">2.14 </generated>Directives</title>
751 <topic classes="contents local" ids="contents" names="contents">
752 <bullet_list classes="auto-toc">
754 <paragraph><reference ids="id74" refid="document-parts"><generated classes="sectnum">2.14.1 </generated>Document Parts</reference></paragraph>
757 <paragraph><reference ids="id75" refid="images-and-figures"><generated classes="sectnum">2.14.2 </generated>Images and Figures</reference></paragraph>
760 <paragraph><reference ids="id76" refid="admonitions"><generated classes="sectnum">2.14.3 </generated>Admonitions</reference></paragraph>
763 <paragraph><reference ids="id77" refid="topics-sidebars-and-rubrics"><generated classes="sectnum">2.14.4 </generated>Topics, Sidebars, and Rubrics</reference></paragraph>
766 <paragraph><reference ids="id78" refid="target-footnotes"><generated classes="sectnum">2.14.5 </generated>Target Footnotes</reference></paragraph>
769 <paragraph><reference ids="id79" refid="replacement-text"><generated classes="sectnum">2.14.6 </generated>Replacement Text</reference></paragraph>
772 <paragraph><reference ids="id80" refid="compound-paragraph"><generated classes="sectnum">2.14.7 </generated>Compound Paragraph</reference></paragraph>
775 <paragraph><reference ids="id81" refid="parsed-literal-blocks"><generated classes="sectnum">2.14.8 </generated>Parsed Literal Blocks</reference></paragraph>
778 <paragraph><reference ids="id82" refid="code"><generated classes="sectnum">2.14.9 </generated>Code</reference></paragraph>
782 <paragraph>These are just a sample of the many reStructuredText Directives. For
784 <reference refuri="http://docutils.sourceforge.net/docs/ref/rst/directives.html">http://docutils.sourceforge.net/docs/ref/rst/directives.html</reference>.</paragraph>
785 <section ids="document-parts" names="document\ parts">
786 <title auto="1" refid="id74"><generated classes="sectnum">2.14.1 </generated>Document Parts</title>
787 <paragraph>An example of the "contents" directive can be seen above this section
788 (a local, untitled table of <reference name="contents" refid="contents">contents</reference>) and at the beginning of the
789 document (a document-wide <reference name="table of contents" refid="table-of-contents">table of contents</reference>).</paragraph>
791 <section ids="images-and-figures" names="images\ and\ figures">
792 <title auto="1" refid="id75"><generated classes="sectnum">2.14.2 </generated>Images and Figures</title>
793 <paragraph>An image directive (also clickable -- a hyperlink reference):</paragraph>
794 <reference name="directives" refid="directives"><image classes="class1 class2" uri="../../../docs/user/rst/images/title.png"></image></reference>
795 <paragraph>Image with multiple IDs:</paragraph>
796 <target refid="image-target-1"></target>
797 <target refid="image-target-2"></target>
798 <target refid="image-target-3"></target>
799 <image ids="image-target-3 image-target-2 image-target-1" names="image\ target\ 3 image\ target\ 2 image\ target\ 1" uri="../../../docs/user/rst/images/title.png"></image>
800 <paragraph>A centered image:</paragraph>
801 <image align="center" uri="../../../docs/user/rst/images/biohazard.png"></image>
802 <paragraph>A left-aligned image:</paragraph>
803 <image align="left" uri="../../../docs/user/rst/images/biohazard.png"></image>
804 <paragraph>This paragraph might flow around the image.
805 The specific behavior depends upon the style sheet and
806 the browser or rendering software used.</paragraph>
807 <paragraph>A right-aligned image:</paragraph>
808 <image align="right" uri="../../../docs/user/rst/images/biohazard.png"></image>
809 <paragraph>This paragraph might flow around the image.
810 The specific behavior depends upon the style sheet and
811 the browser or rendering software used.</paragraph>
812 <paragraph>For inline images see <reference name="Substitution Definitions" refid="substitution-definitions">Substitution Definitions</reference>.</paragraph>
813 <paragraph>Image size:</paragraph>
814 <paragraph>An image 2 em wide:</paragraph>
815 <image uri="../../../docs/user/rst/images/biohazard.png" width="2em"></image>
816 <paragraph>An image 2 em wide and 15 pixel high:</paragraph>
817 <image height="15px" uri="../../../docs/user/rst/images/biohazard.png" width="2em"></image>
818 <paragraph>An image occupying 50% of the line width:</paragraph>
819 <image uri="../../../docs/user/rst/images/title.png" width="50%"></image>
820 <paragraph>An image 2 cm high:</paragraph>
821 <image height="2cm" uri="../../../docs/user/rst/images/biohazard.png"></image>
822 <paragraph>A <emphasis>figure</emphasis> is an image with a caption and/or a legend. With page-based output
823 media, figures might float to a different position if this helps the page
825 <figure classes="figclass1 figclass2">
826 <image alt="reStructuredText, the markup syntax" classes="class1 class2" uri="../../../docs/user/rst/images/title.png" width="258"></image>
827 <caption>Plaintext markup syntax and parser system.</caption>
831 <colspec colwidth="12"></colspec>
832 <colspec colwidth="47"></colspec>
836 <paragraph>re</paragraph>
839 <paragraph>Revised, revisited, based on 're' module.</paragraph>
844 <paragraph>Structured</paragraph>
847 <paragraph>Structure-enhanced text, structuredtext.</paragraph>
852 <paragraph>Text</paragraph>
855 <paragraph>Well it is, isn't it?</paragraph>
861 <paragraph>This paragraph is also part of the legend.</paragraph>
864 <paragraph>A left-aligned figure:</paragraph>
865 <figure align="left" classes="figclass1 figclass2" width="70%">
866 <image alt="reStructuredText, the markup syntax" classes="class1 class2" uri="../../../docs/user/rst/images/biohazard.png" width="40px"></image>
867 <caption>This is the caption.</caption>
869 <paragraph>This is the legend.</paragraph>
870 <paragraph>The legend may consist of several paragraphs.</paragraph>
873 <paragraph>This paragraph might flow around the figure.</paragraph>
874 <paragraph>The specific behavior depends upon the style sheet and the browser or
875 rendering software used.</paragraph>
876 <paragraph>A centered figure:</paragraph>
877 <figure align="center">
878 <image uri="../../../docs/user/rst/images/biohazard.png" width="40px"></image>
879 <caption>This is the caption.</caption>
881 <paragraph>This is the legend.</paragraph>
882 <paragraph>The legend may consist of several paragraphs.</paragraph>
885 <paragraph>This paragraph might flow around the figure.</paragraph>
886 <paragraph>The specific behavior depends upon the style sheet and the browser or
887 rendering software used.</paragraph>
888 <paragraph>A right-aligned figure:</paragraph>
889 <figure align="right">
890 <image uri="../../../docs/user/rst/images/biohazard.png" width="40px"></image>
891 <caption>This is the caption.</caption>
893 <paragraph>This is the legend.</paragraph>
894 <paragraph>The legend may consist of several paragraphs.</paragraph>
897 <paragraph>This paragraph might flow around the figure. The specific behavior depends
898 upon the style sheet and the browser or rendering software used.</paragraph>
899 <paragraph>Tables may be given titles and additional arguments with the <emphasis>table</emphasis>
900 directive:</paragraph>
902 <title>left-aligned table</title>
904 <colspec colwidth="5"></colspec>
905 <colspec colwidth="5"></colspec>
909 <paragraph>A</paragraph>
912 <paragraph>not A</paragraph>
919 <paragraph>False</paragraph>
922 <paragraph>True</paragraph>
927 <paragraph>True</paragraph>
930 <paragraph>False</paragraph>
936 <table align="center">
937 <title>center-aligned table</title>
939 <colspec colwidth="5"></colspec>
940 <colspec colwidth="5"></colspec>
944 <paragraph>A</paragraph>
947 <paragraph>not A</paragraph>
954 <paragraph>False</paragraph>
957 <paragraph>True</paragraph>
962 <paragraph>True</paragraph>
965 <paragraph>False</paragraph>
971 <table align="right">
972 <title>right-aligned table</title>
974 <colspec colwidth="5"></colspec>
975 <colspec colwidth="5"></colspec>
979 <paragraph>A</paragraph>
982 <paragraph>not A</paragraph>
989 <paragraph>False</paragraph>
992 <paragraph>True</paragraph>
997 <paragraph>True</paragraph>
1000 <paragraph>False</paragraph>
1006 <paragraph>With the "widths" argument "auto" (or "class" value "colwidths-auto"),
1007 column widths are determined by the backend (if supported by the
1008 writer/backend).</paragraph>
1009 <target refid="target1"></target>
1010 <target refid="target2"></target>
1011 <table classes="colwidths-auto" ids="target2 target1" names="target2 target1">
1013 <colspec colwidth="7"></colspec>
1014 <colspec colwidth="7"></colspec>
1015 <colspec colwidth="10"></colspec>
1019 <paragraph>A</paragraph>
1022 <paragraph>B</paragraph>
1025 <paragraph>A or B</paragraph>
1032 <paragraph>False</paragraph>
1035 <paragraph>False</paragraph>
1038 <paragraph>False</paragraph>
1043 <paragraph>True</paragraph>
1046 <paragraph>False</paragraph>
1049 <paragraph>True</paragraph>
1054 <paragraph>False</paragraph>
1057 <paragraph>True</paragraph>
1060 <paragraph>True</paragraph>
1065 <paragraph>True</paragraph>
1068 <paragraph>True</paragraph>
1071 <paragraph>True</paragraph>
1078 <section ids="admonitions" names="admonitions">
1079 <title auto="1" refid="id76"><generated classes="sectnum">2.14.3 </generated>Admonitions</title>
1081 <paragraph>Directives at large.</paragraph>
1084 <paragraph>Don't take any wooden nickels.</paragraph>
1087 <paragraph>Mad scientist at work!</paragraph>
1090 <paragraph>Does not compute.</paragraph>
1093 <paragraph>It's bigger than a bread box.</paragraph>
1096 <bullet_list bullet="-">
1098 <paragraph>Wash behind your ears.</paragraph>
1101 <paragraph>Clean up your room.</paragraph>
1104 <paragraph>Call your mother.</paragraph>
1107 <paragraph>Back up your data.</paragraph>
1112 <paragraph>This is a note.</paragraph>
1115 <paragraph>15% if the service is good.</paragraph>
1118 <paragraph>Strong prose may provoke extreme mental exertion.
1119 Reader discretion is strongly advised.</paragraph>
1121 <admonition classes="admonition-and-by-the-way">
1122 <title>And, by the way...</title>
1123 <paragraph>You can make up your own admonition too.</paragraph>
1124 <target ids="docutils" names="docutils" refuri="http://docutils.sourceforge.net/"></target>
1127 <section ids="topics-sidebars-and-rubrics" names="topics,\ sidebars,\ and\ rubrics">
1128 <title auto="1" refid="id77"><generated classes="sectnum">2.14.4 </generated>Topics, Sidebars, and Rubrics</title>
1129 <paragraph><emphasis>Sidebars</emphasis> are like miniature, parallel documents.</paragraph>
1131 <title>Sidebar Title</title>
1132 <subtitle>Optional Subtitle</subtitle>
1133 <paragraph>This is a sidebar. It is for text outside the flow of the main
1135 <rubric>This is a rubric inside a sidebar</rubric>
1136 <paragraph>Sidebars often appear beside the main text with a border and a different
1137 background or font color.</paragraph>
1139 <paragraph>A <emphasis>topic</emphasis> is like a block quote with a title, or a self-contained section
1140 with no subsections.</paragraph>
1142 <title>Topic Title</title>
1143 <paragraph>This is a topic.</paragraph>
1145 <paragraph>A <emphasis>rubric</emphasis> is like an informal heading that doesn't correspond to the
1146 document's structure. It is typically highlighted in red (hence the name).</paragraph>
1147 <rubric>This is a rubric</rubric>
1148 <paragraph>Topics and rubrics can be used at places where a <reference name="section title" refid="section-title">section title</reference> is not
1149 allowed (e.g. inside a directive).</paragraph>
1151 <section ids="target-footnotes" names="target\ footnotes">
1152 <title auto="1" refid="id78"><generated classes="sectnum">2.14.5 </generated>Target Footnotes</title>
1153 <footnote auto="1" backrefs="id26 id27 id28 id31" ids="id25" names="TARGET_NOTE:\ id25">
1155 <paragraph><reference refuri="http://www.python.org/">http://www.python.org/</reference></paragraph>
1157 <footnote auto="1" backrefs="id30" ids="id29" names="TARGET_NOTE:\ id29">
1159 <paragraph><reference refuri="http://pygments.org/">http://pygments.org/</reference></paragraph>
1161 <footnote auto="1" backrefs="id33" ids="id32" names="TARGET_NOTE:\ id32">
1163 <paragraph><reference refuri="http://docutils.sourceforge.net/">http://docutils.sourceforge.net/</reference></paragraph>
1166 <section ids="replacement-text" names="replacement\ text">
1167 <title auto="1" refid="id79"><generated classes="sectnum">2.14.6 </generated>Replacement Text</title>
1168 <paragraph>I recommend you try <reference refuri="http://www.python.org/">Python, <emphasis>the</emphasis> best language around</reference> <footnote_reference auto="1" ids="id28" refid="id25">5</footnote_reference>.</paragraph>
1169 <substitution_definition names="Python">Python, <emphasis>the</emphasis> best language around</substitution_definition>
1171 <section ids="compound-paragraph" names="compound\ paragraph">
1172 <title auto="1" refid="id80"><generated classes="sectnum">2.14.7 </generated>Compound Paragraph</title>
1173 <compound classes="some-class">
1174 <paragraph>Compound 1, paragraph 1.</paragraph>
1175 <paragraph>Compound 1, paragraph 2.</paragraph>
1176 <bullet_list bullet="*">
1178 <paragraph>Compound 1, list item one.</paragraph>
1181 <paragraph>Compound 1, list item two.</paragraph>
1185 <paragraph>Another compound statement:</paragraph>
1187 <paragraph>Compound 2, a literal block:</paragraph>
1188 <literal_block xml:space="preserve">Compound 2, literal.</literal_block>
1189 <paragraph>Compound 2, this is a test.</paragraph>
1192 <paragraph>Compound 3, only consisting of one paragraph.</paragraph>
1195 <literal_block xml:space="preserve">Compound 4.
1196 This one starts with a literal block.</literal_block>
1197 <paragraph>Compound 4, a paragraph.</paragraph>
1199 <paragraph>Now something <emphasis>really</emphasis> perverted -- a nested compound block. This is
1200 just to test that it works at all; the results don't have to be
1201 meaningful.</paragraph>
1203 <paragraph>Compound 5, block 1 (a paragraph).</paragraph>
1205 <paragraph>Compound 6, block 2 in compound 5.</paragraph>
1206 <paragraph>Compound 6, another paragraph.</paragraph>
1208 <paragraph>Compound 5, block 3 (a paragraph).</paragraph>
1211 <paragraph>Compound 7, with a table inside:</paragraph>
1214 <colspec colwidth="20"></colspec>
1215 <colspec colwidth="20"></colspec>
1216 <colspec colwidth="20"></colspec>
1220 <paragraph>Left cell, first
1221 paragraph.</paragraph>
1222 <paragraph>Left cell, second
1223 paragraph.</paragraph>
1226 <paragraph>Middle cell,
1229 paragraph.</paragraph>
1232 <paragraph>Right cell.</paragraph>
1233 <paragraph>Paragraph 2.</paragraph>
1234 <paragraph>Paragraph 3.</paragraph>
1240 <paragraph>Compound 7, a paragraph after the table.</paragraph>
1241 <paragraph>Compound 7, another paragraph.</paragraph>
1244 <section ids="parsed-literal-blocks" names="parsed\ literal\ blocks">
1245 <title auto="1" refid="id81"><generated classes="sectnum">2.14.8 </generated>Parsed Literal Blocks</title>
1246 <literal_block xml:space="preserve">This is a parsed literal block.
1247 This line is indented. The next line is blank.
1249 Inline markup is supported, e.g. <emphasis>emphasis</emphasis>, <strong>strong</strong>, <literal>literal
1250 text</literal>, <subscript>sub-</subscript> and <superscript>super</superscript>scripts,
1251 inline formulas: <math>A = 2 \pi r^2</math>,
1252 footnotes <footnote_reference ids="id22" refid="id8">1</footnote_reference>, <target ids="hyperlink-targets" names="hyperlink\ targets">hyperlink targets</target>, and <reference name="references" refuri="http://www.python.org/">references</reference><target ids="references" names="references" refuri="http://www.python.org/"></target>.</literal_block>
1254 <section ids="code" names="code">
1255 <title auto="1" refid="id82"><generated classes="sectnum">2.14.9 </generated>Code</title>
1256 <paragraph>Blocks of source code can be set with the <title_reference>code</title_reference> directive. If the code
1257 language is specified, the content is parsed and tagged by the <reference name="Pygments" refuri="http://pygments.org/">Pygments</reference> <footnote_reference auto="1" ids="id30" refid="id29">6</footnote_reference>
1258 syntax highlighter and can be formatted with a style sheet. (Code parsing
1259 is turned off using the <literal>syntax-highlight</literal> config setting in the test
1260 conversions in order to get identical results with/without installed
1261 Pygments highlighter.)</paragraph>
1262 <literal_block classes="code python" xml:space="preserve">print 'This is Python code.'</literal_block>
1263 <paragraph>The <literal>:number-lines:</literal> option (with optional start value) generates line
1264 numbers:</paragraph>
1265 <literal_block classes="code python" xml:space="preserve"><inline classes="ln"> 8 </inline># print integers from 0 to 9:
1266 <inline classes="ln"> 9 </inline>for i in range(10):
1267 <inline classes="ln">10 </inline> print i</literal_block>
1268 <paragraph>For inline code snippets, there is the <title_reference>code</title_reference> role, which can be used
1269 directly (the code will not be parsed/tagged, as the language is not known)
1270 or as base for special code roles, e.g. the LaTeX code in the next
1271 paragraph.</paragraph>
1272 <paragraph>Docutils uses LaTeX syntax for math directives and roles:
1273 <literal classes="code tex">\alpha = f(x)</literal> prints <math>\alpha = f(x)</math>.</paragraph>
1274 <paragraph>The <literal>:code:</literal> option of the <title_reference>include</title_reference> directive sets the included content
1275 as a code block, here the rst file <literal>header_footer.txt</literal> with line numbers:</paragraph>
1276 <literal_block classes="code rst" source="functional/input/data/header_footer.txt" xml:space="preserve"><inline classes="ln">1 </inline>.. header:: Document header
1277 <inline classes="ln">2 </inline>.. footer:: Document footer</literal_block>
1278 <target ids="pygments" names="pygments" refuri="http://pygments.org/"></target>
1281 <section ids="substitution-definitions" names="substitution\ definitions">
1282 <title auto="1" refid="id65"><generated classes="sectnum">2.15 </generated>Substitution Definitions</title>
1283 <paragraph>An inline image (<image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png"></image>) example:</paragraph>
1284 <substitution_definition names="EXAMPLE"><image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png"></image></substitution_definition>
1285 <paragraph>(Substitution definitions are not visible in the HTML source.)</paragraph>
1287 <section ids="comments" names="comments">
1288 <title auto="1" refid="id66"><generated classes="sectnum">2.16 </generated>Comments</title>
1289 <paragraph>Here's one:</paragraph>
1290 <comment xml:space="preserve">Comments begin with two dots and a space. Anything may
1291 follow, except for the syntax of footnotes, hyperlink
1292 targets, directives, or substitution definitions.
1294 Double-dashes -- "--" -- must be escaped somehow in HTML output.
1296 Comments may contain non-ASCII characters: ä ö ü æ ø å</comment>
1297 <paragraph>(View the HTML source to see the comment.)</paragraph>
1299 <section ids="raw-text" names="raw\ text">
1300 <title auto="1" refid="id67"><generated classes="sectnum">2.17 </generated>Raw text</title>
1301 <paragraph>This does not necessarily look nice, because there may be missing white space.</paragraph>
1302 <paragraph>It's just there to freeze the behavior.</paragraph>
1303 <raw format="html latex" xml:space="preserve">A test.</raw>
1304 <raw format="html latex" xml:space="preserve">Second test.</raw>
1305 <raw classes="myclass" format="html latex" xml:space="preserve">Another test with myclass set.</raw>
1306 <paragraph>This is the <raw classes="myrawroleclass" format="html latex" xml:space="preserve">fourth test</raw> with myrawroleclass set.</paragraph>
1307 <raw format="html" xml:space="preserve">Fifth test in HTML.<br />Line two.</raw>
1308 <raw format="latex" xml:space="preserve">Fifth test in LaTeX.\\Line two.</raw>
1310 <section ids="container" names="container">
1311 <title auto="1" refid="id68"><generated classes="sectnum">2.18 </generated>Container</title>
1312 <container classes="custom">
1313 <paragraph>paragraph 1</paragraph>
1314 <paragraph>paragraph 2</paragraph>
1317 <section ids="colspanning-tables" names="colspanning\ tables">
1318 <title auto="1" refid="id69"><generated classes="sectnum">2.19 </generated>Colspanning tables</title>
1319 <paragraph>This table has a cell spanning two columns:</paragraph>
1322 <colspec colwidth="5"></colspec>
1323 <colspec colwidth="5"></colspec>
1324 <colspec colwidth="6"></colspec>
1327 <entry morecols="1">
1328 <paragraph>Inputs</paragraph>
1331 <paragraph>Output</paragraph>
1336 <paragraph>A</paragraph>
1339 <paragraph>B</paragraph>
1342 <paragraph>A or B</paragraph>
1349 <paragraph>False</paragraph>
1352 <paragraph>False</paragraph>
1355 <paragraph>False</paragraph>
1360 <paragraph>True</paragraph>
1363 <paragraph>False</paragraph>
1366 <paragraph>True</paragraph>
1371 <paragraph>False</paragraph>
1374 <paragraph>True</paragraph>
1377 <paragraph>True</paragraph>
1382 <paragraph>True</paragraph>
1385 <paragraph>True</paragraph>
1388 <paragraph>True</paragraph>
1395 <section ids="rowspanning-tables" names="rowspanning\ tables">
1396 <title auto="1" refid="id70"><generated classes="sectnum">2.20 </generated>Rowspanning tables</title>
1397 <paragraph>Here's a table with cells spanning several rows:</paragraph>
1400 <colspec colwidth="24"></colspec>
1401 <colspec colwidth="12"></colspec>
1402 <colspec colwidth="18"></colspec>
1406 <paragraph>Header row, column 1
1407 (header rows optional)</paragraph>
1410 <paragraph>Header 2</paragraph>
1413 <paragraph>Header 3</paragraph>
1420 <paragraph>body row 1, column 1</paragraph>
1423 <paragraph>column 2</paragraph>
1426 <paragraph>column 3</paragraph>
1431 <paragraph>body row 2</paragraph>
1433 <entry morerows="1">
1434 <paragraph>Cells may
1435 span rows.</paragraph>
1437 <entry morerows="1">
1445 <paragraph>body row 3</paragraph>
1452 <section ids="complex-tables" names="complex\ tables">
1453 <title auto="1" refid="id71"><generated classes="sectnum">2.21 </generated>Complex tables</title>
1454 <paragraph>Here's a complex table, which should test all features.</paragraph>
1457 <colspec colwidth="24"></colspec>
1458 <colspec colwidth="12"></colspec>
1459 <colspec colwidth="10"></colspec>
1460 <colspec colwidth="10"></colspec>
1464 <paragraph>Header row, column 1
1465 (header rows optional)</paragraph>
1468 <paragraph>Header 2</paragraph>
1471 <paragraph>Header 3</paragraph>
1474 <paragraph>Header 4</paragraph>
1481 <paragraph>body row 1, column 1</paragraph>
1484 <paragraph>column 2</paragraph>
1487 <paragraph>column 3</paragraph>
1490 <paragraph>column 4</paragraph>
1495 <paragraph>body row 2</paragraph>
1497 <entry morecols="2">
1498 <paragraph>Cells may span columns.</paragraph>
1503 <paragraph>body row 3</paragraph>
1505 <entry morerows="1">
1506 <paragraph>Cells may
1507 span rows.</paragraph>
1508 <paragraph>Paragraph.</paragraph>
1510 <entry morecols="1" morerows="1">
1511 <bullet_list bullet="-">
1513 <paragraph>Table cells</paragraph>
1516 <paragraph>contain</paragraph>
1519 <paragraph>body elements.</paragraph>
1526 <paragraph>body row 4</paragraph>
1531 <paragraph>body row 5</paragraph>
1533 <entry morecols="1">
1534 <paragraph>Cells may also be
1535 empty: <literal>--></literal></paragraph>
1544 <section ids="list-tables" names="list\ tables">
1545 <title auto="1" refid="id72"><generated classes="sectnum">2.22 </generated>List Tables</title>
1546 <paragraph>Here's a list table exercising all features:</paragraph>
1547 <table classes="colwidths-given test">
1548 <title>list table with integral header</title>
1550 <colspec colwidth="10" stub="1"></colspec>
1551 <colspec colwidth="20"></colspec>
1552 <colspec colwidth="30"></colspec>
1556 <paragraph>Treat</paragraph>
1559 <paragraph>Quantity</paragraph>
1562 <paragraph>Description</paragraph>
1569 <paragraph>Albatross</paragraph>
1572 <paragraph>2.99</paragraph>
1575 <paragraph>On a stick!</paragraph>
1580 <paragraph>Crunchy Frog</paragraph>
1583 <paragraph>1.49</paragraph>
1586 <paragraph>If we took the bones out, it wouldn't be
1587 crunchy, now would it?</paragraph>
1592 <paragraph>Gannet Ripple</paragraph>
1595 <paragraph>1.99</paragraph>
1598 <paragraph>On a stick!</paragraph>
1604 <table align="center">
1605 <title>center aligned list table</title>
1607 <colspec colwidth="50"></colspec>
1608 <colspec colwidth="50"></colspec>
1612 <paragraph>Albatross</paragraph>
1615 <paragraph>2.99</paragraph>
1620 <paragraph>Crunchy Frog</paragraph>
1623 <paragraph>1.49</paragraph>
1628 <paragraph>Gannet Ripple</paragraph>
1631 <paragraph>1.99</paragraph>
1639 <section ids="error-handling" names="error\ handling">
1640 <title auto="1" refid="id73"><generated classes="sectnum">3 </generated>Error Handling</title>
1641 <paragraph>Any errors caught during processing will generate system messages.</paragraph>
1642 <paragraph>There should be five messages in the following, auto-generated
1643 section, "Docutils System Messages":</paragraph>
1644 <comment xml:space="preserve">section should be added by Docutils automatically</comment>
1646 <section classes="system-messages">
1647 <title>Docutils System Messages</title>
1648 <system_message backrefs="id24" ids="id23" level="3" line="104" source="functional/input/data/standard.txt" type="ERROR">
1649 <paragraph>Undefined substitution referenced: "problematic".</paragraph>
1651 <system_message backrefs="id84" ids="id83" level="3" line="391" source="functional/input/data/standard.txt" type="ERROR">
1652 <paragraph>Unknown target name: "5".</paragraph>
1654 <system_message backrefs="id86" ids="id85" level="3" line="400" source="functional/input/data/standard.txt" type="ERROR">
1655 <paragraph>Unknown target name: "nonexistent".</paragraph>
1657 <system_message backrefs="id88" ids="id87" level="3" line="427" source="functional/input/data/standard.txt" type="ERROR">
1658 <paragraph>Unknown target name: "hyperlink reference without a target".</paragraph>
1660 <system_message backrefs="id90" ids="id89" level="3" line="440" source="functional/input/data/standard.txt" type="ERROR">
1661 <paragraph>Duplicate target name, cannot be used as a unique reference: "duplicate target names".</paragraph>
1663 <system_message level="1" line="163" source="functional/input/data/standard.txt" type="INFO">
1664 <paragraph>Hyperlink target "target" is not referenced.</paragraph>
1666 <system_message level="1" line="405" source="functional/input/data/standard.txt" type="INFO">
1667 <paragraph>Hyperlink target "another-target" is not referenced.</paragraph>
1669 <system_message level="1" line="473" source="functional/input/data/standard.txt" type="INFO">
1670 <paragraph>Hyperlink target "image-target-1" is not referenced.</paragraph>
1672 <system_message level="1" line="474" source="functional/input/data/standard.txt" type="INFO">
1673 <paragraph>Hyperlink target "image-target-2" is not referenced.</paragraph>
1675 <system_message level="1" line="475" source="functional/input/data/standard.txt" type="INFO">
1676 <paragraph>Hyperlink target "image-target-3" is not referenced.</paragraph>
1678 <system_message level="1" line="682" source="functional/input/data/standard.txt" type="INFO">
1679 <paragraph>Hyperlink target "docutils" is not referenced.</paragraph>
1681 <system_message level="1" line="803" source="functional/input/data/standard.txt" type="INFO">
1682 <paragraph>Hyperlink target "hyperlink targets" is not referenced.</paragraph>