Starting with this version new functionality is mainly implemented in
[docutils/kirr.git] / sandbox / xml2rst / tests / synthetic / expected / standard_0_3_7.rst
blob955eb2de7f156c450d8e1367dc5115ffc5587a2b
1 .. section-numbering::
3 ==============================
4 reStructuredText Test Document
5 ==============================
7 -----------------------------
8 Examples of Syntax Constructs
9 -----------------------------
11 :author: David Goodger
12 :address: 123 Example Street
13           Example, EX  Canada
14           A1B 2C3
15 :contact: goodger@users.sourceforge.net
16 :authors: Me; Myself; I
17 :organization: humankind
18 :date: Now, or yesterday.  Or maybe even *before* yesterday.
19 :status: This is a "work in progress"
20 :revision: is managed by a version control system.
21 :version: 1
22 :copyright: This document has been placed in the public domain. You
23             may do with it as you wish. You may copy, modify,
24             redistribute, reattribute, sell, buy, rent, lease,
25             destroy, or improve it, quote it at length, excerpt,
26             incorporate, collate, fold, staple, or mutilate it, or do
27             anything else to it that your or anyone else's heart
28             desires.
29 :field name: This is a "generic bibliographic field".
31 :field name "2": Generic bibliographic fields may contain multiple body elements.
33     Like this.
37 :Dedication: 
39    For Docutils users & co-developers.
41 :Abstract: 
43    This is a test document, containing at least one example of each
44    reStructuredText construct.
46 .. This is a comment. Note how any initial comments are moved by
47    transforms to after the document title, subtitle, and docinfo.
49 .. _doctitle:
51 .. Above is the document title, and below is the subtitle.
52    They are transformed from section titles after parsing.
54 .. _subtitle:
56 .. bibliographic fields (which also require a transform):
58 .. contents:: Table of Contents
61 Structural Elements
62 ===================
64 Section Title
65 -------------
67 That's it, the text just above this line.
69 Empty Section
70 -------------
72 Transitions
73 -----------
75 Here's a transition:
77 -----
79 It divides the section.  Transitions may also occur between sections:
81 -----
84 Body Elements
85 =============
87 Paragraphs
88 ----------
90 A paragraph.
92 Inline Markup
93 ~~~~~~~~~~~~~
95 Paragraphs contain text and may contain inline markup: *emphasis*,
96 **strong emphasis**, ``inline literals``, standalone hyperlinks
97 (http://www.python.org), external hyperlinks (Python_ ), internal
98 cross-references (example_), external hyperlinks with embedded URIs
99 (`Python web site <http://www.python.org>`__), footnote references
100 (manually numbered [1]_, anonymous auto-numbered [#]_, labeled
101 auto-numbered [#label]_, or symbolic [*]_), citation references
102 ([CIT2002]_), substitution references (|EXAMPLE|), and _`inline
103 hyperlink targets` (see Targets_ below for a reference back to here).
104 Character-level inline markup is also possible (although exceedingly
105 ugly!) in *re*\ ``Structured``\ *Text*.  Problems are indicated by
106 |problematic| text (generated by processing errors; this one is
107 intentional).  Here is a reference to the doctitle_ and the subtitle_.
109 The default role for interpreted text is `Title Reference`.  Here are
110 some explicit interpreted text roles: a PEP reference (:PEP:`287`); an
111 RFC reference (:RFC:`2822`); a :sub:`subscript`; a :sup:`superscript`;
112 and explicit roles for *standard* **inline**
113 ``markup``.
115 .. DO NOT RE-WRAP THE FOLLOWING PARAGRAPH!
117 Let's test wrapping and whitespace significance in inline literals:
118 ``This is an example of --inline-literal --text, --including some--
119 strangely--hyphenated-words.  Adjust-the-width-of-your-browser-window
120 to see how the text is wrapped.  -- ---- --------  Now note    the
121 spacing    between the    words of    this sentence    (words
122 should    be grouped    in pairs).``
124 If the ``--pep-references`` option was supplied, there should be a
125 live link to PEP 258 here.
127 Bullet Lists
128 ------------
130 - A bullet list
132   + Nested bullet list.
134   + Nested item 2.
136 - Item 2.
138   Paragraph 2 of item 2.
140   * Nested bullet list.
142   * Nested item 2.
144     - Third level.
146     - Item 2.
148   * Nested item 3.
150   * This nested list should be compacted by the HTML writer.
152     .. _target:
154     .. Even if this item contains a target and a comment.
156 Enumerated Lists
157 ----------------
159 1. Arabic numerals.
161    a) lower alpha)
163       (i) (lower roman)
165           A. upper alpha.
167              I) upper roman)
169 2. Lists that don't start at 1:
171    3. Three
173    4. Four
175    C. C
177    D. D
179    i. iii
181    i. iv
183 Definition Lists
184 ----------------
186 Term
187     Definition
189 Term : classifier
190     Definition paragraph 1.
192     Definition paragraph 2.
194 Term
195     Definition
197 Term : classifier one : classifier two
198     Definition
200 Field Lists
201 -----------
203 :what: Field lists map field names to field bodies, like database
204     records.  They are often part of an extension syntax.  They are
205     an unambiguous variant of RFC 2822 fields.
207 :how arg1 arg2: The field marker is a colon, the field name, and a colon.
209     The field body may contain one or more body elements, indented
210     relative to the field marker.
212 :credits: 
213     .. class:: credits
215     This paragraph has the `credits` class set.  (This is actually not
216     about credits but just for ensuring that the class attribute
217     doesn't get stripped away.)
219 Option Lists
220 ------------
222 For listing command-line options:
225     command-line option "a"
227 -b file
228     options can have arguments
229     and long descriptions
231 --long
232     options can be long also
234 --input=file
235     long options can also have
236     arguments
238 --very-long-option
239     The description can also start on the next line.
241     The description may contain multiple body elements,
242     regardless of where it starts.
244 -x, -y, -z
245     Multiple options are an "option group".
247 -v, --verbose
248     Commonly-seen: short & long options.
250 -1 file, --one=file, --two file
251     Multiple options with arguments.
254     DOS/VMS-style options too
257 There must be at least two spaces between the option and the
258 description.
260 Literal Blocks
261 --------------
263 Literal blocks are indicated with a double-colon ("::") at the end of
264 the preceding paragraph (over there ``-->``).  They can be indented:
268     if literal_block:
269         text = 'is left as-is'
270         spaces_and_linebreaks = 'are preserved'
271         markup_processing = None
273 Or they can be quoted without indentation:
277 >> Great idea!
279 > Why didn't I think of that?
281 Line Blocks
282 -----------
284 This section tests line blocks.  Line blocks are body elements which
285 consist of lines and other line blocks.  Nested line blocks cause
286 indentation.
288 | This is a line block.  It ends with a blank line.
289 |     New lines begin with a vertical bar ("|").
290 |     Line breaks and initial indent are significant, and preserved.
291 |         Continuation lines are also possible.  A long line that is intended
292   to wrap should begin with a space in place of the vertical bar.
293 |     The left edge of a continuation line need not be aligned with
294   the left edge of the text above it.
296 | This is a second line block.
298 | Blank lines are permitted internally, but they must begin with a "|".
300 Another line block, surrounded by paragraphs:
302 | And it's no good waiting by the window
303 | It's no good waiting for the sun
304 | Please believe me, the things you dream of
305 | They don't fall in the lap of no-one
307 Take it away, Eric the Orchestra Leader!
309     | A one, two, a one two three four
310     |
311     | Half a bee, philosophically,
312     |     must, *ipso facto*, half not be.
313     | But half the bee has got to be,
314     |     *vis a vis* its entity.  D'you see?
315     |
316     | But can a bee be said to be
317     |     or not to be an entire bee,
318     |         when half the bee is not a bee,
319     |             due to some ancient injury?
320     |
321     | Singing...
323 Block Quotes
324 ------------
326 Block quotes consist of indented body elements:
328     My theory by A. Elk.  Brackets Miss, brackets.  This theory goes
329     as follows and begins now.  All brontosauruses are thin at one
330     end, much much thicker in the middle and then thin again at the
331     far end.  That is my theory, it is mine, and belongs to me and I
332     own it, and what it is too.
334     -- Anne Elk (Miss)
336 Doctest Blocks
337 --------------
340 >>> print 'Python-specific usage examples; begun with ">>>"'
341 Python-specific usage examples; begun with ">>>"
342 >>> print '(cut and pasted from interactive Python sessions)'
343 (cut and pasted from interactive Python sessions)
345 Footnotes
346 ---------
348 .. [1] A footnote contains body elements, consistently indented by at
349    least 3 spaces.
351    This is the footnote's second paragraph.
353 .. [#label] Footnotes may be numbered, either manually (as in [1]_) or
354    automatically using a "#"-prefixed label.  This footnote has a
355    label so it can be referred to from multiple places, both as a
356    footnote reference ([#label]_) and as a hyperlink reference
357    (label_).
359 .. [#] This footnote is numbered automatically and anonymously using a
360    label of "#" only.
362    This is the second paragraph.
364    And this is the third paragraph.
366 .. [*] Footnotes may also use symbols, specified with a "*" label.
367    Here's a reference to the next footnote: [*]_.
369 .. [*] This footnote shows the next symbol in the sequence.
371 .. [4] Here's an unreferenced footnote, with a reference to a
372    nonexistent footnote: [5]_.
374 Citations
375 ---------
377 .. [CIT2002] Citations are text-labeled footnotes. They may be
378    rendered separately and differently from footnotes.
380 Here's a reference to the above, [CIT2002]_, and a [nonexistent]_
381 citation.
383 Targets
384 -------
387 .. _example:
389 This paragraph is pointed to by the explicit "example" target. A
390 reference can be found under `Inline Markup`_, above. `Inline
391 hyperlink targets`_ are also possible.
393 Section headers are implicit targets, referred to by name. See
394 Targets_, which is a subsection of `Body Elements`_.
396 Explicit external targets are interpolated into references such as
397 "Python_ ".
399 .. _python: http://www.python.org/
401 Targets may be indirect and anonymous.  Thus `this phrase`__ may also
402 refer to the Targets_ section.
404 __ targets_
406 Here's a `hyperlink reference without a target`_, which generates an
407 error.
409 And another phrase__  pointing to an anonymous hyperlink.
411 __ http://www.example.com/
413 Duplicate Target Names
414 ~~~~~~~~~~~~~~~~~~~~~~
416 Duplicate names in section headers or other implicit targets will
417 generate "info" (level-1) system messages.  Duplicate names in
418 explicit targets will generate "warning" (level-2) system messages.
420 Duplicate Target Names
421 ~~~~~~~~~~~~~~~~~~~~~~
423 Since there are two "Duplicate Target Names" section headers, we
424 cannot uniquely refer to either of them by name.  If we try to (like
425 this: `Duplicate Target Names`_), an error is generated.
427 Directives
428 ----------
430 .. contents:: 
431    :local:
433 These are just a sample of the many reStructuredText Directives.  For
434 others, please see
435 http://docutils.sourceforge.net/docs/ref/rst/directives.html.
437 Document Parts
438 ~~~~~~~~~~~~~~
440 An example of the "contents" directive can be seen above this section
441 (a local, untitled table of contents_) and at the beginning of the
442 document (a document-wide `table of contents`_).
444 Images
445 ~~~~~~
447 An image directive (also clickable -- a hyperlink reference):
449 .. image:: ../../../docs/user/rst/images/title.png
450    :target: directives_
453 .. image:: ../../../docs/user/rst/images/title.png
454    :target: http://www.merten-home.de/
456 A figure directive:
458 .. figure:: ../../../docs/user/rst/images/title.png
459    :alt: reStructuredText, the markup syntax
461    A figure is an image with a caption and/or a legend:
463    +------------+-----------------------------------------------+
464    | re         | Revised, revisited, based on 're' module.     |
465    +------------+-----------------------------------------------+
466    | Structured | Structure-enhanced text, structuredtext.      |
467    +------------+-----------------------------------------------+
468    | Text       | Well it is, isn't it?                         |
469    +------------+-----------------------------------------------+
471    This paragraph is also part of the legend.
473 Admonitions
474 ~~~~~~~~~~~
476 .. attention:: Directives at large.
478 .. caution:: Don't take any wooden nickels.
480 .. danger:: Mad scientist at work!
482 .. error:: Does not compute.
484 .. hint:: It's bigger than a bread box.
486 .. important:: 
487    - Wash behind your ears.
489    - Clean up your room.
491    - Call your mother.
493    - Back up your data.
495 .. note:: This is a note.
497 .. tip:: 15% if the service is good.
499 .. warning:: Strong prose may provoke extreme mental exertion.
500    Reader discretion is strongly advised.
502 .. admonition:: And, by the way...
504    You can make up your own admonition too.
506 Topics, Sidebars, and Rubrics
507 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
509 .. sidebar:: Sidebar Title
510    :subtitle: Optional Subtitle
512    This is a sidebar.  It is for text outside the flow of the main
513    text.
515    .. rubric:: This is a rubric inside a sidebar
517    Sidebars often appears beside the main text with a border and
518    background color.
520 .. topic:: Topic Title
522    This is a topic.
524 .. rubric:: This is a rubric
526 Target Footnotes
527 ~~~~~~~~~~~~~~~~
529 .. target-notes::
531 Replacement Text
532 ~~~~~~~~~~~~~~~~
534 I recommend you try Python, *the* best language around .
536 .. |Python| replace:: Python, *the* best language around
538 Compound Paragraph
539 ~~~~~~~~~~~~~~~~~~
541 .. compound::
542    :class: some-class
544    Compound 1, paragraph 1.
546    Compound 1, paragraph 2.
548    * Compound 1, list item one.
550    * Compound 1, list item two.
552 Another compound statement:
554 .. compound::
556    Compound 2, a literal block:
558    ::
560        Compound 2, literal.
562    Compound 2, this is a test.
564 .. compound::
566    Compound 3, only consisting of one paragraph.
568 .. compound::
570    ::
572        Compound 4.
573        This one starts with a literal block.
575    Compound 4, a paragraph.
577 Now something *really* perverted -- a nested compound block.  In
578 LaTeX, the following paragraphs should all be first-line indented:
580 .. compound::
582    Compound 5, block 1 (a paragraph).
584    .. compound::
586       Compound 6, block 2 in compound 5.
588       Compound 6, another paragraph.
590    Compound 5, block 3 (a paragraph).
592 .. compound::
594    Compound 7, with a table inside:
596    +--------------------+--------------------+--------------------+
597    | Left cell, first   | Middle cell,       | Right cell.        |
598    | paragraph.         | consisting of      |                    |
599    |                    | exactly one        | Paragraph 2.       |
600    | Left cell, second  | paragraph.         |                    |
601    | paragraph.         |                    | Paragraph 3.       |
602    +--------------------+--------------------+--------------------+
604    Compound 7, a paragraph after the table.
606    Compound 7, another paragraph.
608 Substitution Definitions
609 ------------------------
611 An inline image (|EXAMPLE|) example:
613 .. |EXAMPLE| image:: ../../../docs/user/rst/images/biohazard.png
616 (Substitution definitions are not visible in the HTML source.)
618 Comments
619 --------
621 Here's one:
623 .. Comments begin with two dots and a space. Anything may
624    follow, except for the syntax of footnotes, hyperlink
625    targets, directives, or substitution definitions.
626    
627    Double-dashes -- "--" -- must be escaped somehow in HTML output.
629 (View the HTML source to see the comment.)
631 Raw text
632 --------
634 This does not necessarily look nice, because there may be missing white space.
636 It's just there to freeze the behavior.
638 .. raw:: html latex
640    A test.
642 .. raw:: html latex
644    Second test.
646 .. class:: myclass
648 .. raw:: html latex
650    Another test with myclass set.
652 This is the :RAW-ROLE:`fourth test` with myrawroleclass set.
654 .. raw:: html
656    Fifth test in HTML.<br />Line two.
658 .. raw:: latex
660    Fifth test in LaTeX.\\Line two.