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.17b2.dev -->
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="toc-entry-1" refid="structural-elements"><generated classes="sectnum">1 </generated>Structural Elements</reference></paragraph>
74 <bullet_list classes="auto-toc">
76 <paragraph><reference ids="toc-entry-2" refid="section-title"><generated classes="sectnum">1.1 </generated>Section Title</reference></paragraph>
79 <paragraph><reference ids="toc-entry-3" refid="empty-section"><generated classes="sectnum">1.2 </generated>Empty Section</reference></paragraph>
82 <paragraph><reference ids="toc-entry-4" refid="transitions"><generated classes="sectnum">1.3 </generated>Transitions</reference></paragraph>
87 <paragraph><reference ids="toc-entry-5" refid="body-elements"><generated classes="sectnum">2 </generated>Body Elements</reference></paragraph>
88 <bullet_list classes="auto-toc">
90 <paragraph><reference ids="toc-entry-6" refid="paragraphs"><generated classes="sectnum">2.1 </generated>Paragraphs</reference></paragraph>
91 <bullet_list classes="auto-toc">
93 <paragraph><reference ids="toc-entry-7" refid="inline-markup"><generated classes="sectnum">2.1.1 </generated>Inline Markup</reference></paragraph>
98 <paragraph><reference ids="toc-entry-8" refid="bullet-lists"><generated classes="sectnum">2.2 </generated>Bullet Lists</reference></paragraph>
101 <paragraph><reference ids="toc-entry-9" refid="enumerated-lists"><generated classes="sectnum">2.3 </generated>Enumerated Lists</reference></paragraph>
104 <paragraph><reference ids="toc-entry-10" refid="definition-lists"><generated classes="sectnum">2.4 </generated>Definition Lists</reference></paragraph>
107 <paragraph><reference ids="toc-entry-11" refid="field-lists"><generated classes="sectnum">2.5 </generated>Field Lists</reference></paragraph>
110 <paragraph><reference ids="toc-entry-12" refid="option-lists"><generated classes="sectnum">2.6 </generated>Option Lists</reference></paragraph>
113 <paragraph><reference ids="toc-entry-13" refid="literal-blocks"><generated classes="sectnum">2.7 </generated>Literal Blocks</reference></paragraph>
116 <paragraph><reference ids="toc-entry-14" refid="line-blocks"><generated classes="sectnum">2.8 </generated>Line Blocks</reference></paragraph>
119 <paragraph><reference ids="toc-entry-15" refid="block-quotes"><generated classes="sectnum">2.9 </generated>Block Quotes</reference></paragraph>
122 <paragraph><reference ids="toc-entry-16" refid="doctest-blocks"><generated classes="sectnum">2.10 </generated>Doctest Blocks</reference></paragraph>
125 <paragraph><reference ids="toc-entry-17" refid="footnotes"><generated classes="sectnum">2.11 </generated>Footnotes</reference></paragraph>
128 <paragraph><reference ids="toc-entry-18" refid="citations"><generated classes="sectnum">2.12 </generated>Citations</reference></paragraph>
131 <paragraph><reference ids="toc-entry-19" refid="targets"><generated classes="sectnum">2.13 </generated>Targets</reference></paragraph>
132 <bullet_list classes="auto-toc">
134 <paragraph><reference ids="toc-entry-20" refid="duplicate-target-names"><generated classes="sectnum">2.13.1 </generated>Duplicate Target Names</reference></paragraph>
137 <paragraph><reference ids="toc-entry-21" refid="duplicate-target-names-1"><generated classes="sectnum">2.13.2 </generated>Duplicate Target Names</reference></paragraph>
142 <paragraph><reference ids="toc-entry-22" refid="directives"><generated classes="sectnum">2.14 </generated>Directives</reference></paragraph>
143 <bullet_list classes="auto-toc">
145 <paragraph><reference ids="toc-entry-23" refid="document-parts"><generated classes="sectnum">2.14.1 </generated>Document Parts</reference></paragraph>
148 <paragraph><reference ids="toc-entry-24" refid="images-and-figures"><generated classes="sectnum">2.14.2 </generated>Images and Figures</reference></paragraph>
151 <paragraph><reference ids="toc-entry-25" refid="tables"><generated classes="sectnum">2.14.3 </generated>Tables</reference></paragraph>
154 <paragraph><reference ids="toc-entry-26" refid="admonitions"><generated classes="sectnum">2.14.4 </generated>Admonitions</reference></paragraph>
157 <paragraph><reference ids="toc-entry-27" refid="topics-sidebars-and-rubrics"><generated classes="sectnum">2.14.5 </generated>Topics, Sidebars, and Rubrics</reference></paragraph>
160 <paragraph><reference ids="toc-entry-28" refid="target-footnotes"><generated classes="sectnum">2.14.6 </generated>Target Footnotes</reference></paragraph>
163 <paragraph><reference ids="toc-entry-29" refid="replacement-text"><generated classes="sectnum">2.14.7 </generated>Replacement Text</reference></paragraph>
166 <paragraph><reference ids="toc-entry-30" refid="compound-paragraph"><generated classes="sectnum">2.14.8 </generated>Compound Paragraph</reference></paragraph>
169 <paragraph><reference ids="toc-entry-31" refid="parsed-literal-blocks"><generated classes="sectnum">2.14.9 </generated>Parsed Literal Blocks</reference></paragraph>
172 <paragraph><reference ids="toc-entry-32" refid="code"><generated classes="sectnum">2.14.10 </generated>Code</reference></paragraph>
177 <paragraph><reference ids="toc-entry-33" refid="substitution-definitions"><generated classes="sectnum">2.15 </generated>Substitution Definitions</reference></paragraph>
180 <paragraph><reference ids="toc-entry-34" refid="comments"><generated classes="sectnum">2.16 </generated>Comments</reference></paragraph>
183 <paragraph><reference ids="toc-entry-35" refid="raw-text"><generated classes="sectnum">2.17 </generated>Raw text</reference></paragraph>
186 <paragraph><reference ids="toc-entry-36" refid="container"><generated classes="sectnum">2.18 </generated>Container</reference></paragraph>
189 <paragraph><reference ids="toc-entry-37" refid="colspanning-tables"><generated classes="sectnum">2.19 </generated>Colspanning tables</reference></paragraph>
192 <paragraph><reference ids="toc-entry-38" refid="rowspanning-tables"><generated classes="sectnum">2.20 </generated>Rowspanning tables</reference></paragraph>
195 <paragraph><reference ids="toc-entry-39" refid="complex-tables"><generated classes="sectnum">2.21 </generated>Complex tables</reference></paragraph>
198 <paragraph><reference ids="toc-entry-40" refid="list-tables"><generated classes="sectnum">2.22 </generated>List Tables</reference></paragraph>
203 <paragraph><reference ids="toc-entry-41" refid="error-handling"><generated classes="sectnum">3 </generated>Error Handling</reference></paragraph>
207 <section ids="structural-elements" names="structural\ elements">
208 <title auto="1" refid="toc-entry-1"><generated classes="sectnum">1 </generated>Structural Elements</title>
209 <section ids="section-title" names="section\ title">
210 <title auto="1" refid="toc-entry-2"><generated classes="sectnum">1.1 </generated>Section Title</title>
211 <subtitle ids="section-subtitle" names="section\ subtitle">Section Subtitle</subtitle>
212 <paragraph>Lone subsections are converted to a section subtitle by a transform
213 activated with the <literal>--section-subtitles</literal> command line option or the
214 <literal>sectsubtitle-xform</literal> configuration value.</paragraph>
216 <section ids="empty-section" names="empty\ section">
217 <title auto="1" refid="toc-entry-3"><generated classes="sectnum">1.2 </generated>Empty Section</title>
219 <section ids="transitions" names="transitions">
220 <title auto="1" refid="toc-entry-4"><generated classes="sectnum">1.3 </generated>Transitions</title>
221 <paragraph>Here's a transition:</paragraph>
222 <transition></transition>
223 <paragraph>It divides the section. Transitions may also occur between sections:</paragraph>
226 <transition></transition>
227 <section ids="body-elements" names="body\ elements">
228 <title auto="1" refid="toc-entry-5"><generated classes="sectnum">2 </generated>Body Elements</title>
229 <section ids="paragraphs" names="paragraphs">
230 <title auto="1" refid="toc-entry-6"><generated classes="sectnum">2.1 </generated>Paragraphs</title>
231 <paragraph>A paragraph.</paragraph>
232 <section ids="inline-markup" names="inline\ markup">
233 <title auto="1" refid="toc-entry-7"><generated classes="sectnum">2.1.1 </generated>Inline Markup</title>
234 <paragraph>Paragraphs contain text and may contain inline markup: <emphasis>emphasis</emphasis>,
235 <strong>strong emphasis</strong>, <literal>inline literals</literal>, standalone hyperlinks
236 (<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="footnote-reference-10" refid="footnote-6">5</footnote_reference>), internal
237 cross-references (<reference name="example" refid="example">example</reference>), external hyperlinks with embedded URIs
238 (<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
239 references</reference> <footnote_reference auto="1" ids="footnote-reference-14" refid="footnote-6">5</footnote_reference> (<reference anonymous="1" name="a second reference" refuri="http://docutils.sourceforge.net/">a second reference</reference> <footnote_reference auto="1" ids="footnote-reference-15" refid="footnote-8">7</footnote_reference>), footnote references (manually
240 numbered <footnote_reference ids="footnote-reference-1" refid="footnote-1">1</footnote_reference>, anonymous auto-numbered <footnote_reference auto="1" ids="footnote-reference-2" refid="footnote-2">3</footnote_reference>, labeled auto-numbered
241 <footnote_reference auto="1" ids="footnote-reference-3" refid="label">2</footnote_reference>, or symbolic <footnote_reference auto="*" ids="footnote-reference-4" refid="footnote-3">*</footnote_reference>), citation references (<citation_reference ids="citation-reference-1" refid="cit2002">CIT2002</citation_reference>),
242 substitution references (<image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png"></image> &
243 a <emphasis>trimmed heart</emphasis> <literal>(U+2665):</literal>♥), and <target ids="inline-hyperlink-targets" names="inline\ hyperlink\ targets">inline hyperlink targets</target>
244 (see <reference name="Targets" refid="targets">Targets</reference> below for a reference back to here). Character-level
245 inline markup is also possible (although exceedingly ugly!) in <emphasis>re</emphasis><literal>Structured</literal><emphasis>Text</emphasis>. Problems are indicated by <problematic ids="problematic-1" refid="system-message-1">|problematic|</problematic> text
246 (generated by processing errors; this one is intentional). Here is a
247 reference to the <reference name="doctitle" refid="doctitle">doctitle</reference> and the <reference name="subtitle" refid="subtitle">subtitle</reference>.</paragraph>
248 <target anonymous="1" ids="target-1" refuri="http://www.python.org/"></target>
249 <target anonymous="1" ids="target-2" refuri="http://docutils.sourceforge.net/"></target>
250 <paragraph>The default role for interpreted text is <title_reference>Title Reference</title_reference>. Here are
251 some explicit interpreted text roles: a PEP reference (<reference refuri="http://www.python.org/dev/peps/pep-0287">PEP 287</reference>); an
252 RFC reference (<reference refuri="http://tools.ietf.org/html/rfc2822.html">RFC 2822</reference>); an abbreviation (<abbreviation>abb.</abbreviation>), an acronym
253 (<acronym>reST</acronym>), code (<literal classes="code">print "hello world"</literal>); a <subscript>subscript</subscript>;
254 a <superscript>superscript</superscript> and explicit roles for <title_reference>Docutils</title_reference>'
255 <emphasis>standard</emphasis> <strong>inline</strong> <literal>markup</literal>.</paragraph>
256 <comment xml:space="preserve">DO NOT RE-WRAP THE FOLLOWING PARAGRAPH!</comment>
257 <paragraph>Let's test wrapping and whitespace significance in inline literals:
258 <literal>This is an example of --inline-literal --text, --including some--
259 strangely--hyphenated-words. Adjust-the-width-of-your-browser-window
260 to see how the text is wrapped. -- ---- -------- Now note the
261 spacing between the words of this sentence (words
262 should be grouped in pairs).</literal></paragraph>
263 <paragraph>If the <literal>--pep-references</literal> option was supplied, there should be a
264 live link to PEP 258 here.</paragraph>
267 <section ids="bullet-lists" names="bullet\ lists">
268 <title auto="1" refid="toc-entry-8"><generated classes="sectnum">2.2 </generated>Bullet Lists</title>
269 <bullet_list bullet="-">
271 <paragraph>A bullet list</paragraph>
272 <bullet_list bullet="+">
274 <paragraph>Nested bullet list.</paragraph>
277 <paragraph>Nested item 2.</paragraph>
282 <paragraph>Item 2.</paragraph>
283 <paragraph>Paragraph 2 of item 2.</paragraph>
284 <bullet_list bullet="*">
286 <paragraph>Nested bullet list.</paragraph>
289 <paragraph>Nested item 2.</paragraph>
290 <bullet_list bullet="-">
292 <paragraph>Third level.</paragraph>
295 <paragraph>Item 2.</paragraph>
300 <paragraph>Nested item 3.</paragraph>
303 <paragraph>This nested list should be compacted by the HTML writer.</paragraph>
304 <target ids="target" names="target"></target>
305 <comment xml:space="preserve">Even if this item contains a target and a comment.</comment>
311 <section ids="enumerated-lists" names="enumerated\ lists">
312 <title auto="1" refid="toc-entry-9"><generated classes="sectnum">2.3 </generated>Enumerated Lists</title>
313 <enumerated_list enumtype="arabic" prefix="" suffix=".">
315 <paragraph>Arabic numerals.</paragraph>
316 <enumerated_list enumtype="loweralpha" prefix="" suffix=")">
318 <paragraph>lower alpha)</paragraph>
319 <enumerated_list enumtype="lowerroman" prefix="(" suffix=")">
321 <paragraph>(lower roman)</paragraph>
322 <enumerated_list enumtype="upperalpha" prefix="" suffix=".">
324 <paragraph>upper alpha.</paragraph>
325 <enumerated_list enumtype="upperroman" prefix="" suffix=")">
327 <paragraph>upper roman)</paragraph>
338 <paragraph>Lists that don't start at 1:</paragraph>
339 <enumerated_list enumtype="arabic" prefix="" start="3" suffix=".">
341 <paragraph>Three</paragraph>
344 <paragraph>Four</paragraph>
347 <system_message level="1" line="8" source="functional/input/data/standard.txt" type="INFO">
348 <paragraph>Enumerated list start value not ordinal-1: "3" (ordinal 3)</paragraph>
350 <enumerated_list enumtype="upperalpha" prefix="" start="3" suffix=".">
352 <paragraph>C</paragraph>
355 <paragraph>D</paragraph>
358 <system_message level="1" line="8" source="functional/input/data/standard.txt" type="INFO">
359 <paragraph>Enumerated list start value not ordinal-1: "C" (ordinal 3)</paragraph>
361 <enumerated_list enumtype="lowerroman" prefix="" start="3" suffix=".">
363 <paragraph>iii</paragraph>
366 <paragraph>iv</paragraph>
369 <system_message level="1" line="8" source="functional/input/data/standard.txt" type="INFO">
370 <paragraph>Enumerated list start value not ordinal-1: "iii" (ordinal 3)</paragraph>
375 <section ids="definition-lists" names="definition\ lists">
376 <title auto="1" refid="toc-entry-10"><generated classes="sectnum">2.4 </generated>Definition Lists</title>
378 <definition_list_item>
381 <paragraph>Definition</paragraph>
383 </definition_list_item>
384 <definition_list_item>
386 <classifier>classifier</classifier>
388 <paragraph>Definition paragraph 1.</paragraph>
389 <paragraph>Definition paragraph 2.</paragraph>
391 </definition_list_item>
392 <definition_list_item>
395 <paragraph>Definition</paragraph>
397 </definition_list_item>
398 <definition_list_item>
400 <classifier>classifier one</classifier>
401 <classifier>classifier two</classifier>
403 <paragraph>Definition</paragraph>
405 </definition_list_item>
408 <section ids="field-lists" names="field\ lists">
409 <title auto="1" refid="toc-entry-11"><generated classes="sectnum">2.5 </generated>Field Lists</title>
412 <field_name>what</field_name>
414 <paragraph>Field lists map field names to field bodies, like database
415 records. They are often part of an extension syntax. They are
416 an unambiguous variant of RFC 2822 fields.</paragraph>
420 <field_name>how arg1 arg2</field_name>
422 <paragraph>The field marker is a colon, the field name, and a colon.</paragraph>
423 <paragraph>The field body may contain one or more body elements, indented
424 relative to the field marker.</paragraph>
428 <field_name>credits</field_name>
430 <paragraph classes="credits">This paragraph has the <title_reference>credits</title_reference> class set. (This is actually not
431 about credits but just for ensuring that the class attribute
432 doesn't get stripped away.)</paragraph>
437 <section ids="option-lists" names="option\ lists">
438 <title auto="1" refid="toc-entry-12"><generated classes="sectnum">2.6 </generated>Option Lists</title>
439 <paragraph>For listing command-line options:</paragraph>
444 <option_string>-a</option_string>
448 <paragraph>command-line option "a"</paragraph>
454 <option_string>-b</option_string>
455 <option_argument delimiter=" ">file</option_argument>
459 <paragraph>options can have arguments
460 and long descriptions</paragraph>
466 <option_string>--long</option_string>
470 <paragraph>options can be long also</paragraph>
476 <option_string>--input</option_string>
477 <option_argument delimiter="=">file</option_argument>
481 <paragraph>long options can also have
482 arguments</paragraph>
488 <option_string>--very-long-option</option_string>
492 <paragraph>The description can also start on the next line.</paragraph>
493 <paragraph>The description may contain multiple body elements,
494 regardless of where it starts.</paragraph>
500 <option_string>-x</option_string>
503 <option_string>-y</option_string>
506 <option_string>-z</option_string>
510 <paragraph>Multiple options are an "option group".</paragraph>
516 <option_string>-v</option_string>
519 <option_string>--verbose</option_string>
523 <paragraph>Commonly-seen: short & long options.</paragraph>
529 <option_string>-1</option_string>
530 <option_argument delimiter=" ">file</option_argument>
533 <option_string>--one</option_string>
534 <option_argument delimiter="=">file</option_argument>
537 <option_string>--two</option_string>
538 <option_argument delimiter=" ">file</option_argument>
542 <paragraph>Multiple options with arguments.</paragraph>
548 <option_string>/V</option_string>
552 <paragraph>DOS/VMS-style options too</paragraph>
556 <paragraph>There must be at least two spaces between the option and the
557 description.</paragraph>
559 <section ids="literal-blocks" names="literal\ blocks">
560 <title auto="1" refid="toc-entry-13"><generated classes="sectnum">2.7 </generated>Literal Blocks</title>
561 <paragraph>Literal blocks are indicated with a double-colon ("::") at the end of
562 the preceding paragraph (over there <literal>--></literal>). They can be indented:</paragraph>
563 <literal_block xml:space="preserve">if literal_block:
564 text = 'is left as-is'
565 spaces_and_linebreaks = 'are preserved'
566 markup_processing = None</literal_block>
567 <paragraph>Or they can be quoted without indentation:</paragraph>
568 <literal_block xml:space="preserve">>> Great idea!
570 > Why didn't I think of that?</literal_block>
572 <section ids="line-blocks" names="line\ blocks">
573 <title auto="1" refid="toc-entry-14"><generated classes="sectnum">2.8 </generated>Line Blocks</title>
574 <paragraph>This section tests line blocks. Line blocks are body elements which
575 consist of lines and other line blocks. Nested line blocks cause
576 indentation.</paragraph>
578 <line>This is a line block. It ends with a blank line.</line>
580 <line>New lines begin with a vertical bar ("|").</line>
581 <line>Line breaks and initial indent are significant, and preserved.</line>
583 <line>Continuation lines are also possible. A long line that is intended
584 to wrap should begin with a space in place of the vertical bar.</line>
586 <line>The left edge of a continuation line need not be aligned with
587 the left edge of the text above it.</line>
591 <line>This is a second line block.</line>
593 <line>Blank lines are permitted internally, but they must begin with a "|".</line>
595 <paragraph>Another line block, surrounded by paragraphs:</paragraph>
597 <line>And it's no good waiting by the window</line>
598 <line>It's no good waiting for the sun</line>
599 <line>Please believe me, the things you dream of</line>
600 <line>They don't fall in the lap of no-one</line>
602 <paragraph>Take it away, Eric the Orchestra Leader!</paragraph>
605 <line>A one, two, a one two three four</line>
607 <line>Half a bee, philosophically,</line>
609 <line>must, <emphasis>ipso facto</emphasis>, half not be.</line>
611 <line>But half the bee has got to be,</line>
613 <line><emphasis>vis a vis</emphasis> its entity. D'you see?</line>
616 <line>But can a bee be said to be</line>
618 <line>or not to be an entire bee,</line>
620 <line>when half the bee is not a bee,</line>
622 <line>due to some ancient injury?</line>
627 <line>Singing...</line>
630 <paragraph>A line block, like the following poem by Christian Morgenstern, can
631 also be centre-aligned:</paragraph>
632 <line_block classes="language-de align-center">
633 <line><strong>Die Trichter</strong></line>
635 <line>Zwei Trichter wandeln durch die Nacht.</line>
636 <line>Durch ihres Rumpfs verengten Schacht</line>
637 <line>fließt weißes Mondlicht</line>
638 <line>still und heiter</line>
639 <line>auf ihren</line>
646 <section ids="block-quotes" names="block\ quotes">
647 <title auto="1" refid="toc-entry-15"><generated classes="sectnum">2.9 </generated>Block Quotes</title>
648 <paragraph>Block quotes consist of indented body elements:</paragraph>
650 <paragraph>My theory by A. Elk. Brackets Miss, brackets. This theory goes
651 as follows and begins now. All brontosauruses are thin at one
652 end, much much thicker in the middle and then thin again at the
653 far end. That is my theory, it is mine, and belongs to me and I
654 own it, and what it is too.</paragraph>
655 <attribution>Anne Elk (Miss)</attribution>
657 <paragraph>The language of a quote (like any other object) can be specified by
658 a class attribute:</paragraph>
659 <comment xml:space="preserve"></comment>
660 <block_quote classes="language-fr">
661 <paragraph>ReStructuredText est un langage de balisage léger utilisé
662 notamment dans la documentation du langage Python.</paragraph>
665 <section ids="doctest-blocks" names="doctest\ blocks">
666 <title auto="1" refid="toc-entry-16"><generated classes="sectnum">2.10 </generated>Doctest Blocks</title>
667 <doctest_block xml:space="preserve">>>> print 'Python-specific usage examples; begun with ">>>"'
668 Python-specific usage examples; begun with ">>>"
669 >>> print '(cut and pasted from interactive Python sessions)'
670 (cut and pasted from interactive Python sessions)</doctest_block>
672 <section ids="footnotes" names="footnotes">
673 <title auto="1" refid="toc-entry-17"><generated classes="sectnum">2.11 </generated>Footnotes</title>
674 <footnote backrefs="footnote-reference-1 footnote-reference-5 footnote-reference-9" ids="footnote-1" names="1">
676 <paragraph>A footnote contains body elements, consistently indented by at
677 least 3 spaces.</paragraph>
678 <paragraph>This is the footnote's second paragraph.</paragraph>
680 <footnote auto="1" backrefs="footnote-reference-3 footnote-reference-6" ids="label" names="label">
682 <paragraph>Footnotes may be numbered, either manually (as in <footnote_reference ids="footnote-reference-5" refid="footnote-1">1</footnote_reference>) or
683 automatically using a "#"-prefixed label. This footnote has a
684 label so it can be referred to from multiple places, both as a
685 footnote reference (<footnote_reference auto="1" ids="footnote-reference-6" refid="label">2</footnote_reference>) and as a <reference anonymous="1" name="hyperlink reference" refid="label">hyperlink reference</reference>.</paragraph>
686 <target anonymous="1" ids="target-3" refid="label"></target>
688 <footnote auto="1" backrefs="footnote-reference-2" ids="footnote-2" names="3">
690 <paragraph>This footnote is numbered automatically and anonymously using a
691 label of "#" only.</paragraph>
692 <paragraph>This is the second paragraph.</paragraph>
693 <paragraph>And this is the third paragraph.</paragraph>
695 <footnote auto="*" backrefs="footnote-reference-4" ids="footnote-3">
697 <paragraph>Footnotes may also use symbols, specified with a "*" label.
698 Here's a reference to the next footnote: <footnote_reference auto="*" ids="footnote-reference-7" refid="footnote-4">†</footnote_reference>.</paragraph>
700 <footnote auto="*" backrefs="footnote-reference-7" ids="footnote-4">
702 <paragraph>This footnote shows the next symbol in the sequence.</paragraph>
704 <footnote ids="footnote-5" names="4">
706 <paragraph>Here's an unreferenced footnote, with a reference to a
707 nonexistent footnote: <problematic ids="footnote-reference-8" refid="system-message-2">[5]_</problematic>.</paragraph>
710 <section ids="citations" names="citations">
711 <title auto="1" refid="toc-entry-18"><generated classes="sectnum">2.12 </generated>Citations</title>
712 <citation backrefs="citation-reference-1 citation-reference-2" ids="cit2002" names="cit2002">
713 <label>CIT2002</label>
714 <paragraph>Citations are text-labeled footnotes. They may be
715 rendered separately and differently from footnotes.</paragraph>
717 <paragraph>Here's a reference to the above, <citation_reference ids="citation-reference-2" refid="cit2002">CIT2002</citation_reference>, and a <problematic ids="citation-reference-3" refid="system-message-3">[nonexistent]_</problematic>
718 citation.</paragraph>
719 <target refid="another-target"></target>
721 <section ids="targets another-target" names="targets another\ target">
722 <title auto="1" refid="toc-entry-19"><generated classes="sectnum">2.13 </generated>Targets</title>
723 <target refid="example"></target>
724 <paragraph ids="example" names="example">This paragraph is pointed to by the explicit "example" target. A
725 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
726 hyperlink targets</reference> are also possible.</paragraph>
727 <paragraph>Section headers are implicit targets, referred to by name. See
728 <reference name="Targets" refid="targets">Targets</reference>, which is a subsection of <reference name="Body Elements" refid="body-elements">Body Elements</reference>.</paragraph>
729 <paragraph>Explicit external targets are interpolated into references such as
730 "<reference name="Python" refuri="http://www.python.org/">Python</reference> <footnote_reference auto="1" ids="footnote-reference-11" refid="footnote-6">5</footnote_reference>".</paragraph>
731 <target ids="python" names="python" refuri="http://www.python.org/"></target>
732 <paragraph>Targets may be indirect and anonymous. Thus <reference anonymous="1" name="this phrase" refid="targets">this phrase</reference> may also
733 refer to the <reference name="Targets" refid="targets">Targets</reference> section.</paragraph>
734 <target anonymous="1" ids="target-4" refid="targets"></target>
735 <paragraph>Here's a <problematic ids="problematic-2" refid="system-message-4">`hyperlink reference without a target`_</problematic>, which generates an
737 <section dupnames="duplicate\ target\ names" ids="duplicate-target-names">
738 <title auto="1" refid="toc-entry-20"><generated classes="sectnum">2.13.1 </generated>Duplicate Target Names</title>
739 <paragraph>Duplicate names in section headers or other implicit targets will
740 generate "info" (level-1) system messages. Duplicate names in
741 explicit targets will generate "warning" (level-2) system messages.</paragraph>
743 <section dupnames="duplicate\ target\ names" ids="duplicate-target-names-1">
744 <title auto="1" refid="toc-entry-21"><generated classes="sectnum">2.13.2 </generated>Duplicate Target Names</title>
745 <system_message backrefs="duplicate-target-names-1" level="1" line="439" source="functional/input/data/standard.txt" type="INFO">
746 <paragraph>Duplicate implicit target name: "duplicate target names".</paragraph>
748 <paragraph>Since there are two "Duplicate Target Names" section headers, we
749 cannot uniquely refer to either of them by name. If we try to (like
750 this: <problematic ids="problematic-3" refid="system-message-5">`Duplicate Target Names`_</problematic>), an error is generated.</paragraph>
753 <section ids="directives" names="directives">
754 <title auto="1" refid="toc-entry-22"><generated classes="sectnum">2.14 </generated>Directives</title>
755 <topic classes="contents local" ids="contents" names="contents">
756 <bullet_list classes="auto-toc">
758 <paragraph><reference ids="toc-entry-42" refid="document-parts"><generated classes="sectnum">2.14.1 </generated>Document Parts</reference></paragraph>
761 <paragraph><reference ids="toc-entry-43" refid="images-and-figures"><generated classes="sectnum">2.14.2 </generated>Images and Figures</reference></paragraph>
764 <paragraph><reference ids="toc-entry-44" refid="tables"><generated classes="sectnum">2.14.3 </generated>Tables</reference></paragraph>
767 <paragraph><reference ids="toc-entry-45" refid="admonitions"><generated classes="sectnum">2.14.4 </generated>Admonitions</reference></paragraph>
770 <paragraph><reference ids="toc-entry-46" refid="topics-sidebars-and-rubrics"><generated classes="sectnum">2.14.5 </generated>Topics, Sidebars, and Rubrics</reference></paragraph>
773 <paragraph><reference ids="toc-entry-47" refid="target-footnotes"><generated classes="sectnum">2.14.6 </generated>Target Footnotes</reference></paragraph>
776 <paragraph><reference ids="toc-entry-48" refid="replacement-text"><generated classes="sectnum">2.14.7 </generated>Replacement Text</reference></paragraph>
779 <paragraph><reference ids="toc-entry-49" refid="compound-paragraph"><generated classes="sectnum">2.14.8 </generated>Compound Paragraph</reference></paragraph>
782 <paragraph><reference ids="toc-entry-50" refid="parsed-literal-blocks"><generated classes="sectnum">2.14.9 </generated>Parsed Literal Blocks</reference></paragraph>
785 <paragraph><reference ids="toc-entry-51" refid="code"><generated classes="sectnum">2.14.10 </generated>Code</reference></paragraph>
789 <paragraph>These are just a sample of the many reStructuredText Directives. For
791 <reference refuri="http://docutils.sourceforge.net/docs/ref/rst/directives.html">http://docutils.sourceforge.net/docs/ref/rst/directives.html</reference>.</paragraph>
792 <section ids="document-parts" names="document\ parts">
793 <title auto="1" refid="toc-entry-42"><generated classes="sectnum">2.14.1 </generated>Document Parts</title>
794 <paragraph>An example of the "contents" directive can be seen above this section
795 (a local, untitled table of <reference name="contents" refid="contents">contents</reference>) and at the beginning of the
796 document (a document-wide <reference name="table of contents" refid="table-of-contents">table of contents</reference>).</paragraph>
798 <section ids="images-and-figures" names="images\ and\ figures">
799 <title auto="1" refid="toc-entry-43"><generated classes="sectnum">2.14.2 </generated>Images and Figures</title>
800 <paragraph>An image directive (also clickable -- a hyperlink reference):</paragraph>
801 <reference name="directives" refid="directives"><image classes="class1 class2" uri="../../../docs/user/rst/images/title.png"></image></reference>
802 <paragraph>Image with multiple IDs:</paragraph>
803 <target refid="image-target-1"></target>
804 <target refid="image-target-2"></target>
805 <target refid="image-target-3"></target>
806 <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>
807 <paragraph>A centered image:</paragraph>
808 <image align="center" uri="../../../docs/user/rst/images/biohazard.png"></image>
809 <paragraph>A left-aligned image:</paragraph>
810 <image align="left" uri="../../../docs/user/rst/images/biohazard.png"></image>
811 <paragraph>This paragraph might flow around the image.
812 The specific behavior depends upon the style sheet and
813 the browser or rendering software used.</paragraph>
814 <paragraph>A right-aligned image:</paragraph>
815 <image align="right" uri="../../../docs/user/rst/images/biohazard.png"></image>
816 <paragraph>This paragraph might flow around the image.
817 The specific behavior depends upon the style sheet and
818 the browser or rendering software used.</paragraph>
819 <paragraph>For inline images see <reference name="Substitution Definitions" refid="substitution-definitions">Substitution Definitions</reference>.</paragraph>
820 <paragraph>Image size:</paragraph>
821 <paragraph>An image 2 em wide:</paragraph>
822 <image uri="../../../docs/user/rst/images/biohazard.png" width="2em"></image>
823 <paragraph>An image 2 em wide and 15 pixel high:</paragraph>
824 <image height="15px" uri="../../../docs/user/rst/images/biohazard.png" width="2em"></image>
825 <paragraph>An image occupying 50% of the line width:</paragraph>
826 <image uri="../../../docs/user/rst/images/title.png" width="50%"></image>
827 <paragraph>An image 2 cm high:</paragraph>
828 <image height="2cm" uri="../../../docs/user/rst/images/biohazard.png"></image>
829 <paragraph>A <emphasis>figure</emphasis> is an image with a caption and/or a legend. With page-based output
830 media, figures might float to a different position if this helps the page
832 <figure classes="figclass1 figclass2">
833 <image alt="reStructuredText, the markup syntax" classes="class1 class2" uri="../../../docs/user/rst/images/title.png" width="258"></image>
834 <caption>Plaintext markup syntax and parser system.</caption>
838 <colspec colwidth="12"></colspec>
839 <colspec colwidth="47"></colspec>
843 <paragraph>re</paragraph>
846 <paragraph>Revised, revisited, based on 're' module.</paragraph>
851 <paragraph>Structured</paragraph>
854 <paragraph>Structure-enhanced text, structuredtext.</paragraph>
859 <paragraph>Text</paragraph>
862 <paragraph>Well it is, isn't it?</paragraph>
868 <paragraph>This paragraph is also part of the legend.</paragraph>
871 <paragraph>A left-aligned figure, 70% wide:</paragraph>
872 <figure align="left" classes="figclass1 figclass2" width="70%">
873 <image alt="reStructuredText, the markup syntax" classes="class1 class2" uri="../../../docs/user/rst/images/biohazard.png" width="40px"></image>
874 <caption>This is the caption.</caption>
876 <paragraph>This is the legend.</paragraph>
877 <paragraph>The legend may consist of several paragraphs.</paragraph>
880 <paragraph>This paragraph might flow around the figure.</paragraph>
881 <paragraph>The specific behavior depends upon the style sheet and the browser or
882 rendering software used.</paragraph>
883 <paragraph>A centered figure:</paragraph>
884 <figure align="center">
885 <image uri="../../../docs/user/rst/images/biohazard.png" width="40px"></image>
886 <caption>This is the caption.</caption>
888 <paragraph>This is the legend.</paragraph>
889 <paragraph>The legend may consist of several paragraphs.</paragraph>
892 <paragraph>This paragraph might flow around the figure.</paragraph>
893 <paragraph>The specific behavior depends upon the style sheet and the browser or
894 rendering software used.</paragraph>
895 <paragraph>A right-aligned figure:</paragraph>
896 <figure align="right">
897 <image uri="../../../docs/user/rst/images/biohazard.png" width="40px"></image>
898 <caption>This is the caption.</caption>
900 <paragraph>This is the legend.</paragraph>
901 <paragraph>The legend may consist of several paragraphs.</paragraph>
904 <paragraph>This paragraph might flow around the figure. The specific behavior depends
905 upon the style sheet and the browser or rendering software used.</paragraph>
907 <section ids="tables" names="tables">
908 <title auto="1" refid="toc-entry-44"><generated classes="sectnum">2.14.3 </generated>Tables</title>
909 <paragraph>Tables may be given titles and additional arguments with the <emphasis>table</emphasis>
910 directive:</paragraph>
912 <title>left-aligned table</title>
914 <colspec colwidth="5"></colspec>
915 <colspec colwidth="5"></colspec>
919 <paragraph>A</paragraph>
922 <paragraph>not A</paragraph>
929 <paragraph>False</paragraph>
932 <paragraph>True</paragraph>
937 <paragraph>True</paragraph>
940 <paragraph>False</paragraph>
946 <table align="center">
947 <title>center-aligned table</title>
949 <colspec colwidth="5"></colspec>
950 <colspec colwidth="5"></colspec>
954 <paragraph>A</paragraph>
957 <paragraph>not A</paragraph>
964 <paragraph>False</paragraph>
967 <paragraph>True</paragraph>
972 <paragraph>True</paragraph>
975 <paragraph>False</paragraph>
981 <table align="right">
982 <title>right-aligned table</title>
984 <colspec colwidth="5"></colspec>
985 <colspec colwidth="5"></colspec>
989 <paragraph>A</paragraph>
992 <paragraph>not A</paragraph>
999 <paragraph>False</paragraph>
1002 <paragraph>True</paragraph>
1007 <paragraph>True</paragraph>
1010 <paragraph>False</paragraph>
1016 <paragraph>With the "widths" argument "auto" (or "class" value "colwidths-auto"),
1017 column widths are determined by the backend (if supported by the
1018 writer/backend).</paragraph>
1019 <target refid="target1"></target>
1020 <target refid="target2"></target>
1021 <table classes="colwidths-auto" ids="target2 target1" names="target2 target1">
1023 <colspec colwidth="7"></colspec>
1024 <colspec colwidth="7"></colspec>
1025 <colspec colwidth="10"></colspec>
1029 <paragraph>A</paragraph>
1032 <paragraph>B</paragraph>
1035 <paragraph>A or B</paragraph>
1042 <paragraph>False</paragraph>
1045 <paragraph>False</paragraph>
1048 <paragraph>False</paragraph>
1053 <paragraph>True</paragraph>
1056 <paragraph>False</paragraph>
1059 <paragraph>True</paragraph>
1064 <paragraph>False</paragraph>
1067 <paragraph>True</paragraph>
1070 <paragraph>True</paragraph>
1075 <paragraph>True</paragraph>
1078 <paragraph>True</paragraph>
1081 <paragraph>True</paragraph>
1088 <section ids="admonitions" names="admonitions">
1089 <title auto="1" refid="toc-entry-45"><generated classes="sectnum">2.14.4 </generated>Admonitions</title>
1091 <paragraph>Directives at large.</paragraph>
1094 <paragraph>Don't take any wooden nickels.</paragraph>
1097 <paragraph>Mad scientist at work!</paragraph>
1100 <paragraph>Does not compute.</paragraph>
1103 <paragraph>It's bigger than a bread box.</paragraph>
1106 <bullet_list bullet="-">
1108 <paragraph>Wash behind your ears.</paragraph>
1111 <paragraph>Clean up your room.</paragraph>
1114 <paragraph>Call your mother.</paragraph>
1117 <paragraph>Back up your data.</paragraph>
1122 <paragraph>This is a note.</paragraph>
1125 <paragraph>15% if the service is good.</paragraph>
1128 <paragraph>Strong prose may provoke extreme mental exertion.
1129 Reader discretion is strongly advised.</paragraph>
1131 <admonition classes="admonition-and-by-the-way">
1132 <title>And, by the way...</title>
1133 <paragraph>You can make up your own admonition too.</paragraph>
1134 <target ids="docutils" names="docutils" refuri="http://docutils.sourceforge.net/"></target>
1137 <section ids="topics-sidebars-and-rubrics" names="topics,\ sidebars,\ and\ rubrics">
1138 <title auto="1" refid="toc-entry-46"><generated classes="sectnum">2.14.5 </generated>Topics, Sidebars, and Rubrics</title>
1139 <paragraph><emphasis>Sidebars</emphasis> are like miniature, parallel documents.</paragraph>
1141 <title>Optional Sidebar Title</title>
1142 <subtitle>Optional Subtitle</subtitle>
1143 <paragraph>This is a sidebar. It is for text outside the flow of the main
1145 <rubric>This is a rubric inside a sidebar</rubric>
1146 <paragraph>Sidebars often appear beside the main text with a border and a different
1147 background or font color.</paragraph>
1149 <paragraph>A <emphasis>topic</emphasis> is like a block quote with a title, or a self-contained section
1150 with no subsections.</paragraph>
1152 <title>Topic Title</title>
1153 <paragraph>This is a topic.</paragraph>
1155 <paragraph>A <emphasis>rubric</emphasis> is like an informal heading that doesn't correspond to the
1156 document's structure. It is typically highlighted in red (hence the name).</paragraph>
1157 <rubric>This is a rubric</rubric>
1158 <paragraph>Topics and rubrics can be used at places where a <reference name="section title" refid="section-title">section title</reference> is not
1159 allowed (e.g. inside a directive).</paragraph>
1161 <section ids="target-footnotes" names="target\ footnotes">
1162 <title auto="1" refid="toc-entry-47"><generated classes="sectnum">2.14.6 </generated>Target Footnotes</title>
1163 <footnote auto="1" backrefs="footnote-reference-10 footnote-reference-11 footnote-reference-12 footnote-reference-14" ids="footnote-6" names="TARGET_NOTE:\ footnote-6">
1165 <paragraph><reference refuri="http://www.python.org/">http://www.python.org/</reference></paragraph>
1167 <footnote auto="1" backrefs="footnote-reference-13" ids="footnote-7" names="TARGET_NOTE:\ footnote-7">
1169 <paragraph><reference refuri="http://pygments.org/">http://pygments.org/</reference></paragraph>
1171 <footnote auto="1" backrefs="footnote-reference-15" ids="footnote-8" names="TARGET_NOTE:\ footnote-8">
1173 <paragraph><reference refuri="http://docutils.sourceforge.net/">http://docutils.sourceforge.net/</reference></paragraph>
1176 <section ids="replacement-text" names="replacement\ text">
1177 <title auto="1" refid="toc-entry-48"><generated classes="sectnum">2.14.7 </generated>Replacement Text</title>
1178 <paragraph>I recommend you try <reference refuri="http://www.python.org/">Python, <emphasis>the</emphasis> best language around</reference> <footnote_reference auto="1" ids="footnote-reference-12" refid="footnote-6">5</footnote_reference>.</paragraph>
1179 <substitution_definition names="Python">Python, <emphasis>the</emphasis> best language around</substitution_definition>
1181 <section ids="compound-paragraph" names="compound\ paragraph">
1182 <title auto="1" refid="toc-entry-49"><generated classes="sectnum">2.14.8 </generated>Compound Paragraph</title>
1183 <paragraph>The <emphasis>compound</emphasis> directive is used to create a "compound paragraph", which
1184 is a single logical paragraph containing multiple physical body
1185 elements. For example:</paragraph>
1187 <paragraph>The 'rm' command is very dangerous. If you are logged
1188 in as root and enter</paragraph>
1189 <literal_block xml:space="preserve">cd /
1190 rm -rf *</literal_block>
1191 <paragraph>you will erase the entire contents of your file system.</paragraph>
1193 <paragraph>Test the handling and display of compound paragraphs:</paragraph>
1194 <compound classes="some-class">
1195 <paragraph>Compound 2, paragraph 1,</paragraph>
1196 <paragraph>compound 2, paragraph 2,</paragraph>
1197 <bullet_list bullet="*">
1199 <paragraph>list item 1,</paragraph>
1202 <paragraph>list item 2,</paragraph>
1205 <paragraph>compound 2, paragraph 3.</paragraph>
1208 <paragraph>Compound 3, only consisting of one paragraph.</paragraph>
1211 <literal_block xml:space="preserve">Compound 4.
1212 This one starts with a literal block.</literal_block>
1213 <paragraph>Compound 4, paragraph following the literal block.</paragraph>
1215 <paragraph>Now something <emphasis>really</emphasis> perverted -- a nested compound block. This is
1216 just to test that it works at all; the results don't have to be
1217 meaningful.</paragraph>
1219 <paragraph>Compound 5, block 1 (a paragraph).</paragraph>
1221 <paragraph>Compound 6 is block 2 in compound 5.</paragraph>
1222 <paragraph>Compound 6, another paragraph.</paragraph>
1224 <paragraph>Compound 5, block 3 (a paragraph).</paragraph>
1227 <paragraph>Compound 7, tests the inclusion of various block-level
1228 elements in one logical paragraph. First a table,</paragraph>
1231 <colspec colwidth="20"></colspec>
1232 <colspec colwidth="20"></colspec>
1233 <colspec colwidth="20"></colspec>
1237 <paragraph>Left cell, first
1238 paragraph.</paragraph>
1239 <paragraph>Left cell, second
1240 paragraph.</paragraph>
1243 <paragraph>Middle cell,
1246 paragraph.</paragraph>
1249 <paragraph>Right cell.</paragraph>
1250 <paragraph>Paragraph 2.</paragraph>
1251 <paragraph>Paragraph 3.</paragraph>
1257 <paragraph>followed by a paragraph. This physical paragraph is
1258 actually a continuation of the paragraph before the table. It is followed
1261 <paragraph>a quote and</paragraph>
1263 <enumerated_list enumtype="arabic" prefix="" suffix=".">
1265 <paragraph>an enumerated list,</paragraph>
1268 <paragraph>a paragraph,</paragraph>
1273 <option_string>--an</option_string>
1277 <paragraph>option list,</paragraph>
1281 <paragraph>a paragraph,</paragraph>
1284 <field_name>a field</field_name>
1286 <paragraph>list,</paragraph>
1290 <paragraph>a paragraph,</paragraph>
1292 <definition_list_item>
1293 <term>a definition</term>
1295 <paragraph>list,</paragraph>
1297 </definition_list_item>
1299 <paragraph>a paragraph, an image:</paragraph>
1300 <image uri="../../../docs/user/rst/images/biohazard.png"></image>
1301 <paragraph>a paragraph,</paragraph>
1306 <paragraph>a paragraph followed by a comment,</paragraph>
1307 <comment xml:space="preserve">this is a comment</comment>
1308 <paragraph>a paragraph, a</paragraph>
1310 <paragraph>with content</paragraph>
1312 <paragraph>and the final paragraph of the compound 7.</paragraph>
1315 <section ids="parsed-literal-blocks" names="parsed\ literal\ blocks">
1316 <title auto="1" refid="toc-entry-50"><generated classes="sectnum">2.14.9 </generated>Parsed Literal Blocks</title>
1317 <literal_block xml:space="preserve">This is a parsed literal block.
1318 This line is indented. The next line is blank.
1320 Inline markup is supported, e.g. <emphasis>emphasis</emphasis>, <strong>strong</strong>, <literal>literal
1321 text</literal>, <subscript>sub-</subscript> and <superscript>super</superscript>scripts,
1322 inline formulas: <math>A = 2 \pi r^2</math>,
1323 footnotes <footnote_reference ids="footnote-reference-9" refid="footnote-1">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>
1325 <section ids="code" names="code">
1326 <title auto="1" refid="toc-entry-51"><generated classes="sectnum">2.14.10 </generated>Code</title>
1327 <paragraph>Blocks of source code can be set with the <title_reference>code</title_reference> directive. If the code
1328 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="footnote-reference-13" refid="footnote-7">6</footnote_reference>
1329 syntax highlighter and can be formatted with a style sheet. (Code parsing
1330 is turned off using the <literal>syntax-highlight</literal> config setting in the test
1331 conversions in order to get identical results with/without installed
1332 Pygments highlighter.)</paragraph>
1333 <literal_block classes="code python" xml:space="preserve">print 'This is Python code.'</literal_block>
1334 <paragraph>The <literal>:number-lines:</literal> option (with optional start value) generates line
1335 numbers:</paragraph>
1336 <literal_block classes="code python" xml:space="preserve"><inline classes="ln"> 8 </inline># print integers from 0 to 9:
1337 <inline classes="ln"> 9 </inline>for i in range(10):
1338 <inline classes="ln">10 </inline> print i</literal_block>
1339 <paragraph>For inline code snippets, there is the <title_reference>code</title_reference> role, which can be used
1340 directly (the code will not be parsed/tagged, as the language is not known)
1341 or as base for special code roles, e.g. the LaTeX code in the next
1342 paragraph.</paragraph>
1343 <paragraph>Docutils uses LaTeX syntax for math directives and roles:
1344 <literal classes="code tex">\alpha = f(x)</literal> prints <math>\alpha = f(x)</math>.</paragraph>
1345 <paragraph>The <literal>:code:</literal> option of the <title_reference>include</title_reference> directive sets the included content
1346 as a code block, here the rst file <literal>header_footer.txt</literal> with line numbers:</paragraph>
1347 <literal_block classes="code rst" source="functional/input/data/header_footer.txt" xml:space="preserve"><inline classes="ln">1 </inline>.. header:: Document header
1348 <inline classes="ln">2 </inline>.. footer:: Document footer</literal_block>
1349 <target ids="pygments" names="pygments" refuri="http://pygments.org/"></target>
1352 <section ids="substitution-definitions" names="substitution\ definitions">
1353 <title auto="1" refid="toc-entry-33"><generated classes="sectnum">2.15 </generated>Substitution Definitions</title>
1354 <paragraph>An inline image (<image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png"></image>) example:</paragraph>
1355 <substitution_definition names="EXAMPLE"><image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png"></image></substitution_definition>
1356 <paragraph>A Unicode example:</paragraph>
1357 <substitution_definition ltrim="1" names="heart" rtrim="1">♥</substitution_definition>
1358 <paragraph>(Substitution definitions are not visible in the HTML source.)</paragraph>
1360 <section ids="comments" names="comments">
1361 <title auto="1" refid="toc-entry-34"><generated classes="sectnum">2.16 </generated>Comments</title>
1362 <paragraph>Here's one:</paragraph>
1363 <comment xml:space="preserve">Comments begin with two dots and a space. Anything may
1364 follow, except for the syntax of footnotes, hyperlink
1365 targets, directives, or substitution definitions.
1367 Double-dashes -- "--" -- must be escaped somehow in HTML output.
1369 Comments may contain non-ASCII characters: ä ö ü æ ø å</comment>
1370 <paragraph>(View the HTML source to see the comment.)</paragraph>
1372 <section ids="raw-text" names="raw\ text">
1373 <title auto="1" refid="toc-entry-35"><generated classes="sectnum">2.17 </generated>Raw text</title>
1374 <paragraph>This does not necessarily look nice, because there may be missing white space.</paragraph>
1375 <paragraph>It's just there to freeze the behavior.</paragraph>
1376 <raw format="html latex" xml:space="preserve">A test.</raw>
1377 <raw format="html latex" xml:space="preserve">Second test.</raw>
1378 <raw classes="myclass" format="html latex" xml:space="preserve">Another test with myclass set.</raw>
1379 <paragraph>This is the <raw classes="myrawroleclass" format="html latex" xml:space="preserve">fourth test</raw> with myrawroleclass set.</paragraph>
1380 <raw format="html" xml:space="preserve">Fifth test in HTML.<br />Line two.</raw>
1381 <raw format="latex" xml:space="preserve">Fifth test in LaTeX.\\Line two.</raw>
1383 <section ids="container" names="container">
1384 <title auto="1" refid="toc-entry-36"><generated classes="sectnum">2.18 </generated>Container</title>
1385 <container classes="custom">
1386 <paragraph>paragraph 1</paragraph>
1387 <paragraph>paragraph 2</paragraph>
1390 <section ids="colspanning-tables" names="colspanning\ tables">
1391 <title auto="1" refid="toc-entry-37"><generated classes="sectnum">2.19 </generated>Colspanning tables</title>
1392 <paragraph>This table has a cell spanning two columns:</paragraph>
1395 <colspec colwidth="5"></colspec>
1396 <colspec colwidth="5"></colspec>
1397 <colspec colwidth="6"></colspec>
1400 <entry morecols="1">
1401 <paragraph>Inputs</paragraph>
1404 <paragraph>Output</paragraph>
1409 <paragraph>A</paragraph>
1412 <paragraph>B</paragraph>
1415 <paragraph>A or B</paragraph>
1422 <paragraph>False</paragraph>
1425 <paragraph>False</paragraph>
1428 <paragraph>False</paragraph>
1433 <paragraph>True</paragraph>
1436 <paragraph>False</paragraph>
1439 <paragraph>True</paragraph>
1444 <paragraph>False</paragraph>
1447 <paragraph>True</paragraph>
1450 <paragraph>True</paragraph>
1455 <paragraph>True</paragraph>
1458 <paragraph>True</paragraph>
1461 <paragraph>True</paragraph>
1468 <section ids="rowspanning-tables" names="rowspanning\ tables">
1469 <title auto="1" refid="toc-entry-38"><generated classes="sectnum">2.20 </generated>Rowspanning tables</title>
1470 <paragraph>Here's a table with cells spanning several rows:</paragraph>
1473 <colspec colwidth="24"></colspec>
1474 <colspec colwidth="12"></colspec>
1475 <colspec colwidth="18"></colspec>
1479 <paragraph>Header row, column 1
1480 (header rows optional)</paragraph>
1483 <paragraph>Header 2</paragraph>
1486 <paragraph>Header 3</paragraph>
1493 <paragraph>body row 1, column 1</paragraph>
1496 <paragraph>column 2</paragraph>
1499 <paragraph>column 3</paragraph>
1504 <paragraph>body row 2</paragraph>
1506 <entry morerows="1">
1507 <paragraph>Cells may
1508 span rows.</paragraph>
1510 <entry morerows="1">
1518 <paragraph>body row 3</paragraph>
1525 <section ids="complex-tables" names="complex\ tables">
1526 <title auto="1" refid="toc-entry-39"><generated classes="sectnum">2.21 </generated>Complex tables</title>
1527 <paragraph>Here's a complex table, which should test all features.</paragraph>
1530 <colspec colwidth="24"></colspec>
1531 <colspec colwidth="12"></colspec>
1532 <colspec colwidth="10"></colspec>
1533 <colspec colwidth="10"></colspec>
1537 <paragraph>Header row, column 1
1538 (header rows optional)</paragraph>
1541 <paragraph>Header 2</paragraph>
1544 <paragraph>Header 3</paragraph>
1547 <paragraph>Header 4</paragraph>
1554 <paragraph>body row 1, column 1</paragraph>
1557 <paragraph>column 2</paragraph>
1560 <paragraph>column 3</paragraph>
1563 <paragraph>column 4</paragraph>
1568 <paragraph>body row 2</paragraph>
1570 <entry morecols="2">
1571 <paragraph>Cells may span columns.</paragraph>
1576 <paragraph>body row 3</paragraph>
1578 <entry morerows="1">
1579 <paragraph>Cells may
1580 span rows.</paragraph>
1581 <paragraph>Paragraph.</paragraph>
1583 <entry morecols="1" morerows="1">
1584 <bullet_list bullet="-">
1586 <paragraph>Table cells</paragraph>
1589 <paragraph>contain</paragraph>
1592 <paragraph>body elements.</paragraph>
1599 <paragraph>body row 4</paragraph>
1604 <paragraph>body row 5</paragraph>
1606 <entry morecols="1">
1607 <paragraph>Cells may also be
1608 empty: <literal>--></literal></paragraph>
1617 <section ids="list-tables" names="list\ tables">
1618 <title auto="1" refid="toc-entry-40"><generated classes="sectnum">2.22 </generated>List Tables</title>
1619 <paragraph>Here's a list table exercising all features:</paragraph>
1620 <table classes="colwidths-given test" width="40em">
1621 <title>list table with integral header</title>
1623 <colspec colwidth="10" stub="1"></colspec>
1624 <colspec colwidth="20"></colspec>
1625 <colspec colwidth="30"></colspec>
1629 <paragraph>Treat</paragraph>
1632 <paragraph>Quantity</paragraph>
1635 <paragraph>Description</paragraph>
1642 <paragraph>Albatross</paragraph>
1645 <paragraph>2.99</paragraph>
1648 <paragraph>On a stick!</paragraph>
1653 <paragraph>Crunchy Frog</paragraph>
1656 <paragraph>1.49</paragraph>
1659 <paragraph>If we took the bones out, it wouldn't be
1660 crunchy, now would it?</paragraph>
1665 <paragraph>Gannet Ripple</paragraph>
1668 <paragraph>1.99</paragraph>
1671 <paragraph>On a stick!</paragraph>
1677 <table align="center" classes="colwidths-auto">
1678 <title>center aligned list table</title>
1680 <colspec colwidth="50"></colspec>
1681 <colspec colwidth="50"></colspec>
1685 <paragraph>Albatross</paragraph>
1688 <paragraph>2.99</paragraph>
1693 <paragraph>Crunchy Frog</paragraph>
1696 <paragraph>1.49</paragraph>
1701 <paragraph>Gannet Ripple</paragraph>
1704 <paragraph>1.99</paragraph>
1712 <section ids="error-handling" names="error\ handling">
1713 <title auto="1" refid="toc-entry-41"><generated classes="sectnum">3 </generated>Error Handling</title>
1714 <paragraph>Any errors caught during processing will generate system messages.</paragraph>
1715 <paragraph>There should be five messages in the following, auto-generated
1716 section, "Docutils System Messages":</paragraph>
1717 <comment xml:space="preserve">section should be added by Docutils automatically</comment>
1719 <section classes="system-messages">
1720 <title>Docutils System Messages</title>
1721 <system_message backrefs="problematic-1" ids="system-message-1" level="3" line="104" source="functional/input/data/standard.txt" type="ERROR">
1722 <paragraph>Undefined substitution referenced: "problematic".</paragraph>
1724 <system_message backrefs="footnote-reference-8" ids="system-message-2" level="3" line="392" source="functional/input/data/standard.txt" type="ERROR">
1725 <paragraph>Unknown target name: "5".</paragraph>
1727 <system_message backrefs="citation-reference-3" ids="system-message-3" level="3" line="401" source="functional/input/data/standard.txt" type="ERROR">
1728 <paragraph>Unknown target name: "nonexistent".</paragraph>
1730 <system_message backrefs="problematic-2" ids="system-message-4" level="3" line="428" source="functional/input/data/standard.txt" type="ERROR">
1731 <paragraph>Unknown target name: "hyperlink reference without a target".</paragraph>
1733 <system_message backrefs="problematic-3" ids="system-message-5" level="3" line="441" source="functional/input/data/standard.txt" type="ERROR">
1734 <paragraph>Duplicate target name, cannot be used as a unique reference: "duplicate target names".</paragraph>
1736 <system_message level="1" line="164" source="functional/input/data/standard.txt" type="INFO">
1737 <paragraph>Hyperlink target "target" is not referenced.</paragraph>
1739 <system_message level="1" line="406" source="functional/input/data/standard.txt" type="INFO">
1740 <paragraph>Hyperlink target "another-target" is not referenced.</paragraph>
1742 <system_message level="1" line="474" source="functional/input/data/standard.txt" type="INFO">
1743 <paragraph>Hyperlink target "image-target-1" is not referenced.</paragraph>
1745 <system_message level="1" line="475" source="functional/input/data/standard.txt" type="INFO">
1746 <paragraph>Hyperlink target "image-target-2" is not referenced.</paragraph>
1748 <system_message level="1" line="476" source="functional/input/data/standard.txt" type="INFO">
1749 <paragraph>Hyperlink target "image-target-3" is not referenced.</paragraph>
1751 <system_message level="1" line="643" source="functional/input/data/standard.txt" type="INFO">
1752 <paragraph>Hyperlink target "target1" is not referenced.</paragraph>
1754 <system_message level="1" line="644" source="functional/input/data/standard.txt" type="INFO">
1755 <paragraph>Hyperlink target "target2" is not referenced.</paragraph>
1757 <system_message level="1" line="689" source="functional/input/data/standard.txt" type="INFO">
1758 <paragraph>Hyperlink target "docutils" is not referenced.</paragraph>
1760 <system_message level="1" line="855" source="functional/input/data/standard.txt" type="INFO">
1761 <paragraph>Hyperlink target "hyperlink targets" is not referenced.</paragraph>