Debian Codegraph @

test/functional/expected/standalone_rst_pseudoxml.txt

raw
1 <document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_pseudoxml.rst" title="reStructuredText Test Document">
2 <title>
3 reStructuredText Test Document
4 <subtitle ids="examples-of-syntax-constructs subtitle" names="examples\ of\ syntax\ constructs subtitle">
5 Examples of Syntax Constructs
6 <meta content="reStructuredText, test, parser" name="keywords">
7 <meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description">
8 <decoration>
9 <header>
10 <paragraph>
11 Document header
12 <footer>
13 <paragraph>
14 Document footer
15 <docinfo>
16 <author>
17 David Goodger
18 <address xml:space="preserve">
19 123 Example Street
20 Example, EX Canada
21 A1B 2C3
22 <contact>
23 <reference refuri="mailto:[email protected]">
24 [email protected]
25 <authors>
26 <author>
27 Me
28 <author>
29 Myself
30 <author>
31 I
32 <organization>
33 humankind
34 <date>
35 Now, or yesterday. Or maybe even
36 <emphasis>
37 before
38 yesterday.
39 <status>
40 This is a "work in progress"
41 <revision>
42 is managed by a version control system.
43 <version>
44 1
45 <copyright>
46 This document has been placed in the public domain. You
47 may do with it as you wish. You may copy, modify,
48 redistribute, reattribute, sell, buy, rent, lease,
49 destroy, or improve it, quote it at length, excerpt,
50 incorporate, collate, fold, staple, or mutilate it, or do
51 anything else to it that your or anyone else's heart
52 desires.
53 <field classes="field-name">
54 <field_name>
55 field name
56 <field_body>
57 <paragraph>
58 This is a "generic bibliographic field".
59 <field classes="field-name-2">
60 <field_name>
61 field name "2"
62 <field_body>
63 <paragraph>
64 Generic bibliographic fields may contain multiple body elements.
65 <paragraph>
66 Like this.
67 <topic classes="dedication">
68 <title>
69 Dedication
70 <paragraph>
71 For Docutils users & co-developers.
72 <topic classes="abstract">
73 <title>
74 Abstract
75 <paragraph>
76 This is a test document, containing at least one example of each
77 reStructuredText construct.
78 <comment xml:space="preserve">
79 This is a comment. Note how any initial comments are moved by
80 transforms to after the document title, subtitle, and docinfo.
81 <target refid="doctitle">
82 <comment xml:space="preserve">
83 Above is the document title, and below is the subtitle.
84 They are transformed from section titles after parsing.
85 <target refid="subtitle">
86 <comment xml:space="preserve">
87 bibliographic fields (which also require a transform):
88 <raw format="latex" xml:space="preserve">
89 \pagebreak[4] % start ToC on new page
90 <topic classes="contents" ids="table-of-contents" names="table\ of\ contents">
91 <title>
92 Table of Contents
93 <bullet_list classes="auto-toc">
94 <list_item>
95 <paragraph>
96 <reference ids="toc-entry-1" refid="structural-elements">
97 <generated classes="sectnum">
98 1   
99 Structural Elements
100 <bullet_list classes="auto-toc">
101 <list_item>
102 <paragraph>
103 <reference ids="toc-entry-2" refid="section-title">
104 <generated classes="sectnum">
105 1.1   
106 Section Title
107 <list_item>
108 <paragraph>
109 <reference ids="toc-entry-3" refid="empty-section">
110 <generated classes="sectnum">
111 1.2   
112 Empty Section
113 <list_item>
114 <paragraph>
115 <reference ids="toc-entry-4" refid="transitions">
116 <generated classes="sectnum">
117 1.3   
118 Transitions
119 <list_item>
120 <paragraph>
121 <reference ids="toc-entry-5" refid="body-elements">
122 <generated classes="sectnum">
123 2   
124 Body Elements
125 <bullet_list classes="auto-toc">
126 <list_item>
127 <paragraph>
128 <reference ids="toc-entry-6" refid="paragraphs">
129 <generated classes="sectnum">
130 2.1   
131 Paragraphs
132 <bullet_list classes="auto-toc">
133 <list_item>
134 <paragraph>
135 <reference ids="toc-entry-7" refid="inline-markup">
136 <generated classes="sectnum">
137 2.1.1   
138 Inline Markup
139 <list_item>
140 <paragraph>
141 <reference ids="toc-entry-8" refid="bullet-lists">
142 <generated classes="sectnum">
143 2.2   
144 Bullet Lists
145 <list_item>
146 <paragraph>
147 <reference ids="toc-entry-9" refid="enumerated-lists">
148 <generated classes="sectnum">
149 2.3   
150 Enumerated Lists
151 <list_item>
152 <paragraph>
153 <reference ids="toc-entry-10" refid="definition-lists">
154 <generated classes="sectnum">
155 2.4   
156 Definition Lists
157 <list_item>
158 <paragraph>
159 <reference ids="toc-entry-11" refid="field-lists">
160 <generated classes="sectnum">
161 2.5   
162 Field Lists
163 <list_item>
164 <paragraph>
165 <reference ids="toc-entry-12" refid="option-lists">
166 <generated classes="sectnum">
167 2.6   
168 Option Lists
169 <list_item>
170 <paragraph>
171 <reference ids="toc-entry-13" refid="literal-blocks">
172 <generated classes="sectnum">
173 2.7   
174 Literal Blocks
175 <list_item>
176 <paragraph>
177 <reference ids="toc-entry-14" refid="line-blocks">
178 <generated classes="sectnum">
179 2.8   
180 Line Blocks
181 <list_item>
182 <paragraph>
183 <reference ids="toc-entry-15" refid="block-quotes">
184 <generated classes="sectnum">
185 2.9   
186 Block Quotes
187 <list_item>
188 <paragraph>
189 <reference ids="toc-entry-16" refid="doctest-blocks">
190 <generated classes="sectnum">
191 2.10   
192 Doctest Blocks
193 <list_item>
194 <paragraph>
195 <reference ids="toc-entry-17" refid="footnotes">
196 <generated classes="sectnum">
197 2.11   
198 Footnotes
199 <list_item>
200 <paragraph>
201 <reference ids="toc-entry-18" refid="citations">
202 <generated classes="sectnum">
203 2.12   
204 Citations
205 <list_item>
206 <paragraph>
207 <reference ids="toc-entry-19" refid="targets">
208 <generated classes="sectnum">
209 2.13   
210 Targets
211 <bullet_list classes="auto-toc">
212 <list_item>
213 <paragraph>
214 <reference ids="toc-entry-20" refid="duplicate-target-names-1">
215 <generated classes="sectnum">
216 2.13.1   
217 Duplicate Target Names
218 <list_item>
219 <paragraph>
220 <reference ids="toc-entry-21" refid="duplicate-target-names-2">
221 <generated classes="sectnum">
222 2.13.2   
223 Duplicate Target Names
224 <list_item>
225 <paragraph>
226 <reference ids="toc-entry-22" refid="directives">
227 <generated classes="sectnum">
228 2.14   
229 Directives
230 <bullet_list classes="auto-toc">
231 <list_item>
232 <paragraph>
233 <reference ids="toc-entry-23" refid="document-parts">
234 <generated classes="sectnum">
235 2.14.1   
236 Document Parts
237 <list_item>
238 <paragraph>
239 <reference ids="toc-entry-24" refid="images-and-figures">
240 <generated classes="sectnum">
241 2.14.2   
242 Images and Figures
243 <list_item>
244 <paragraph>
245 <reference ids="toc-entry-25" refid="tables">
246 <generated classes="sectnum">
247 2.14.3   
248 Tables
249 <list_item>
250 <paragraph>
251 <reference ids="toc-entry-26" refid="admonitions">
252 <generated classes="sectnum">
253 2.14.4   
254 Admonitions
255 <list_item>
256 <paragraph>
257 <reference ids="toc-entry-27" refid="topics-sidebars-and-rubrics">
258 <generated classes="sectnum">
259 2.14.5   
260 Topics, Sidebars, and Rubrics
261 <list_item>
262 <paragraph>
263 <reference ids="toc-entry-28" refid="target-footnotes">
264 <generated classes="sectnum">
265 2.14.6   
266 Target Footnotes
267 <list_item>
268 <paragraph>
269 <reference ids="toc-entry-29" refid="replacement-text">
270 <generated classes="sectnum">
271 2.14.7   
272 Replacement Text
273 <list_item>
274 <paragraph>
275 <reference ids="toc-entry-30" refid="compound-paragraph">
276 <generated classes="sectnum">
277 2.14.8   
278 Compound Paragraph
279 <list_item>
280 <paragraph>
281 <reference ids="toc-entry-31" refid="parsed-literal-blocks">
282 <generated classes="sectnum">
283 2.14.9   
284 Parsed Literal Blocks
285 <list_item>
286 <paragraph>
287 <reference ids="toc-entry-32" refid="code">
288 <generated classes="sectnum">
289 2.14.10   
290 Code
291 <list_item>
292 <paragraph>
293 <reference ids="toc-entry-33" refid="meta">
294 <generated classes="sectnum">
295 2.14.11   
296 Meta
297 <list_item>
298 <paragraph>
299 <reference ids="toc-entry-34" refid="substitution-definitions">
300 <generated classes="sectnum">
301 2.15   
302 Substitution Definitions
303 <list_item>
304 <paragraph>
305 <reference ids="toc-entry-35" refid="comments">
306 <generated classes="sectnum">
307 2.16   
308 Comments
309 <list_item>
310 <paragraph>
311 <reference ids="toc-entry-36" refid="raw-text">
312 <generated classes="sectnum">
313 2.17   
314 Raw text
315 <list_item>
316 <paragraph>
317 <reference ids="toc-entry-37" refid="container">
318 <generated classes="sectnum">
319 2.18   
320 Container
321 <list_item>
322 <paragraph>
323 <reference ids="toc-entry-38" refid="colspanning-tables">
324 <generated classes="sectnum">
325 2.19   
326 Colspanning tables
327 <list_item>
328 <paragraph>
329 <reference ids="toc-entry-39" refid="rowspanning-tables">
330 <generated classes="sectnum">
331 2.20   
332 Rowspanning tables
333 <list_item>
334 <paragraph>
335 <reference ids="toc-entry-40" refid="complex-tables">
336 <generated classes="sectnum">
337 2.21   
338 Complex tables
339 <list_item>
340 <paragraph>
341 <reference ids="toc-entry-41" refid="list-tables">
342 <generated classes="sectnum">
343 2.22   
344 List Tables
345 <list_item>
346 <paragraph>
347 <reference ids="toc-entry-42" refid="error-handling">
348 <generated classes="sectnum">
349 3   
350 Error Handling
351 <section ids="structural-elements" names="structural\ elements">
352 <title auto="1" refid="toc-entry-1">
353 <generated classes="sectnum">
354 1   
355 Structural Elements
356 <section ids="section-title" names="section\ title">
357 <title auto="1" refid="toc-entry-2">
358 <generated classes="sectnum">
359 1.1   
360 Section Title
361 <subtitle ids="section-subtitle" names="section\ subtitle">
362 Section Subtitle
363 <paragraph>
364 Lone subsections are converted to a section subtitle by a transform
365 activated with the
366 <literal>
367 --section-subtitles
368 command line option or the
369 <literal>
370 sectsubtitle-xform
371 configuration value.
372 <section ids="empty-section" names="empty\ section">
373 <title auto="1" refid="toc-entry-3">
374 <generated classes="sectnum">
375 1.2   
376 Empty Section
377 <section ids="transitions" names="transitions">
378 <title auto="1" refid="toc-entry-4">
379 <generated classes="sectnum">
380 1.3   
381 Transitions
382 <paragraph>
383 Here's a transition:
384 <transition>
385 <paragraph>
386 It divides the section. Transitions may also occur between sections:
387 <transition>
388 <section ids="body-elements" names="body\ elements">
389 <title auto="1" refid="toc-entry-5">
390 <generated classes="sectnum">
391 2   
392 Body Elements
393 <section ids="paragraphs" names="paragraphs">
394 <title auto="1" refid="toc-entry-6">
395 <generated classes="sectnum">
396 2.1   
397 Paragraphs
398 <paragraph>
399 A paragraph.
400 <section ids="inline-markup" names="inline\ markup">
401 <title auto="1" refid="toc-entry-7">
402 <generated classes="sectnum">
403 2.1.1   
404 Inline Markup
405 <paragraph>
406 Paragraphs contain text and may contain inline markup:
407 <emphasis>
408 emphasis
409 ,
410 <strong>
411 strong emphasis
412 ,
413 <literal>
414 inline literals
415 , standalone hyperlinks
416 (
417 <reference refuri="http://www.python.org">
418 http://www.python.org
419 ), external hyperlinks (
420 <reference name="Python" refuri="http://www.python.org/">
421 Python
422
423 <footnote_reference auto="1" ids="footnote-reference-10" refid="footnote-6">
424 5
425 ), internal
426 cross-references (
427 <reference name="example" refid="example">
428 example
429 ), external hyperlinks with embedded URIs
430 (
431 <reference name="Python web site" refuri="http://www.python.org">
432 Python web site
433 ),
434 <reference anonymous="1" name="anonymous hyperlink references" refuri="http://www.python.org/">
435 anonymous hyperlink
436 references
437
438 <footnote_reference auto="1" ids="footnote-reference-14" refid="footnote-6">
439 5
440 (
441 <reference anonymous="1" name="a second reference" refuri="https://docutils.sourceforge.io/">
442 a second reference
443
444 <footnote_reference auto="1" ids="footnote-reference-15" refid="footnote-8">
445 7
446 ), footnote references (manually
447 numbered
448 <footnote_reference ids="footnote-reference-1" refid="footnote-1">
449 1
450 , anonymous auto-numbered
451 <footnote_reference auto="1" ids="footnote-reference-2" refid="footnote-2">
452 3
453 , labeled auto-numbered
454 <footnote_reference auto="1" ids="footnote-reference-3" refid="label">
455 2
456 , or symbolic
457 <footnote_reference auto="*" ids="footnote-reference-4" refid="footnote-3">
458 *
459 ), citation references (see
460 <citation_reference ids="citation-reference-1" refid="cit2002">
461 CIT2002
462 ),
463 substitution references (
464 <image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png">
465 &
466 a
467 <emphasis>
468 trimmed heart
469
470 <literal>
471 (U+2665):
472 ♥
473 ), and
474 <target ids="inline-hyperlink-targets" names="inline\ hyperlink\ targets">
475 inline hyperlink targets
476
477 (see
478 <reference name="Targets" refid="targets">
479 Targets
480 below for a reference back to here). Character-level
481 inline markup is also possible (although exceedingly ugly!) in
482 <emphasis>
483 re
484 <literal>
485 Structured
486 <emphasis>
487 Text
488 . Problems are indicated by
489 <problematic ids="problematic-1" refid="system-message-1">
490 |problematic|
491 text
492 (generated by processing errors; this one is intentional). Here is a
493 reference to the
494 <reference name="doctitle" refid="doctitle">
495 doctitle
496 and the
497 <reference name="subtitle" refid="subtitle">
498 subtitle
499 .
500 <target anonymous="1" ids="target-1" refuri="http://www.python.org/">
501 <target anonymous="1" ids="target-2" refuri="https://docutils.sourceforge.io/">
502 <paragraph>
503 The default role for interpreted text is
504 <title_reference>
505 Title Reference
506 . Here are
507 some explicit interpreted text roles: a PEP reference (
508 <reference refuri="https://peps.python.org/pep-0287">
509 PEP 287
510 ); an
511 RFC reference (
512 <reference refuri="https://tools.ietf.org/html/rfc2822.html">
513 RFC 2822
514 ); an abbreviation (
515 <abbreviation>
516 abb.
517 ), an acronym
518 (
519 <acronym>
520 reST
521 ), code (
522 <literal classes="code">
523 print "hello world"
524 ); a
525 <subscript>
526 subscript
527 ;
528 a
529 <superscript>
530 superscript
531 and explicit roles for
532 <title_reference>
533 Docutils
534 '
535 <emphasis>
536 standard
537
538 <strong>
539 inline
540
541 <literal>
542 markup
543 .
544 <comment xml:space="preserve">
545 DO NOT RE-WRAP THE FOLLOWING PARAGRAPH!
546 <paragraph>
547 Let's test wrapping and whitespace significance in inline literals:
548 <literal>
549 This is an example of --inline-literal --text, --including some--
550 strangely--hyphenated-words. Adjust-the-width-of-your-browser-window
551 to see how the text is wrapped. -- ---- -------- Now note the
552 spacing between the words of this sentence (words
553 should be grouped in pairs).
554 <paragraph>
555 If the
556 <literal>
557 --pep-references
558 option was supplied, there should be a
559 live link to PEP 258 here.
560 <section ids="bullet-lists" names="bullet\ lists">
561 <title auto="1" refid="toc-entry-8">
562 <generated classes="sectnum">
563 2.2   
564 Bullet Lists
565 <bullet_list bullet="-">
566 <list_item>
567 <paragraph>
568 A bullet list
569 <bullet_list bullet="+">
570 <list_item>
571 <paragraph>
572 Nested bullet list.
573 <list_item>
574 <paragraph>
575 Nested item 2.
576 <list_item>
577 <paragraph>
578 Item 2.
579 <paragraph>
580 Paragraph 2 of item 2.
581 <bullet_list bullet="*">
582 <list_item>
583 <paragraph>
584 Nested bullet list.
585 <list_item>
586 <paragraph>
587 Nested item 2.
588 <bullet_list bullet="-">
589 <list_item>
590 <paragraph>
591 Third level.
592 <list_item>
593 <paragraph>
594 Item 2.
595 <list_item>
596 <paragraph>
597 Nested item 3.
598 <list_item>
599 <paragraph>
600 This nested list should be compacted by the HTML writer.
601 <target ids="target" names="target">
602 <comment xml:space="preserve">
603 Even if this item contains a target and a comment.
604 <section ids="enumerated-lists" names="enumerated\ lists">
605 <title auto="1" refid="toc-entry-9">
606 <generated classes="sectnum">
607 2.3   
608 Enumerated Lists
609 <enumerated_list enumtype="arabic" prefix="" suffix=".">
610 <list_item>
611 <paragraph>
612 Arabic numerals.
613 <enumerated_list enumtype="loweralpha" prefix="" suffix=")">
614 <list_item>
615 <paragraph>
616 lower alpha)
617 <enumerated_list enumtype="lowerroman" prefix="(" suffix=")">
618 <list_item>
619 <paragraph>
620 (lower roman)
621 <enumerated_list enumtype="upperalpha" prefix="" suffix=".">
622 <list_item>
623 <paragraph>
624 upper alpha.
625 <enumerated_list enumtype="upperroman" prefix="" suffix=")">
626 <list_item>
627 <paragraph>
628 upper roman)
629 <list_item>
630 <paragraph>
631 Lists that don't start at 1:
632 <enumerated_list enumtype="arabic" prefix="" start="3" suffix=".">
633 <list_item>
634 <paragraph>
635 Three
636 <list_item>
637 <paragraph>
638 Four
639 <system_message level="1" line="178" source="functional/input/data/standard.rst" type="INFO">
640 <paragraph>
641 Enumerated list start value not ordinal-1: "3" (ordinal 3)
642 <enumerated_list enumtype="upperalpha" prefix="" start="3" suffix=".">
643 <list_item>
644 <paragraph>
645 C
646 <list_item>
647 <paragraph>
648 D
649 <system_message level="1" line="182" source="functional/input/data/standard.rst" type="INFO">
650 <paragraph>
651 Enumerated list start value not ordinal-1: "C" (ordinal 3)
652 <enumerated_list enumtype="lowerroman" prefix="" start="3" suffix=".">
653 <list_item>
654 <paragraph>
655 iii
656 <list_item>
657 <paragraph>
658 iv
659 <system_message level="1" line="186" source="functional/input/data/standard.rst" type="INFO">
660 <paragraph>
661 Enumerated list start value not ordinal-1: "iii" (ordinal 3)
662 <section ids="definition-lists" names="definition\ lists">
663 <title auto="1" refid="toc-entry-10">
664 <generated classes="sectnum">
665 2.4   
666 Definition Lists
667 <definition_list>
668 <definition_list_item>
669 <term>
670 Term
671 <definition>
672 <paragraph>
673 Definition
674 <definition_list_item>
675 <term>
676 Term
677 <classifier>
678 classifier
679 <definition>
680 <paragraph>
681 Definition paragraph 1.
682 <paragraph>
683 Definition paragraph 2.
684 <definition_list_item>
685 <term>
686 Term
687 <definition>
688 <paragraph>
689 Definition
690 <definition_list_item>
691 <term>
692 Term
693 <classifier>
694 classifier one
695 <classifier>
696 classifier two
697 <definition>
698 <paragraph>
699 Definition
700 <section ids="field-lists" names="field\ lists">
701 <title auto="1" refid="toc-entry-11">
702 <generated classes="sectnum">
703 2.5   
704 Field Lists
705 <field_list>
706 <field>
707 <field_name>
708 what
709 <field_body>
710 <paragraph>
711 Field lists map field names to field bodies, like database
712 records. They are often part of an extension syntax. They are
713 an unambiguous variant of RFC 2822 fields.
714 <field>
715 <field_name>
716 how arg1 arg2
717 <field_body>
718 <paragraph>
719 The field marker is a colon, the field name, and a colon.
720 <paragraph>
721 The field body may contain one or more body elements, indented
722 relative to the field marker.
723 <field>
724 <field_name>
725 credits
726 <field_body>
727 <paragraph classes="credits">
728 This paragraph has the
729 <title_reference>
730 credits
731 class set. (This is actually not
732 about credits but just for ensuring that the class attribute
733 doesn't get stripped away.)
734 <section ids="option-lists" names="option\ lists">
735 <title auto="1" refid="toc-entry-12">
736 <generated classes="sectnum">
737 2.6   
738 Option Lists
739 <paragraph>
740 For listing command-line options:
741 <option_list>
742 <option_list_item>
743 <option_group>
744 <option>
745 <option_string>
746 -a
747 <description>
748 <paragraph>
749 command-line option "a"
750 <option_list_item>
751 <option_group>
752 <option>
753 <option_string>
754 -b
755 <option_argument delimiter=" ">
756 file
757 <description>
758 <paragraph>
759 options can have arguments
760 and long descriptions
761 <option_list_item>
762 <option_group>
763 <option>
764 <option_string>
765 --long
766 <description>
767 <paragraph>
768 options can be long, too
769 <option_list_item>
770 <option_group>
771 <option>
772 <option_string>
773 --input
774 <option_argument delimiter="=">
775 file
776 <description>
777 <paragraph>
778 long options can also have arguments
779 <option_list_item>
780 <option_group>
781 <option>
782 <option_string>
783 /V
784 <description>
785 <paragraph>
786 DOS/VMS-style option
787 <option_list_item>
788 <option_group>
789 <option>
790 <option_string>
791 --very-long-option
792 <description>
793 <paragraph>
794 The description can also start on the next line.
795 <paragraph>
796 The description may contain multiple body elements,
797 regardless of where it starts.
798 <option_list_item>
799 <option_group>
800 <option>
801 <option_string>
802 -x
803 <option>
804 <option_string>
805 -y
806 <option>
807 <option_string>
808 -z
809 <description>
810 <paragraph>
811 Multiple options are an "option group".
812 <option_list_item>
813 <option_group>
814 <option>
815 <option_string>
816 -v
817 <option>
818 <option_string>
819 --verbose
820 <description>
821 <paragraph>
822 Commonly-seen: short & long options.
823 <option_list_item>
824 <option_group>
825 <option>
826 <option_string>
827 -1
828 <option_argument delimiter=" ">
829 file
830 <option>
831 <option_string>
832 --one
833 <option_argument delimiter="=">
834 file
835 <option>
836 <option_string>
837 --two
838 <option_argument delimiter=" ">
839 file
840 <description>
841 <paragraph>
842 Multiple options with arguments.
843 <option_list_item>
844 <option_group>
845 <option>
846 <option_string>
847 -f
848 <option_argument delimiter=" ">
849 <[path]file>
850 <description>
851 <paragraph>
852 Option argumens must start with a letter
853 or be wrapped in angle brackets.
854 <option_list_item>
855 <option_group>
856 <option>
857 <option_string>
858 -d
859 <option_argument delimiter=" ">
860 <src dest>
861 <description>
862 <paragraph>
863 Angle brackets are also required if an
864 option expects more than one argument.
865 <paragraph>
866 There must be at least two spaces between the option and the
867 description.
868 <section ids="literal-blocks" names="literal\ blocks">
869 <title auto="1" refid="toc-entry-13">
870 <generated classes="sectnum">
871 2.7   
872 Literal Blocks
873 <paragraph>
874 Literal blocks are indicated with a double-colon ("::") at the end of
875 the preceding paragraph (over there
876 <literal>
877 -->
878 ). They can be indented:
879 <literal_block xml:space="preserve">
880 if literal_block:
881 text = 'is left as-is'
882 spaces_and_linebreaks = 'are preserved'
883 markup_processing = None
884 <paragraph>
885 Or they can be quoted without indentation:
886 <literal_block xml:space="preserve">
887 >> Great idea!
888 >
889 > Why didn't I think of that?
890 <section ids="line-blocks" names="line\ blocks">
891 <title auto="1" refid="toc-entry-14">
892 <generated classes="sectnum">
893 2.8   
894 Line Blocks
895 <paragraph>
896 This section tests line blocks. Line blocks are body elements which
897 consist of lines and other line blocks. Nested line blocks cause
898 indentation.
899 <line_block>
900 <line>
901 This is a line block. It ends with a blank line.
902 <line_block>
903 <line>
904 New lines begin with a vertical bar ("|").
905 <line>
906 Line breaks and initial indent are significant, and preserved.
907 <line_block>
908 <line>
909 Continuation lines are also possible. A long line that is intended
910 to wrap should begin with a space in place of the vertical bar.
911 <line>
912 The left edge of a continuation line need not be aligned with
913 the left edge of the text above it.
914 <line_block>
915 <line>
916 This is a second line block.
917 <line>
918 <line>
919 Blank lines are permitted internally, but they must begin with a "|".
920 <paragraph>
921 Another line block, surrounded by paragraphs:
922 <line_block>
923 <line>
924 And it's no good waiting by the window
925 <line>
926 It's no good waiting for the sun
927 <line>
928 Please believe me, the things you dream of
929 <line>
930 They don't fall in the lap of no-one
931 <paragraph>
932 Take it away, Eric the Orchestra Leader!
933 <block_quote>
934 <line_block>
935 <line>
936 A one, two, a one two three four
937 <line>
938 <line>
939 Half a bee, philosophically,
940 <line_block>
941 <line>
942 must,
943 <emphasis>
944 ipso facto
945 , half not be.
946 <line>
947 But half the bee has got to be,
948 <line_block>
949 <line>
950 <emphasis>
951 vis a vis
952 its entity. D'you see?
953 <line>
954 <line>
955 But can a bee be said to be
956 <line_block>
957 <line>
958 or not to be an entire bee,
959 <line_block>
960 <line>
961 when half the bee is not a bee,
962 <line_block>
963 <line>
964 due to some ancient injury?
965 <line>
966 <line>
967 Singing...
968 <paragraph>
969 A line block, like the following poem by Christian Morgenstern, can
970 also be centre-aligned:
971 <line_block classes="language-de align-center">
972 <line>
973 <strong>
974 Die Trichter
975 <line>
976 <line>
977 Zwei Trichter wandeln durch die Nacht.
978 <line>
979 Durch ihres Rumpfs verengten Schacht
980 <line>
981 fließt weißes Mondlicht
982 <line>
983 still und heiter
984 <line>
985 auf   ihren
986 <line>
987 Waldweg
988 <line>
989 u. s.
990 <line>
991 w.
992 <line>
993 <section ids="block-quotes" names="block\ quotes">
994 <title auto="1" refid="toc-entry-15">
995 <generated classes="sectnum">
996 2.9   
997 Block Quotes
998 <paragraph>
999 Block quotes consist of indented body elements:
1000 <block_quote>
1001 <paragraph>
1002 My theory by A. Elk. Brackets Miss, brackets. This theory goes
1003 as follows and begins now. All brontosauruses are thin at one
1004 end, much much thicker in the middle and then thin again at the
1005 far end. That is my theory, it is mine, and belongs to me and I
1006 own it, and what it is too.
1007 <attribution>
1008 Anne Elk (Miss)
1009 <paragraph>
1010 The language of a quote (like any other object) can be specified by
1011 a class attribute:
1012 <comment xml:space="preserve">
1013 <block_quote classes="language-fr">
1014 <paragraph>
1015 ReStructuredText est un langage de balisage léger utilisé
1016 notamment dans la documentation du langage Python.
1017 <section ids="doctest-blocks" names="doctest\ blocks">
1018 <title auto="1" refid="toc-entry-16">
1019 <generated classes="sectnum">
1020 2.10   
1021 Doctest Blocks
1022 <doctest_block xml:space="preserve">
1023 >>> print 'Python-specific usage examples; begun with ">>>"'
1024 Python-specific usage examples; begun with ">>>"
1025 >>> print '(cut and pasted from interactive Python sessions)'
1026 (cut and pasted from interactive Python sessions)
1027 <section ids="footnotes" names="footnotes">
1028 <title auto="1" refid="toc-entry-17">
1029 <generated classes="sectnum">
1030 2.11   
1031 Footnotes
1032 <footnote backrefs="footnote-reference-1 footnote-reference-5 footnote-reference-9" ids="footnote-1" names="1">
1033 <label>
1034 1
1035 <paragraph>
1036 A footnote contains body elements, consistently indented by at
1037 least 1 space.
1038 <paragraph>
1039 This is the footnote's second paragraph.
1040 <footnote auto="1" backrefs="footnote-reference-3 footnote-reference-6" ids="label" names="label">
1041 <label>
1042 2
1043 <paragraph>
1044 Footnotes may be numbered, either manually (as in
1045 <footnote_reference ids="footnote-reference-5" refid="footnote-1">
1046 1
1047 ) or
1048 automatically using a "#"-prefixed label. This footnote has a
1049 label so it can be referred to from multiple places, both as a
1050 footnote reference (
1051 <footnote_reference auto="1" ids="footnote-reference-6" refid="label">
1052 2
1053 ) and as a
1054 <reference anonymous="1" name="hyperlink reference" refid="label">
1055 hyperlink reference
1056 .
1057 <target anonymous="1" ids="target-3" refid="label">
1058 <footnote auto="1" backrefs="footnote-reference-2" ids="footnote-2" names="3">
1059 <label>
1060 3
1061 <paragraph>
1062 This footnote is numbered automatically and anonymously using a
1063 label of "#" only.
1064 <paragraph>
1065 This is the second paragraph.
1066 <paragraph>
1067 And this is the third paragraph.
1068 <footnote auto="*" backrefs="footnote-reference-4" ids="footnote-3">
1069 <label>
1070 *
1071 <paragraph>
1072 Footnotes may also use symbols, specified with a "*" label.
1073 Here's a reference to the next footnote:
1074 <footnote_reference auto="*" ids="footnote-reference-7" refid="footnote-4">
1075 †
1076 .
1077 <footnote auto="*" backrefs="footnote-reference-7" ids="footnote-4">
1078 <label>
1079 †
1080 <paragraph>
1081 This footnote shows the next symbol in the sequence.
1082 <footnote ids="footnote-5" names="4">
1083 <label>
1084 4
1085 <paragraph>
1086 Here's an unreferenced footnote, with a reference to a
1087 nonexistent footnote:
1088 <problematic ids="footnote-reference-8" refid="system-message-2">
1089 [5]_
1090 .
1091 <section ids="citations" names="citations">
1092 <title auto="1" refid="toc-entry-18">
1093 <generated classes="sectnum">
1094 2.12   
1095 Citations
1096 <citation backrefs="citation-reference-1 citation-reference-2" ids="cit2002" names="cit2002">
1097 <label>
1098 CIT2002
1099 <paragraph>
1100 Citations are text-labeled footnotes. They may be
1101 rendered separately and differently from footnotes.
1102 <paragraph>
1103 Here's a reference to the above,
1104 <citation_reference ids="citation-reference-2" refid="cit2002">
1105 CIT2002
1106 , and a
1107 <problematic ids="citation-reference-3" refid="system-message-3">
1108 [nonexistent]_
1109
1110 citation.
1111 <target refid="another-target">
1112 <section ids="targets another-target" names="targets another\ target">
1113 <title auto="1" refid="toc-entry-19">
1114 <generated classes="sectnum">
1115 2.13   
1116 Targets
1117 <target refid="example">
1118 <paragraph ids="example" names="example">
1119 This paragraph is pointed to by the explicit "example" target. A
1120 reference can be found under
1121 <reference name="Inline Markup" refid="inline-markup">
1122 Inline Markup
1123 , above.
1124 <reference name="Inline hyperlink targets" refid="inline-hyperlink-targets">
1125 Inline
1126 hyperlink targets
1127 are also possible.
1128 <paragraph>
1129 Section headers are implicit targets, referred to by name. See
1130 <reference name="Targets" refid="targets">
1131 Targets
1132 , which is a subsection of
1133 <reference name="Body Elements" refid="body-elements">
1134 Body Elements
1135 .
1136 <paragraph>
1137 Explicit external targets are interpolated into references such as
1138 "
1139 <reference name="Python" refuri="http://www.python.org/">
1140 Python
1141
1142 <footnote_reference auto="1" ids="footnote-reference-11" refid="footnote-6">
1143 5
1144 ".
1145 <target ids="python" names="python" refuri="http://www.python.org/">
1146 <paragraph>
1147 Targets may be indirect and anonymous. Thus
1148 <reference anonymous="1" name="this phrase" refid="targets">
1149 this phrase
1150 may also
1151 refer to the
1152 <reference name="Targets" refid="targets">
1153 Targets
1154 section.
1155 <target anonymous="1" ids="target-4" refid="targets">
1156 <paragraph>
1157 Here's a
1158 <problematic ids="problematic-2" refid="system-message-4">
1159 `hyperlink reference without a target`_
1160 , which generates an
1161 error.
1162 <section dupnames="duplicate\ target\ names" ids="duplicate-target-names-1">
1163 <title auto="1" refid="toc-entry-20">
1164 <generated classes="sectnum">
1165 2.13.1   
1166 Duplicate Target Names
1167 <paragraph>
1168 Duplicate names in section headers or other implicit targets will
1169 generate "info" (level-1) system messages. Duplicate names in
1170 explicit targets will generate "warning" (level-2) system messages.
1171 <section dupnames="duplicate\ target\ names" ids="duplicate-target-names-2">
1172 <title auto="1" refid="toc-entry-21">
1173 <generated classes="sectnum">
1174 2.13.2   
1175 Duplicate Target Names
1176 <system_message backrefs="duplicate-target-names-2" level="1" line="437" source="functional/input/data/standard.rst" type="INFO">
1177 <paragraph>
1178 Duplicate implicit target name: "duplicate target names".
1179 <paragraph>
1180 Since there are two "Duplicate Target Names" section headers, we
1181 cannot uniquely refer to either of them by name. If we try to (like
1182 this:
1183 <problematic ids="problematic-3" refid="system-message-5">
1184 `Duplicate Target Names`_
1185 ), an error is generated.
1186 <section ids="directives" names="directives">
1187 <title auto="1" refid="toc-entry-22">
1188 <generated classes="sectnum">
1189 2.14   
1190 Directives
1191 <topic classes="contents local" ids="contents" names="contents">
1192 <bullet_list classes="auto-toc">
1193 <list_item>
1194 <paragraph>
1195 <reference ids="toc-entry-43" refid="document-parts">
1196 <generated classes="sectnum">
1197 2.14.1   
1198 Document Parts
1199 <list_item>
1200 <paragraph>
1201 <reference ids="toc-entry-44" refid="images-and-figures">
1202 <generated classes="sectnum">
1203 2.14.2   
1204 Images and Figures
1205 <list_item>
1206 <paragraph>
1207 <reference ids="toc-entry-45" refid="tables">
1208 <generated classes="sectnum">
1209 2.14.3   
1210 Tables
1211 <list_item>
1212 <paragraph>
1213 <reference ids="toc-entry-46" refid="admonitions">
1214 <generated classes="sectnum">
1215 2.14.4   
1216 Admonitions
1217 <list_item>
1218 <paragraph>
1219 <reference ids="toc-entry-47" refid="topics-sidebars-and-rubrics">
1220 <generated classes="sectnum">
1221 2.14.5   
1222 Topics, Sidebars, and Rubrics
1223 <list_item>
1224 <paragraph>
1225 <reference ids="toc-entry-48" refid="target-footnotes">
1226 <generated classes="sectnum">
1227 2.14.6   
1228 Target Footnotes
1229 <list_item>
1230 <paragraph>
1231 <reference ids="toc-entry-49" refid="replacement-text">
1232 <generated classes="sectnum">
1233 2.14.7   
1234 Replacement Text
1235 <list_item>
1236 <paragraph>
1237 <reference ids="toc-entry-50" refid="compound-paragraph">
1238 <generated classes="sectnum">
1239 2.14.8   
1240 Compound Paragraph
1241 <list_item>
1242 <paragraph>
1243 <reference ids="toc-entry-51" refid="parsed-literal-blocks">
1244 <generated classes="sectnum">
1245 2.14.9   
1246 Parsed Literal Blocks
1247 <list_item>
1248 <paragraph>
1249 <reference ids="toc-entry-52" refid="code">
1250 <generated classes="sectnum">
1251 2.14.10   
1252 Code
1253 <list_item>
1254 <paragraph>
1255 <reference ids="toc-entry-53" refid="meta">
1256 <generated classes="sectnum">
1257 2.14.11   
1258 Meta
1259 <paragraph>
1260 These are just a sample of the many reStructuredText Directives. For
1261 others, please see
1262 <reference anonymous="1" name="reStructuredText Directives" refuri="https://docutils.sourceforge.io/docs/ref/rst/directives.html">
1263 reStructuredText Directives
1264
1265 <footnote_reference auto="1" ids="footnote-reference-16" refid="footnote-9">
1266 8
1267 .
1268 <target anonymous="1" ids="target-5" refuri="https://docutils.sourceforge.io/docs/ref/rst/directives.html">
1269 <section ids="document-parts" names="document\ parts">
1270 <title auto="1" refid="toc-entry-43">
1271 <generated classes="sectnum">
1272 2.14.1   
1273 Document Parts
1274 <paragraph>
1275 An example of the "contents" directive can be seen above this section
1276 (a local, untitled table of
1277 <reference name="contents" refid="contents">
1278 contents
1279 ) and at the beginning of the
1280 document (a document-wide
1281 <reference name="table of contents" refid="table-of-contents">
1282 table of contents
1283 ).
1284 <section ids="images-and-figures" names="images\ and\ figures">
1285 <title auto="1" refid="toc-entry-44">
1286 <generated classes="sectnum">
1287 2.14.2   
1288 Images and Figures
1289 <paragraph>
1290 An image directive (also clickable -- a hyperlink reference):
1291 <reference name="directives" refid="directives">
1292 <image classes="class1 class2" uri="../../../docs/user/rst/images/title.png" width="70%">
1293 <paragraph>
1294 Image with multiple IDs:
1295 <target refid="image-target-1">
1296 <target refid="image-target-2">
1297 <target refid="image-target-3">
1298 <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/biohazard.png">
1299 <paragraph>
1300 A centered image:
1301 <image align="center" uri="../../../docs/user/rst/images/biohazard.png">
1302 <paragraph>
1303 A left-aligned image:
1304 <image align="left" uri="../../../docs/user/rst/images/biohazard.png">
1305 <paragraph>
1306 This paragraph might flow around the image.
1307 The specific behavior depends upon the style sheet and
1308 the browser or rendering software used.
1309 <paragraph>
1310 A right-aligned image:
1311 <image align="right" uri="../../../docs/user/rst/images/biohazard.png">
1312 <paragraph>
1313 This paragraph might flow around the image.
1314 The specific behavior depends upon the style sheet and
1315 the browser or rendering software used.
1316 <paragraph>
1317 For inline images see
1318 <reference name="Substitution Definitions" refid="substitution-definitions">
1319 Substitution Definitions
1320 .
1321 <paragraph>
1322 Image size:
1323 <paragraph>
1324 An image 2 em wide:
1325 <image uri="../../../docs/user/rst/images/biohazard.png" width="2em">
1326 <paragraph>
1327 An image 2 cm wide and 15 pixel high:
1328 <image height="15px" uri="../../../docs/user/rst/images/biohazard.png" width="2cm">
1329 <paragraph>
1330 Relative units allow adaption of the image to the screen or paper size.
1331 An image occupying 50% of the line width:
1332 <image uri="../../../docs/user/rst/images/title.png" width="50%">
1333 <paragraph>
1334 A
1335 <emphasis>
1336 figure
1337 is an image with a caption and/or a legend. With page-based output
1338 media, figures might float to a different position if this helps the page
1339 layout.
1340 <figure classes="figclass1 figclass2">
1341 <reference refuri="https://docutils.sourceforge.io/rst.html">
1342 <image alt="reStructuredText, the markup syntax" classes="class1 class2" uri="../../../docs/user/rst/images/title.png" width="258">
1343 <caption>
1344 Plaintext markup syntax and parser system.
1345 <legend>
1346 <table>
1347 <tgroup cols="2">
1348 <colspec colwidth="12">
1349 <colspec colwidth="47">
1350 <tbody>
1351 <row>
1352 <entry>
1353 <paragraph>
1354 re
1355 <entry>
1356 <paragraph>
1357 Revised, revisited, based on 're' module.
1358 <row>
1359 <entry>
1360 <paragraph>
1361 Structured
1362 <entry>
1363 <paragraph>
1364 Structure-enhanced text, structuredtext.
1365 <row>
1366 <entry>
1367 <paragraph>
1368 Text
1369 <entry>
1370 <paragraph>
1371 Well it is, isn't it?
1372 <paragraph>
1373 This paragraph is also part of the legend.
1374 <paragraph>
1375 A left-aligned figure, 70% wide:
1376 <figure align="left" classes="figclass1 figclass2" width="70%">
1377 <image alt="reStructuredText, the markup syntax" classes="class1 class2" uri="../../../docs/user/rst/images/biohazard.png" width="40px">
1378 <caption classes="captionclass1 captionclass2" ids="caption-label" names="caption-label">
1379 This is the caption.
1380 <legend>
1381 <paragraph>
1382 This is the legend.
1383 <paragraph>
1384 The legend may consist of several paragraphs.
1385 <paragraph>
1386 This paragraph might flow around the figure.
1387 <paragraph>
1388 The specific behavior depends upon the style sheet and the browser or
1389 rendering software used.
1390 <paragraph>
1391 A centred figure, 40% wide:
1392 <figure align="center" width="40%">
1393 <image uri="../../../docs/user/rst/images/biohazard.png" width="40px">
1394 <caption>
1395 This is the caption.
1396 <legend>
1397 <paragraph>
1398 This is the legend.
1399 <paragraph>
1400 The legend may consist of several paragraphs.
1401 <paragraph>
1402 This paragraph might flow around the figure.
1403 <paragraph>
1404 The specific behavior depends upon the style sheet and the browser or
1405 rendering software used.
1406 <paragraph>
1407 A right-aligned figure:
1408 <figure align="right">
1409 <image uri="../../../docs/user/rst/images/biohazard.png" width="40px">
1410 <caption>
1411 This is the caption.
1412 <legend>
1413 <paragraph>
1414 This is the legend.
1415 <paragraph>
1416 The legend may consist of several paragraphs.
1417 <paragraph>
1418 This paragraph might flow around the figure. The specific behavior depends
1419 upon the style sheet and the browser or rendering software used.
1420 <section ids="tables" names="tables">
1421 <title auto="1" refid="toc-entry-45">
1422 <generated classes="sectnum">
1423 2.14.3   
1424 Tables
1425 <paragraph>
1426 Tables may be given titles and additional arguments with the
1427 <emphasis>
1428 table
1429
1430 directive:
1431 <table align="left">
1432 <title>
1433 left-aligned table
1434 <tgroup cols="2">
1435 <colspec colwidth="5">
1436 <colspec colwidth="5">
1437 <thead>
1438 <row>
1439 <entry>
1440 <paragraph>
1441 A
1442 <entry>
1443 <paragraph>
1444 not A
1445 <tbody>
1446 <row>
1447 <entry>
1448 <paragraph>
1449 False
1450 <entry>
1451 <paragraph>
1452 True
1453 <row>
1454 <entry>
1455 <paragraph>
1456 True
1457 <entry>
1458 <paragraph>
1459 False
1460 <table align="center">
1461 <title>
1462 center-aligned table
1463 <tgroup cols="2">
1464 <colspec colwidth="5">
1465 <colspec colwidth="5">
1466 <thead>
1467 <row>
1468 <entry>
1469 <paragraph>
1470 A
1471 <entry>
1472 <paragraph>
1473 not A
1474 <tbody>
1475 <row>
1476 <entry>
1477 <paragraph>
1478 False
1479 <entry>
1480 <paragraph>
1481 True
1482 <row>
1483 <entry>
1484 <paragraph>
1485 True
1486 <entry>
1487 <paragraph>
1488 False
1489 <table align="right">
1490 <title>
1491 right-aligned table
1492 <tgroup cols="2">
1493 <colspec colwidth="5">
1494 <colspec colwidth="5">
1495 <thead>
1496 <row>
1497 <entry>
1498 <paragraph>
1499 A
1500 <entry>
1501 <paragraph>
1502 not A
1503 <tbody>
1504 <row>
1505 <entry>
1506 <paragraph>
1507 False
1508 <entry>
1509 <paragraph>
1510 True
1511 <row>
1512 <entry>
1513 <paragraph>
1514 True
1515 <entry>
1516 <paragraph>
1517 False
1518 <paragraph>
1519 With the "widths" argument "auto" (or "class" value "colwidths-auto"),
1520 column widths are determined by the backend (if supported by the
1521 writer/backend).
1522 <target refid="target1">
1523 <target refid="target2">
1524 <table classes="colwidths-auto" ids="target2 target1" names="target2 target1">
1525 <tgroup cols="3">
1526 <colspec colwidth="7">
1527 <colspec colwidth="7">
1528 <colspec colwidth="10">
1529 <thead>
1530 <row>
1531 <entry>
1532 <paragraph>
1533 A
1534 <entry>
1535 <paragraph>
1536 B
1537 <entry>
1538 <paragraph>
1539 A or B
1540 <tbody>
1541 <row>
1542 <entry>
1543 <paragraph>
1544 False
1545 <entry>
1546 <paragraph>
1547 False
1548 <entry>
1549 <paragraph>
1550 False
1551 <row>
1552 <entry>
1553 <paragraph>
1554 True
1555 <entry>
1556 <paragraph>
1557 False
1558 <entry>
1559 <paragraph>
1560 True
1561 <row>
1562 <entry>
1563 <paragraph>
1564 False
1565 <entry>
1566 <paragraph>
1567 True
1568 <entry>
1569 <paragraph>
1570 True
1571 <row>
1572 <entry>
1573 <paragraph>
1574 True
1575 <entry>
1576 <paragraph>
1577 True
1578 <entry>
1579 <paragraph>
1580 True
1581 <section ids="admonitions" names="admonitions">
1582 <title auto="1" refid="toc-entry-46">
1583 <generated classes="sectnum">
1584 2.14.4   
1585 Admonitions
1586 <attention>
1587 <paragraph>
1588 Directives at large.
1589 <caution>
1590 <paragraph>
1591 Don't take any wooden nickels.
1592 <danger>
1593 <paragraph>
1594 Mad scientist at work!
1595 <error>
1596 <paragraph>
1597 Does not compute.
1598 <hint>
1599 <paragraph>
1600 It's bigger than a bread box.
1601 <important>
1602 <bullet_list bullet="-">
1603 <list_item>
1604 <paragraph>
1605 Wash behind your ears.
1606 <list_item>
1607 <paragraph>
1608 Clean up your room.
1609 <list_item>
1610 <paragraph>
1611 Call your mother.
1612 <list_item>
1613 <paragraph>
1614 Back up your data.
1615 <note>
1616 <paragraph>
1617 This is a note.
1618 <tip>
1619 <paragraph>
1620 15% if the service is good.
1621 <warning>
1622 <paragraph>
1623 Strong prose may provoke extreme mental exertion.
1624 Reader discretion is strongly advised.
1625 <admonition classes="admonition-and-by-the-way">
1626 <title>
1627 And, by the way...
1628 <paragraph>
1629 You can make up your own admonition too.
1630 <target ids="docutils" names="docutils" refuri="https://docutils.sourceforge.io/">
1631 <section ids="topics-sidebars-and-rubrics" names="topics,\ sidebars,\ and\ rubrics">
1632 <title auto="1" refid="toc-entry-47">
1633 <generated classes="sectnum">
1634 2.14.5   
1635 Topics, Sidebars, and Rubrics
1636 <paragraph>
1637 <emphasis>
1638 Sidebars
1639 are like miniature, parallel documents.
1640 <sidebar>
1641 <title>
1642 Optional Sidebar Title
1643 <subtitle>
1644 Optional Subtitle
1645 <paragraph>
1646 This is a sidebar. It is for text outside the flow of the main
1647 text.
1648 <rubric>
1649 This is a rubric inside a sidebar
1650 <paragraph>
1651 Sidebars often appear beside the main text with a border and a different
1652 background or font color.
1653 <paragraph>
1654 A
1655 <emphasis>
1656 topic
1657 is like a block quote with a title, or a self-contained section
1658 with no subsections.
1659 <topic>
1660 <title>
1661 Topic Title
1662 <paragraph>
1663 This is a topic.
1664 <paragraph>
1665 A
1666 <emphasis>
1667 rubric
1668 is like an informal heading that doesn't correspond to the
1669 document's structure. It is typically highlighted in red (hence the name).
1670 <rubric>
1671 This is a rubric
1672 <paragraph>
1673 Topics and rubrics can be used at places where a
1674 <reference name="section title" refid="section-title">
1675 section title
1676 is not
1677 allowed (e.g. inside a directive).
1678 <section ids="target-footnotes" names="target\ footnotes">
1679 <title auto="1" refid="toc-entry-48">
1680 <generated classes="sectnum">
1681 2.14.6   
1682 Target Footnotes
1683 <footnote auto="1" backrefs="footnote-reference-10 footnote-reference-11 footnote-reference-12 footnote-reference-14" ids="footnote-6" names="TARGET_NOTE:\ footnote-6">
1684 <label>
1685 5
1686 <paragraph>
1687 <reference refuri="http://www.python.org/">
1688 http://www.python.org/
1689 <footnote auto="1" backrefs="footnote-reference-13" ids="footnote-7" names="TARGET_NOTE:\ footnote-7">
1690 <label>
1691 6
1692 <paragraph>
1693 <reference refuri="http://pygments.org/">
1694 http://pygments.org/
1695 <footnote auto="1" backrefs="footnote-reference-15" ids="footnote-8" names="TARGET_NOTE:\ footnote-8">
1696 <label>
1697 7
1698 <paragraph>
1699 <reference refuri="https://docutils.sourceforge.io/">
1700 https://docutils.sourceforge.io/
1701 <footnote auto="1" backrefs="footnote-reference-16" ids="footnote-9" names="TARGET_NOTE:\ footnote-9">
1702 <label>
1703 8
1704 <paragraph>
1705 <reference refuri="https://docutils.sourceforge.io/docs/ref/rst/directives.html">
1706 https://docutils.sourceforge.io/docs/ref/rst/directives.html
1707 <footnote auto="1" backrefs="footnote-reference-17" ids="footnote-10" names="TARGET_NOTE:\ footnote-10">
1708 <label>
1709 9
1710 <paragraph>
1711 <reference refuri="https://docutils.sourceforge.io/docs/ref/rst/directives.html#metadata">
1712 https://docutils.sourceforge.io/docs/ref/rst/directives.html#metadata
1713 <section ids="replacement-text" names="replacement\ text">
1714 <title auto="1" refid="toc-entry-49">
1715 <generated classes="sectnum">
1716 2.14.7   
1717 Replacement Text
1718 <paragraph>
1719 I recommend you try
1720 <reference refuri="http://www.python.org/">
1721 Python,
1722 <emphasis>
1723 the
1724 best language around
1725
1726 <footnote_reference auto="1" ids="footnote-reference-12" refid="footnote-6">
1727 5
1728 .
1729 <substitution_definition names="Python">
1730 Python,
1731 <emphasis>
1732 the
1733 best language around
1734 <section ids="compound-paragraph" names="compound\ paragraph">
1735 <title auto="1" refid="toc-entry-50">
1736 <generated classes="sectnum">
1737 2.14.8   
1738 Compound Paragraph
1739 <paragraph>
1740 The
1741 <emphasis>
1742 compound
1743 directive is used to create a "compound paragraph", which
1744 is a single logical paragraph containing multiple physical body
1745 elements. For example:
1746 <compound>
1747 <paragraph>
1748 The 'rm' command is very dangerous. If you are logged
1749 in as root and enter
1750 <literal_block xml:space="preserve">
1751 cd /
1752 rm -rf *
1753 <paragraph>
1754 you will erase the entire contents of your file system.
1755 <paragraph>
1756 Test the handling and display of compound paragraphs:
1757 <compound classes="some-class">
1758 <paragraph>
1759 Compound 2, paragraph 1,
1760 <paragraph>
1761 compound 2, paragraph 2,
1762 <bullet_list bullet="*">
1763 <list_item>
1764 <paragraph>
1765 list item 1,
1766 <list_item>
1767 <paragraph>
1768 list item 2,
1769 <paragraph>
1770 compound 2, paragraph 3.
1771 <compound>
1772 <paragraph>
1773 Compound 3, only consisting of one paragraph.
1774 <compound>
1775 <literal_block xml:space="preserve">
1776 Compound 4.
1777 This one starts with a literal block.
1778 <paragraph>
1779 Compound 4, paragraph following the literal block.
1780 <paragraph>
1781 Now something
1782 <emphasis>
1783 really
1784 perverted -- a nested compound block. This is
1785 just to test that it works at all; the results don't have to be
1786 meaningful.
1787 <compound>
1788 <paragraph>
1789 Compound 5, block 1 (a paragraph).
1790 <compound>
1791 <paragraph>
1792 Compound 6 is block 2 in compound 5.
1793 <paragraph>
1794 Compound 6, another paragraph.
1795 <paragraph>
1796 Compound 5, block 3 (a paragraph).
1797 <compound>
1798 <paragraph>
1799 Compound 7, tests the inclusion of various block-level
1800 elements in one logical paragraph. First a table,
1801 <table>
1802 <tgroup cols="3">
1803 <colspec colwidth="20">
1804 <colspec colwidth="20">
1805 <colspec colwidth="20">
1806 <tbody>
1807 <row>
1808 <entry>
1809 <paragraph>
1810 Left cell, first
1811 paragraph.
1812 <paragraph>
1813 Left cell, second
1814 paragraph.
1815 <entry>
1816 <paragraph>
1817 Middle cell,
1818 consisting of
1819 exactly one
1820 paragraph.
1821 <entry>
1822 <paragraph>
1823 Right cell.
1824 <paragraph>
1825 Paragraph 2.
1826 <paragraph>
1827 Paragraph 3.
1828 <paragraph>
1829 followed by a paragraph. This physical paragraph is
1830 actually a continuation of the paragraph before the table. It is followed
1831 by
1832 <block_quote>
1833 <paragraph>
1834 a quote and
1835 <enumerated_list enumtype="arabic" prefix="" suffix=".">
1836 <list_item>
1837 <paragraph>
1838 an enumerated list,
1839 <paragraph>
1840 a paragraph,
1841 <option_list>
1842 <option_list_item>
1843 <option_group>
1844 <option>
1845 <option_string>
1846 --an
1847 <description>
1848 <paragraph>
1849 option list,
1850 <paragraph>
1851 a paragraph,
1852 <field_list>
1853 <field>
1854 <field_name>
1855 a field
1856 <field_body>
1857 <paragraph>
1858 list,
1859 <paragraph>
1860 a paragraph,
1861 <definition_list>
1862 <definition_list_item>
1863 <term>
1864 a definition
1865 <definition>
1866 <paragraph>
1867 list,
1868 <paragraph>
1869 a paragraph, an image:
1870 <image uri="../../../docs/user/rst/images/biohazard.png">
1871 <paragraph>
1872 a paragraph,
1873 <line_block>
1874 <line>
1875 a line
1876 <line>
1877 block,
1878 <paragraph>
1879 a paragraph followed by a comment,
1880 <comment xml:space="preserve">
1881 this is a comment
1882 <paragraph>
1883 a paragraph, a
1884 <note>
1885 <paragraph>
1886 with content
1887 <paragraph>
1888 and the final paragraph of the compound 7.
1889 <section ids="parsed-literal-blocks" names="parsed\ literal\ blocks">
1890 <title auto="1" refid="toc-entry-51">
1891 <generated classes="sectnum">
1892 2.14.9   
1893 Parsed Literal Blocks
1894 <literal_block xml:space="preserve">
1895 This is a parsed literal block.
1896 This line is indented. The next line is blank.
1897
1898 Inline markup is supported, e.g.
1899 <emphasis>
1900 emphasis
1901 ,
1902 <strong>
1903 strong
1904 ,
1905 <literal>
1906 literal
1907 text
1908 ,
1909 <subscript>
1910 sub-
1911 and
1912 <superscript>
1913 super
1914 scripts,
1915 inline formulas:
1916 <math>
1917 A = 2 \pi r^2
1918 ,
1919 footnotes
1920 <footnote_reference ids="footnote-reference-9" refid="footnote-1">
1921 1
1922 ,
1923 <target ids="hyperlink-targets" names="hyperlink\ targets">
1924 hyperlink targets
1925 , and
1926 <reference name="references" refuri="http://www.python.org/">
1927 references
1928 <target names="references" refuri="http://www.python.org/">
1929 .
1930 <section ids="code" names="code">
1931 <title auto="1" refid="toc-entry-52">
1932 <generated classes="sectnum">
1933 2.14.10   
1934 Code
1935 <paragraph>
1936 Blocks of source code can be set with the
1937 <title_reference>
1938 code
1939 directive. If the code
1940 language is specified, the content is parsed and tagged by the
1941 <reference name="Pygments" refuri="http://pygments.org/">
1942 Pygments
1943
1944 <footnote_reference auto="1" ids="footnote-reference-13" refid="footnote-7">
1945 6
1946
1947 syntax highlighter and can be formatted with a style sheet. (Code parsing
1948 is turned off using the
1949 <literal>
1950 syntax-highlight
1951 config setting in the test
1952 conversions in order to get identical results with/without installed
1953 Pygments highlighter.)
1954 <literal_block classes="code python" xml:space="preserve">
1955 print 'This is Python code.'
1956 <paragraph>
1957 The
1958 <literal>
1959 :number-lines:
1960 option (with optional start value) generates line
1961 numbers:
1962 <literal_block classes="code python" xml:space="preserve">
1963 <inline classes="ln">
1964 8
1965 # print integers from 0 to 9:
1966 <inline classes="ln">
1967 9
1968 for i in range(10):
1969 <inline classes="ln">
1970 10
1971 print i
1972 <paragraph>
1973 For inline code snippets, there is the
1974 <title_reference>
1975 code
1976 role, which can be used
1977 directly (the code will not be parsed/tagged, as the language is not known)
1978 or as base for special code roles, e.g. the LaTeX code in the next
1979 paragraph.
1980 <paragraph>
1981 Docutils uses LaTeX syntax for math directives and roles:
1982 <literal classes="code tex">
1983 \alpha = f(x)
1984 prints
1985 <math>
1986 \alpha = f(x)
1987 .
1988 <paragraph>
1989 The
1990 <literal>
1991 :code:
1992 option of the
1993 <title_reference>
1994 include
1995 directive sets the included content
1996 as a code block, here the rst file
1997 <literal>
1998 header_footer.rst
1999 with line numbers:
2000 <literal_block classes="code rst" source="functional/input/data/header_footer.rst" xml:space="preserve">
2001 <inline classes="ln">
2002 1
2003 .. header:: Document header
2004 <inline classes="ln">
2005 2
2006 .. footer:: Document footer
2007 <target ids="pygments" names="pygments" refuri="http://pygments.org/">
2008 <section ids="meta" names="meta">
2009 <title auto="1" refid="toc-entry-53">
2010 <generated classes="sectnum">
2011 2.14.11   
2012 Meta
2013 <paragraph>
2014 The
2015 <reference anonymous="1" name="“meta” directive" refuri="https://docutils.sourceforge.io/docs/ref/rst/directives.html#metadata">
2016 “meta” directive
2017
2018 <footnote_reference auto="1" ids="footnote-reference-17" refid="footnote-10">
2019 9
2020 is used to specify metadata to be stored in,
2021 e.g., HTML META tags or ODT file properties.
2022 <target anonymous="1" ids="target-6" refuri="https://docutils.sourceforge.io/docs/ref/rst/directives.html#metadata">
2023 <section ids="substitution-definitions" names="substitution\ definitions">
2024 <title auto="1" refid="toc-entry-34">
2025 <generated classes="sectnum">
2026 2.15   
2027 Substitution Definitions
2028 <paragraph>
2029 An inline image (
2030 <image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png">
2031 ) example:
2032 <substitution_definition names="EXAMPLE">
2033 <image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png">
2034 <paragraph>
2035 A Unicode example:
2036 <substitution_definition ltrim="1" names="heart" rtrim="1">
2037 ♥
2038 <paragraph>
2039 (Substitution definitions are only visible in the rST source.)
2040 <section ids="comments" names="comments">
2041 <title auto="1" refid="toc-entry-35">
2042 <generated classes="sectnum">
2043 2.16   
2044 Comments
2045 <paragraph>
2046 Here's one:
2047 <comment xml:space="preserve">
2048 Comments begin with two dots and a space. Anything may
2049 follow, except for the syntax of footnotes, hyperlink
2050 targets, directives, or substitution definitions.
2051
2052 Double-dashes -- "--" -- must be escaped somehow in HTML output.
2053
2054 Comments may contain non-ASCII characters: ä ö ü æ ø å
2055 <paragraph>
2056 (View the HTML/LaTeX/... source to see the comment.)
2057 <section ids="raw-text" names="raw\ text">
2058 <title auto="1" refid="toc-entry-36">
2059 <generated classes="sectnum">
2060 2.17   
2061 Raw text
2062 <paragraph>
2063 This does not necessarily look nice, because there may be missing white space.
2064 <paragraph>
2065 It's just there to freeze the behavior.
2066 <raw format="html latex" xml:space="preserve">
2067 A test.
2068 <raw format="html latex" xml:space="preserve">
2069 Second test.
2070 <raw classes="myclass" format="html latex" xml:space="preserve">
2071 Another test with myclass set.
2072 <paragraph>
2073 This is the
2074 <raw classes="myrawroleclass" format="html latex" xml:space="preserve">
2075 fourth test
2076 with myrawroleclass set.
2077 <raw format="html" xml:space="preserve">
2078 Fifth test in HTML.<br />Line two.
2079 <raw format="latex" xml:space="preserve">
2080 Fifth test in LaTeX.\\Line two.
2081 <section ids="container" names="container">
2082 <title auto="1" refid="toc-entry-37">
2083 <generated classes="sectnum">
2084 2.18   
2085 Container
2086 <container classes="custom">
2087 <paragraph>
2088 paragraph 1
2089 <paragraph>
2090 paragraph 2
2091 <section ids="colspanning-tables" names="colspanning\ tables">
2092 <title auto="1" refid="toc-entry-38">
2093 <generated classes="sectnum">
2094 2.19   
2095 Colspanning tables
2096 <paragraph>
2097 This table has a cell spanning two columns:
2098 <table>
2099 <tgroup cols="3">
2100 <colspec colwidth="5">
2101 <colspec colwidth="5">
2102 <colspec colwidth="6">
2103 <thead>
2104 <row>
2105 <entry morecols="1">
2106 <paragraph>
2107 Inputs
2108 <entry>
2109 <paragraph>
2110 Output
2111 <row>
2112 <entry>
2113 <paragraph>
2114 A
2115 <entry>
2116 <paragraph>
2117 B
2118 <entry>
2119 <paragraph>
2120 A or B
2121 <tbody>
2122 <row>
2123 <entry>
2124 <paragraph>
2125 False
2126 <entry>
2127 <paragraph>
2128 False
2129 <entry>
2130 <paragraph>
2131 False
2132 <row>
2133 <entry>
2134 <paragraph>
2135 True
2136 <entry>
2137 <paragraph>
2138 False
2139 <entry>
2140 <paragraph>
2141 True
2142 <row>
2143 <entry>
2144 <paragraph>
2145 False
2146 <entry>
2147 <paragraph>
2148 True
2149 <entry>
2150 <paragraph>
2151 True
2152 <row>
2153 <entry>
2154 <paragraph>
2155 True
2156 <entry>
2157 <paragraph>
2158 True
2159 <entry>
2160 <paragraph>
2161 True
2162 <section ids="rowspanning-tables" names="rowspanning\ tables">
2163 <title auto="1" refid="toc-entry-39">
2164 <generated classes="sectnum">
2165 2.20   
2166 Rowspanning tables
2167 <paragraph>
2168 Here's a table with cells spanning several rows:
2169 <table>
2170 <tgroup cols="3">
2171 <colspec colwidth="24">
2172 <colspec colwidth="12">
2173 <colspec colwidth="18">
2174 <thead>
2175 <row>
2176 <entry>
2177 <paragraph>
2178 Header row, column 1
2179 (header rows optional)
2180 <entry>
2181 <paragraph>
2182 Header 2
2183 <entry>
2184 <paragraph>
2185 Header 3
2186 <tbody>
2187 <row>
2188 <entry>
2189 <paragraph>
2190 body row 1, column 1
2191 <entry>
2192 <paragraph>
2193 column 2
2194 <entry>
2195 <paragraph>
2196 column 3
2197 <row>
2198 <entry>
2199 <paragraph>
2200 body row 2
2201 <entry morerows="1">
2202 <paragraph>
2203 Cells may
2204 span rows.
2205 <entry morerows="1">
2206 <paragraph>
2207 Another
2208 rowspanning
2209 cell.
2210 <row>
2211 <entry>
2212 <paragraph>
2213 body row 3
2214 <section ids="complex-tables" names="complex\ tables">
2215 <title auto="1" refid="toc-entry-40">
2216 <generated classes="sectnum">
2217 2.21   
2218 Complex tables
2219 <paragraph>
2220 Here's a complex table, which should test all features.
2221 <table>
2222 <tgroup cols="4">
2223 <colspec colwidth="24">
2224 <colspec colwidth="12">
2225 <colspec colwidth="10">
2226 <colspec colwidth="10">
2227 <thead>
2228 <row>
2229 <entry>
2230 <paragraph>
2231 Header row, column 1
2232 (header rows optional)
2233 <entry>
2234 <paragraph>
2235 Header 2
2236 <entry>
2237 <paragraph>
2238 Header 3
2239 <entry>
2240 <paragraph>
2241 Header 4
2242 <tbody>
2243 <row>
2244 <entry>
2245 <paragraph>
2246 body row 1, column 1
2247 <entry>
2248 <paragraph>
2249 column 2
2250 <entry>
2251 <paragraph>
2252 column 3
2253 <entry>
2254 <paragraph>
2255 column 4
2256 <row>
2257 <entry>
2258 <paragraph>
2259 body row 2
2260 <entry morecols="2">
2261 <paragraph>
2262 Cells may span columns.
2263 <row>
2264 <entry>
2265 <paragraph>
2266 body row 3
2267 <entry morerows="1">
2268 <paragraph>
2269 Cells may
2270 span rows.
2271 <paragraph>
2272 Paragraph.
2273 <entry morecols="1" morerows="1">
2274 <bullet_list bullet="-">
2275 <list_item>
2276 <paragraph>
2277 Table cells
2278 <list_item>
2279 <paragraph>
2280 contain
2281 <list_item>
2282 <paragraph>
2283 body elements.
2284 <row>
2285 <entry>
2286 <paragraph>
2287 body row 4
2288 <row>
2289 <entry>
2290 <paragraph>
2291 body row 5
2292 <entry morecols="1">
2293 <paragraph>
2294 Cells may also be
2295 empty:
2296 <literal>
2297 -->
2298 <entry>
2299 <section ids="list-tables" names="list\ tables">
2300 <title auto="1" refid="toc-entry-41">
2301 <generated classes="sectnum">
2302 2.22   
2303 List Tables
2304 <paragraph>
2305 Here's a list table exercising all features:
2306 <table classes="colwidths-given test" width="95%">
2307 <title>
2308 list table with integral header
2309 <tgroup cols="3">
2310 <colspec colwidth="10" stub="1">
2311 <colspec colwidth="8">
2312 <colspec colwidth="20">
2313 <thead>
2314 <row>
2315 <entry>
2316 <paragraph>
2317 Treat
2318 <entry>
2319 <paragraph>
2320 Quantity
2321 <entry>
2322 <paragraph>
2323 Description
2324 <tbody>
2325 <row>
2326 <entry>
2327 <paragraph>
2328 Albatross
2329 <entry>
2330 <paragraph>
2331 2.99
2332 <entry>
2333 <paragraph>
2334 On a stick!
2335 <row>
2336 <entry>
2337 <paragraph>
2338 Crunchy Frog
2339 <entry>
2340 <paragraph>
2341 1.49
2342 <entry>
2343 <paragraph>
2344 If we took the bones out, it wouldn't be
2345 crunchy, now would it?
2346 <row>
2347 <entry>
2348 <paragraph>
2349 Gannet Ripple
2350 <entry>
2351 <paragraph>
2352 1.99
2353 <entry>
2354 <paragraph>
2355 On a stick!
2356 <table align="center" classes="colwidths-auto">
2357 <title>
2358 center aligned list table
2359 <tgroup cols="2">
2360 <colspec colwidth="50">
2361 <colspec colwidth="50">
2362 <tbody>
2363 <row>
2364 <entry>
2365 <paragraph>
2366 Albatross
2367 <entry>
2368 <paragraph>
2369 2.99
2370 <row>
2371 <entry>
2372 <paragraph>
2373 Crunchy Frog
2374 <entry>
2375 <paragraph>
2376 1.49
2377 <row>
2378 <entry>
2379 <paragraph>
2380 Gannet Ripple
2381 <entry>
2382 <paragraph>
2383 1.99
2384 <section ids="error-handling" names="error\ handling">
2385 <title auto="1" refid="toc-entry-42">
2386 <generated classes="sectnum">
2387 3   
2388 Error Handling
2389 <paragraph>
2390 Any errors caught during processing will generate system messages.
2391 <paragraph>
2392 There should be five messages in the following, auto-generated
2393 section, "Docutils System Messages":
2394 <comment xml:space="preserve">
2395 section should be added by Docutils automatically
2396 <section classes="system-messages">
2397 <title>
2398 Docutils System Messages
2399 <system_message backrefs="problematic-1" ids="system-message-1" level="3" line="99" source="functional/input/data/standard.rst" type="ERROR">
2400 <paragraph>
2401 Undefined substitution referenced: "problematic".
2402 <system_message backrefs="footnote-reference-8" ids="system-message-2" level="3" line="390" source="functional/input/data/standard.rst" type="ERROR">
2403 <paragraph>
2404 Unknown target name: "5".
2405 <system_message backrefs="citation-reference-3" ids="system-message-3" level="3" line="399" source="functional/input/data/standard.rst" type="ERROR">
2406 <paragraph>
2407 Unknown target name: "nonexistent".
2408 <system_message backrefs="problematic-2" ids="system-message-4" level="3" line="426" source="functional/input/data/standard.rst" type="ERROR">
2409 <paragraph>
2410 Unknown target name: "hyperlink reference without a target".
2411 <system_message backrefs="problematic-3" ids="system-message-5" level="3" line="439" source="functional/input/data/standard.rst" type="ERROR">
2412 <paragraph>
2413 Duplicate target name, cannot be used as a unique reference: "duplicate target names".
2414 <system_message level="1" line="159" source="functional/input/data/standard.rst" type="INFO">
2415 <paragraph>
2416 Hyperlink target "target" is not referenced.
2417 <system_message level="1" line="404" source="functional/input/data/standard.rst" type="INFO">
2418 <paragraph>
2419 Hyperlink target "another-target" is not referenced.
2420 <system_message level="1" line="474" source="functional/input/data/standard.rst" type="INFO">
2421 <paragraph>
2422 Hyperlink target "image-target-1" is not referenced.
2423 <system_message level="1" line="475" source="functional/input/data/standard.rst" type="INFO">
2424 <paragraph>
2425 Hyperlink target "image-target-2" is not referenced.
2426 <system_message level="1" line="476" source="functional/input/data/standard.rst" type="INFO">
2427 <paragraph>
2428 Hyperlink target "image-target-3" is not referenced.
2429 <system_message level="1" line="644" source="functional/input/data/standard.rst" type="INFO">
2430 <paragraph>
2431 Hyperlink target "target1" is not referenced.
2432 <system_message level="1" line="645" source="functional/input/data/standard.rst" type="INFO">
2433 <paragraph>
2434 Hyperlink target "target2" is not referenced.
2435 <system_message level="1" line="690" source="functional/input/data/standard.rst" type="INFO">
2436 <paragraph>
2437 Hyperlink target "docutils" is not referenced.
2438 <system_message level="1" line="856" source="functional/input/data/standard.rst" type="INFO">
2439 <paragraph>
2440 Hyperlink target "hyperlink targets" is not referenced.