Treat embedded standalone hyperlinks as URI, even if ending in underscore.
[docutils.git] / docs / ref / rst / restructuredtext.txt
blob4f0165d3d32a44c4b4315f5f8d4a65863f752b98
1 .. -*- coding: utf-8 -*-
3 =======================================
4  reStructuredText Markup Specification
5 =======================================
7 :Author: David Goodger
8 :Contact: docutils-develop@lists.sourceforge.net
9 :Revision: $Revision$
10 :Date: $Date$
11 :Copyright: This document has been placed in the public domain.
13 .. Note::
15    This document is a detailed technical specification; it is not a
16    tutorial or a primer.  If this is your first exposure to
17    reStructuredText, please read `A ReStructuredText Primer`_ and the
18    `Quick reStructuredText`_ user reference first.
20 .. _A ReStructuredText Primer: ../../user/rst/quickstart.html
21 .. _Quick reStructuredText: ../../user/rst/quickref.html
24 reStructuredText_ is plaintext that uses simple and intuitive
25 constructs to indicate the structure of a document.  These constructs
26 are equally easy to read in raw and processed forms.  This document is
27 itself an example of reStructuredText (raw, if you are reading the
28 text file, or processed, if you are reading an HTML document, for
29 example).  The reStructuredText parser is a component of Docutils_.
31 Simple, implicit markup is used to indicate special constructs, such
32 as section headings, bullet lists, and emphasis.  The markup used is
33 as minimal and unobtrusive as possible.  Less often-used constructs
34 and extensions to the basic reStructuredText syntax may have more
35 elaborate or explicit markup.
37 reStructuredText is applicable to documents of any length, from the
38 very small (such as inline program documentation fragments, e.g.
39 Python docstrings) to the quite large (this document).
41 The first section gives a quick overview of the syntax of the
42 reStructuredText markup by example.  A complete specification is given
43 in the `Syntax Details`_ section.
45 `Literal blocks`_ (in which no markup processing is done) are used for
46 examples throughout this document, to illustrate the plaintext markup.
49 .. contents::
52 -----------------------
53  Quick Syntax Overview
54 -----------------------
56 A reStructuredText document is made up of body or block-level
57 elements, and may be structured into sections.  Sections_ are
58 indicated through title style (underlines & optional overlines).
59 Sections contain body elements and/or subsections.  Some body elements
60 contain further elements, such as lists containing list items, which
61 in turn may contain paragraphs and other body elements.  Others, such
62 as paragraphs, contain text and `inline markup`_ elements.
64 Here are examples of `body elements`_:
66 - Paragraphs_ (and `inline markup`_)::
68       Paragraphs contain text and may contain inline markup:
69       *emphasis*, **strong emphasis**, `interpreted text`, ``inline
70       literals``, standalone hyperlinks (http://www.python.org),
71       external hyperlinks (Python_), internal cross-references
72       (example_), footnote references ([1]_), citation references
73       ([CIT2002]_), substitution references (|example|), and _`inline
74       internal targets`.
76       Paragraphs are separated by blank lines and are left-aligned.
78 - Five types of lists:
80   1. `Bullet lists`_::
82          - This is a bullet list.
84          - Bullets can be "*", "+", or "-".
86   2. `Enumerated lists`_::
88          1. This is an enumerated list.
90          2. Enumerators may be arabic numbers, letters, or roman
91             numerals.
93   3. `Definition lists`_::
95          what
96              Definition lists associate a term with a definition.
98          how
99              The term is a one-line phrase, and the definition is one
100              or more paragraphs or body elements, indented relative to
101              the term.
103   4. `Field lists`_::
105          :what: Field lists map field names to field bodies, like
106                 database records.  They are often part of an extension
107                 syntax.
109          :how: The field marker is a colon, the field name, and a
110                colon.
112                The field body may contain one or more body elements,
113                indented relative to the field marker.
115   5. `Option lists`_, for listing command-line options::
117          -a            command-line option "a"
118          -b file       options can have arguments
119                        and long descriptions
120          --long        options can be long also
121          --input=file  long options can also have
122                        arguments
123          /V            DOS/VMS-style options too
125      There must be at least two spaces between the option and the
126      description.
128 - `Literal blocks`_::
130       Literal blocks are either indented or line-prefix-quoted blocks,
131       and indicated with a double-colon ("::") at the end of the
132       preceding paragraph (right here -->)::
134           if literal_block:
135               text = 'is left as-is'
136               spaces_and_linebreaks = 'are preserved'
137               markup_processing = None
139 - `Block quotes`_::
141       Block quotes consist of indented body elements:
143           This theory, that is mine, is mine.
145           -- Anne Elk (Miss)
147 - `Doctest blocks`_::
149       >>> print 'Python-specific usage examples; begun with ">>>"'
150       Python-specific usage examples; begun with ">>>"
151       >>> print '(cut and pasted from interactive Python sessions)'
152       (cut and pasted from interactive Python sessions)
154 - Two syntaxes for tables_:
156   1. `Grid tables`_; complete, but complex and verbose::
158          +------------------------+------------+----------+
159          | Header row, column 1   | Header 2   | Header 3 |
160          +========================+============+==========+
161          | body row 1, column 1   | column 2   | column 3 |
162          +------------------------+------------+----------+
163          | body row 2             | Cells may span        |
164          +------------------------+-----------------------+
166   2. `Simple tables`_; easy and compact, but limited::
168          ====================  ==========  ==========
169          Header row, column 1  Header 2    Header 3
170          ====================  ==========  ==========
171          body row 1, column 1  column 2    column 3
172          body row 2            Cells may span columns
173          ====================  ======================
175 - `Explicit markup blocks`_ all begin with an explicit block marker,
176   two periods and a space:
178   - Footnotes_::
180         .. [1] A footnote contains body elements, consistently
181            indented by at least 3 spaces.
183   - Citations_::
185         .. [CIT2002] Just like a footnote, except the label is
186            textual.
188   - `Hyperlink targets`_::
190         .. _Python: http://www.python.org
192         .. _example:
194         The "_example" target above points to this paragraph.
196   - Directives_::
198         .. image:: mylogo.png
200   - `Substitution definitions`_::
202         .. |symbol here| image:: symbol.png
204   - Comments_::
206         .. Comments begin with two dots and a space.  Anything may
207            follow, except for the syntax of footnotes/citations,
208            hyperlink targets, directives, or substitution definitions.
211 ----------------
212  Syntax Details
213 ----------------
215 Descriptions below list "doctree elements" (document tree element
216 names; XML DTD generic identifiers) corresponding to syntax
217 constructs.  For details on the hierarchy of elements, please see `The
218 Docutils Document Tree`_ and the `Docutils Generic DTD`_ XML document
219 type definition.
222 Whitespace
223 ==========
225 Spaces are recommended for indentation_, but tabs may also be used.
226 Tabs will be converted to spaces.  Tab stops are at every 8th column.
228 Other whitespace characters (form feeds [chr(12)] and vertical tabs
229 [chr(11)]) are converted to single spaces before processing.
232 Blank Lines
233 -----------
235 Blank lines are used to separate paragraphs and other elements.
236 Multiple successive blank lines are equivalent to a single blank line,
237 except within literal blocks (where all whitespace is preserved).
238 Blank lines may be omitted when the markup makes element separation
239 unambiguous, in conjunction with indentation.  The first line of a
240 document is treated as if it is preceded by a blank line, and the last
241 line of a document is treated as if it is followed by a blank line.
244 Indentation
245 -----------
247 Indentation is used to indicate -- and is only significant in
248 indicating -- block quotes, definitions (in definition list items),
249 and local nested content:
251 - list item content (multi-line contents of list items, and multiple
252   body elements within a list item, including nested lists),
253 - the content of literal blocks, and
254 - the content of explicit markup blocks.
256 Any text whose indentation is less than that of the current level
257 (i.e., unindented text or "dedents") ends the current level of
258 indentation.
260 Since all indentation is significant, the level of indentation must be
261 consistent.  For example, indentation is the sole markup indicator for
262 `block quotes`_::
264     This is a top-level paragraph.
266         This paragraph belongs to a first-level block quote.
268         Paragraph 2 of the first-level block quote.
270 Multiple levels of indentation within a block quote will result in
271 more complex structures::
273     This is a top-level paragraph.
275         This paragraph belongs to a first-level block quote.
277             This paragraph belongs to a second-level block quote.
279     Another top-level paragraph.
281             This paragraph belongs to a second-level block quote.
283         This paragraph belongs to a first-level block quote.  The
284         second-level block quote above is inside this first-level
285         block quote.
287 When a paragraph or other construct consists of more than one line of
288 text, the lines must be left-aligned::
290     This is a paragraph.  The lines of
291     this paragraph are aligned at the left.
293         This paragraph has problems.  The
294     lines are not left-aligned.  In addition
295       to potential misinterpretation, warning
296         and/or error messages will be generated
297       by the parser.
299 Several constructs begin with a marker, and the body of the construct
300 must be indented relative to the marker.  For constructs using simple
301 markers (`bullet lists`_, `enumerated lists`_, footnotes_, citations_,
302 `hyperlink targets`_, directives_, and comments_), the level of
303 indentation of the body is determined by the position of the first
304 line of text, which begins on the same line as the marker.  For
305 example, bullet list bodies must be indented by at least two columns
306 relative to the left edge of the bullet::
308     - This is the first line of a bullet list
309       item's paragraph.  All lines must align
310       relative to the first line.  [1]_
312           This indented paragraph is interpreted
313           as a block quote.
315     Because it is not sufficiently indented,
316     this paragraph does not belong to the list
317     item.
319     .. [1] Here's a footnote.  The second line is aligned
320        with the beginning of the footnote label.  The ".."
321        marker is what determines the indentation.
323 For constructs using complex markers (`field lists`_ and `option
324 lists`_), where the marker may contain arbitrary text, the indentation
325 of the first line *after* the marker determines the left edge of the
326 body.  For example, field lists may have very long markers (containing
327 the field names)::
329     :Hello: This field has a short field name, so aligning the field
330             body with the first line is feasible.
332     :Number-of-African-swallows-required-to-carry-a-coconut: It would
333         be very difficult to align the field body with the left edge
334         of the first line.  It may even be preferable not to begin the
335         body on the same line as the marker.
338 Escaping Mechanism
339 ==================
341 The character set universally available to plaintext documents, 7-bit
342 ASCII, is limited.  No matter what characters are used for markup,
343 they will already have multiple meanings in written text.  Therefore
344 markup characters *will* sometimes appear in text **without being
345 intended as markup**.  Any serious markup system requires an escaping
346 mechanism to override the default meaning of the characters used for
347 the markup.  In reStructuredText we use the backslash, commonly used
348 as an escaping character in other domains.
350 A backslash followed by any character (except whitespace characters)
351 escapes that character.  The escaped character represents the
352 character itself, and is prevented from playing a role in any markup
353 interpretation.  The backslash is removed from the output.  A literal
354 backslash is represented by two backslashes in a row (the first
355 backslash "escapes" the second, preventing it being interpreted in an
356 "escaping" role).
358 Backslash-escaped whitespace characters are removed from the document.
359 This allows for character-level `inline markup`_.
361 There are two contexts in which backslashes have no special meaning:
362 literal blocks and inline literals.  In these contexts, a single
363 backslash represents a literal backslash, without having to double up.
365 Please note that the reStructuredText specification and parser do not
366 address the issue of the representation or extraction of text input
367 (how and in what form the text actually *reaches* the parser).
368 Backslashes and other characters may serve a character-escaping
369 purpose in certain contexts and must be dealt with appropriately.  For
370 example, Python uses backslashes in strings to escape certain
371 characters, but not others.  The simplest solution when backslashes
372 appear in Python docstrings is to use raw docstrings::
374     r"""This is a raw docstring.  Backslashes (\) are not touched."""
377 Reference Names
378 ===============
380 Simple reference names are single words consisting of alphanumerics
381 plus isolated (no two adjacent) internal hyphens, underscores,
382 periods, colons and plus signs; no whitespace or other characters are
383 allowed.  Footnote labels (Footnotes_ & `Footnote References`_), citation
384 labels (Citations_ & `Citation References`_), `interpreted text`_ roles,
385 and some `hyperlink references`_ use the simple reference name syntax.
387 Reference names using punctuation or whose names are phrases (two or
388 more space-separated words) are called "phrase-references".
389 Phrase-references are expressed by enclosing the phrase in backquotes
390 and treating the backquoted text as a reference name::
392     Want to learn about `my favorite programming language`_?
394     .. _my favorite programming language: http://www.python.org
396 Simple reference names may also optionally use backquotes.
398 Reference names are whitespace-neutral and case-insensitive.  When
399 resolving reference names internally:
401 - whitespace is normalized (one or more spaces, horizontal or vertical
402   tabs, newlines, carriage returns, or form feeds, are interpreted as
403   a single space), and
405 - case is normalized (all alphabetic characters are converted to
406   lowercase).
408 For example, the following `hyperlink references`_ are equivalent::
410     - `A HYPERLINK`_
411     - `a    hyperlink`_
412     - `A
413       Hyperlink`_
415 Hyperlinks_, footnotes_, and citations_ all share the same namespace
416 for reference names.  The labels of citations (simple reference names)
417 and manually-numbered footnotes (numbers) are entered into the same
418 database as other hyperlink names.  This means that a footnote
419 (defined as "``.. [1]``") which can be referred to by a footnote
420 reference (``[1]_``), can also be referred to by a plain hyperlink
421 reference (1_).  Of course, each type of reference (hyperlink,
422 footnote, citation) may be processed and rendered differently.  Some
423 care should be taken to avoid reference name conflicts.
426 Document Structure
427 ==================
429 Document
430 --------
432 Doctree element: document.
434 The top-level element of a parsed reStructuredText document is the
435 "document" element.  After initial parsing, the document element is a
436 simple container for a document fragment, consisting of `body
437 elements`_, transitions_, and sections_, but lacking a document title
438 or other bibliographic elements.  The code that calls the parser may
439 choose to run one or more optional post-parse transforms_,
440 rearranging the document fragment into a complete document with a
441 title and possibly other metadata elements (author, date, etc.; see
442 `Bibliographic Fields`_).
444 Specifically, there is no way to indicate a document title and
445 subtitle explicitly in reStructuredText.  Instead, a lone top-level
446 section title (see Sections_ below) can be treated as the document
447 title.  Similarly, a lone second-level section title immediately after
448 the "document title" can become the document subtitle.  The rest of
449 the sections are then lifted up a level or two.  See the `DocTitle
450 transform`_ for details.
453 Sections
454 --------
456 Doctree elements: section, title.
458 Sections are identified through their titles, which are marked up with
459 adornment: "underlines" below the title text, or underlines and
460 matching "overlines" above the title.  An underline/overline is a
461 single repeated punctuation character that begins in column 1 and
462 forms a line extending at least as far as the right edge of the title
463 text.  Specifically, an underline/overline character may be any
464 non-alphanumeric printable 7-bit ASCII character [#]_.  When an
465 overline is used, the length and character used must match the
466 underline.  Underline-only adornment styles are distinct from
467 overline-and-underline styles that use the same character.  There may
468 be any number of levels of section titles, although some output
469 formats may have limits (HTML has 6 levels).
471 .. [#] The following are all valid section title adornment
472    characters::
474        ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
476    Some characters are more suitable than others.  The following are
477    recommended::
479        = - ` : . ' " ~ ^ _ * + #
481 Rather than imposing a fixed number and order of section title
482 adornment styles, the order enforced will be the order as encountered.
483 The first style encountered will be an outermost title (like HTML H1),
484 the second style will be a subtitle, the third will be a subsubtitle,
485 and so on.
487 Below are examples of section title styles::
489     ===============
490      Section Title
491     ===============
493     ---------------
494      Section Title
495     ---------------
497     Section Title
498     =============
500     Section Title
501     -------------
503     Section Title
504     `````````````
506     Section Title
507     '''''''''''''
509     Section Title
510     .............
512     Section Title
513     ~~~~~~~~~~~~~
515     Section Title
516     *************
518     Section Title
519     +++++++++++++
521     Section Title
522     ^^^^^^^^^^^^^
524 When a title has both an underline and an overline, the title text may
525 be inset, as in the first two examples above.  This is merely
526 aesthetic and not significant.  Underline-only title text may *not* be
527 inset.
529 A blank line after a title is optional.  All text blocks up to the
530 next title of the same or higher level are included in a section (or
531 subsection, etc.).
533 All section title styles need not be used, nor need any specific
534 section title style be used.  However, a document must be consistent
535 in its use of section titles: once a hierarchy of title styles is
536 established, sections must use that hierarchy.
538 Each section title automatically generates a hyperlink target pointing
539 to the section.  The text of the hyperlink target (the "reference
540 name") is the same as that of the section title.  See `Implicit
541 Hyperlink Targets`_ for a complete description.
543 Sections may contain `body elements`_, transitions_, and nested
544 sections.
547 Transitions
548 -----------
550 Doctree element: transition.
552     Instead of subheads, extra space or a type ornament between
553     paragraphs may be used to mark text divisions or to signal
554     changes in subject or emphasis.
556     (The Chicago Manual of Style, 14th edition, section 1.80)
558 Transitions are commonly seen in novels and short fiction, as a gap
559 spanning one or more lines, with or without a type ornament such as a
560 row of asterisks.  Transitions separate other body elements.  A
561 transition should not begin or end a section or document, nor should
562 two transitions be immediately adjacent.
564 The syntax for a transition marker is a horizontal line of 4 or more
565 repeated punctuation characters.  The syntax is the same as section
566 title underlines without title text.  Transition markers require blank
567 lines before and after::
569     Para.
571     ----------
573     Para.
575 Unlike section title underlines, no hierarchy of transition markers is
576 enforced, nor do differences in transition markers accomplish
577 anything.  It is recommended that a single consistent style be used.
579 The processing system is free to render transitions in output in any
580 way it likes.  For example, horizontal rules (``<hr>``) in HTML output
581 would be an obvious choice.
584 Body Elements
585 =============
587 Paragraphs
588 ----------
590 Doctree element: paragraph.
592 Paragraphs consist of blocks of left-aligned text with no markup
593 indicating any other body element.  Blank lines separate paragraphs
594 from each other and from other body elements.  Paragraphs may contain
595 `inline markup`_.
597 Syntax diagram::
599     +------------------------------+
600     | paragraph                    |
601     |                              |
602     +------------------------------+
604     +------------------------------+
605     | paragraph                    |
606     |                              |
607     +------------------------------+
610 Bullet Lists
611 ------------
613 Doctree elements: bullet_list, list_item.
615 A text block which begins with a "*", "+", "-", "•", "‣", or "⁃",
616 followed by whitespace, is a bullet list item (a.k.a. "unordered" list
617 item).  List item bodies must be left-aligned and indented relative to
618 the bullet; the text immediately after the bullet determines the
619 indentation.  For example::
621     - This is the first bullet list item.  The blank line above the
622       first list item is required; blank lines between list items
623       (such as below this paragraph) are optional.
625     - This is the first paragraph in the second item in the list.
627       This is the second paragraph in the second item in the list.
628       The blank line above this paragraph is required.  The left edge
629       of this paragraph lines up with the paragraph above, both
630       indented relative to the bullet.
632       - This is a sublist.  The bullet lines up with the left edge of
633         the text blocks above.  A sublist is a new list so requires a
634         blank line above and below.
636     - This is the third item of the main list.
638     This paragraph is not part of the list.
640 Here are examples of **incorrectly** formatted bullet lists::
642     - This first line is fine.
643     A blank line is required between list items and paragraphs.
644     (Warning)
646     - The following line appears to be a new sublist, but it is not:
647       - This is a paragraph continuation, not a sublist (since there's
648         no blank line).  This line is also incorrectly indented.
649       - Warnings may be issued by the implementation.
651 Syntax diagram::
653     +------+-----------------------+
654     | "- " | list item             |
655     +------| (body elements)+      |
656            +-----------------------+
659 Enumerated Lists
660 ----------------
662 Doctree elements: enumerated_list, list_item.
664 Enumerated lists (a.k.a. "ordered" lists) are similar to bullet lists,
665 but use enumerators instead of bullets.  An enumerator consists of an
666 enumeration sequence member and formatting, followed by whitespace.
667 The following enumeration sequences are recognized:
669 - arabic numerals: 1, 2, 3, ... (no upper limit).
670 - uppercase alphabet characters: A, B, C, ..., Z.
671 - lower-case alphabet characters: a, b, c, ..., z.
672 - uppercase Roman numerals: I, II, III, IV, ..., MMMMCMXCIX (4999).
673 - lowercase Roman numerals: i, ii, iii, iv, ..., mmmmcmxcix (4999).
675 In addition, the auto-enumerator, "#", may be used to automatically
676 enumerate a list.  Auto-enumerated lists may begin with explicit
677 enumeration, which sets the sequence.  Fully auto-enumerated lists use
678 arabic numerals and begin with 1.  (Auto-enumerated lists are new in
679 Docutils 0.3.8.)
681 The following formatting types are recognized:
683 - suffixed with a period: "1.", "A.", "a.", "I.", "i.".
684 - surrounded by parentheses: "(1)", "(A)", "(a)", "(I)", "(i)".
685 - suffixed with a right-parenthesis: "1)", "A)", "a)", "I)", "i)".
687 While parsing an enumerated list, a new list will be started whenever:
689 - An enumerator is encountered which does not have the same format and
690   sequence type as the current list (e.g. "1.", "(a)" produces two
691   separate lists).
693 - The enumerators are not in sequence (e.g., "1.", "3." produces two
694   separate lists).
696 It is recommended that the enumerator of the first list item be
697 ordinal-1 ("1", "A", "a", "I", or "i").  Although other start-values
698 will be recognized, they may not be supported by the output format.  A
699 level-1 [info] system message will be generated for any list beginning
700 with a non-ordinal-1 enumerator.
702 Lists using Roman numerals must begin with "I"/"i" or a
703 multi-character value, such as "II" or "XV".  Any other
704 single-character Roman numeral ("V", "X", "L", "C", "D", "M") will be
705 interpreted as a letter of the alphabet, not as a Roman numeral.
706 Likewise, lists using letters of the alphabet may not begin with
707 "I"/"i", since these are recognized as Roman numeral 1.
709 The second line of each enumerated list item is checked for validity.
710 This is to prevent ordinary paragraphs from being mistakenly
711 interpreted as list items, when they happen to begin with text
712 identical to enumerators.  For example, this text is parsed as an
713 ordinary paragraph::
715     A. Einstein was a really
716     smart dude.
718 However, ambiguity cannot be avoided if the paragraph consists of only
719 one line.  This text is parsed as an enumerated list item::
721     A. Einstein was a really smart dude.
723 If a single-line paragraph begins with text identical to an enumerator
724 ("A.", "1.", "(b)", "I)", etc.), the first character will have to be
725 escaped in order to have the line parsed as an ordinary paragraph::
727     \A. Einstein was a really smart dude.
729 Examples of nested enumerated lists::
731     1. Item 1 initial text.
733        a) Item 1a.
734        b) Item 1b.
736     2. a) Item 2a.
737        b) Item 2b.
739 Example syntax diagram::
741     +-------+----------------------+
742     | "1. " | list item            |
743     +-------| (body elements)+     |
744             +----------------------+
747 Definition Lists
748 ----------------
750 Doctree elements: definition_list, definition_list_item, term,
751 classifier, definition.
753 Each definition list item contains a term, optional classifiers, and a
754 definition.  A term is a simple one-line word or phrase.  Optional
755 classifiers may follow the term on the same line, each after an inline
756 " : " (space, colon, space).  A definition is a block indented
757 relative to the term, and may contain multiple paragraphs and other
758 body elements.  There may be no blank line between a term line and a
759 definition block (this distinguishes definition lists from `block
760 quotes`_).  Blank lines are required before the first and after the
761 last definition list item, but are optional in-between.  For example::
763     term 1
764         Definition 1.
766     term 2
767         Definition 2, paragraph 1.
769         Definition 2, paragraph 2.
771     term 3 : classifier
772         Definition 3.
774     term 4 : classifier one : classifier two
775         Definition 4.
777 Inline markup is parsed in the term line before the classifier
778 delimiter (" : ") is recognized.  The delimiter will only be
779 recognized if it appears outside of any inline markup.
781 A definition list may be used in various ways, including:
783 - As a dictionary or glossary.  The term is the word itself, a
784   classifier may be used to indicate the usage of the term (noun,
785   verb, etc.), and the definition follows.
787 - To describe program variables.  The term is the variable name, a
788   classifier may be used to indicate the type of the variable (string,
789   integer, etc.), and the definition describes the variable's use in
790   the program.  This usage of definition lists supports the classifier
791   syntax of Grouch_, a system for describing and enforcing a Python
792   object schema.
794 Syntax diagram::
796     +----------------------------+
797     | term [ " : " classifier ]* |
798     +--+-------------------------+--+
799        | definition                 |
800        | (body elements)+           |
801        +----------------------------+
804 Field Lists
805 -----------
807 Doctree elements: field_list, field, field_name, field_body.
809 Field lists are used as part of an extension syntax, such as options
810 for directives_, or database-like records meant for further
811 processing.  They may also be used for two-column table-like
812 structures resembling database records (label & data pairs).
813 Applications of reStructuredText may recognize field names and
814 transform fields or field bodies in certain contexts.  For examples,
815 see `Bibliographic Fields`_ below, or the "image_" and "meta_"
816 directives in `reStructuredText Directives`_.
818 Field lists are mappings from field names to field bodies, modeled on
819 RFC822_ headers.  A field name may consist of any characters, but
820 colons (":") inside of field names must be escaped with a backslash.
821 Inline markup is parsed in field names.  Field names are
822 case-insensitive when further processed or transformed.  The field
823 name, along with a single colon prefix and suffix, together form the
824 field marker.  The field marker is followed by whitespace and the
825 field body.  The field body may contain multiple body elements,
826 indented relative to the field marker.  The first line after the field
827 name marker determines the indentation of the field body.  For
828 example::
830     :Date: 2001-08-16
831     :Version: 1
832     :Authors: - Me
833               - Myself
834               - I
835     :Indentation: Since the field marker may be quite long, the second
836        and subsequent lines of the field body do not have to line up
837        with the first line, but they must be indented relative to the
838        field name marker, and they must line up with each other.
839     :Parameter i: integer
841 The interpretation of individual words in a multi-word field name is
842 up to the application.  The application may specify a syntax for the
843 field name.  For example, second and subsequent words may be treated
844 as "arguments", quoted phrases may be treated as a single argument,
845 and direct support for the "name=value" syntax may be added.
847 Standard RFC822_ headers cannot be used for this construct because
848 they are ambiguous.  A word followed by a colon at the beginning of a
849 line is common in written text.  However, in well-defined contexts
850 such as when a field list invariably occurs at the beginning of a
851 document (PEPs and email messages), standard RFC822 headers could be
852 used.
854 Syntax diagram (simplified)::
856     +--------------------+----------------------+
857     | ":" field name ":" | field body           |
858     +-------+------------+                      |
859             | (body elements)+                  |
860             +-----------------------------------+
863 Bibliographic Fields
864 ````````````````````
866 Doctree elements: docinfo, author, authors, organization, contact,
867 version, status, date, copyright, field, topic.
869 When a field list is the first non-comment element in a document
870 (after the document title, if there is one), it may have its fields
871 transformed to document bibliographic data.  This bibliographic data
872 corresponds to the front matter of a book, such as the title page and
873 copyright page.
875 Certain registered field names (listed below) are recognized and
876 transformed to the corresponding doctree elements, most becoming child
877 elements of the "docinfo" element.  No ordering is required of these
878 fields, although they may be rearranged to fit the document structure,
879 as noted.  Unless otherwise indicated below, each of the bibliographic
880 elements' field bodies may contain a single paragraph only.  Field
881 bodies may be checked for `RCS keywords`_ and cleaned up.  Any
882 unrecognized fields will remain as generic fields in the docinfo
883 element.
885 The registered bibliographic field names and their corresponding
886 doctree elements are as follows:
888 - Field name "Author": author element.
889 - "Authors": authors.
890 - "Organization": organization.
891 - "Contact": contact.
892 - "Address": address.
893 - "Version": version.
894 - "Status": status.
895 - "Date": date.
896 - "Copyright": copyright.
897 - "Dedication": topic.
898 - "Abstract": topic.
900 The "Authors" field may contain either: a single paragraph consisting
901 of a list of authors, separated by ";" or ","; or a bullet list whose
902 elements each contain a single paragraph per author.  ";" is checked
903 first, so "Doe, Jane; Doe, John" will work.  In some languages
904 (e.g. Swedish), there is no singular/plural distinction between
905 "Author" and "Authors", so only an "Authors" field is provided, and a
906 single name is interpreted as an "Author".  If a single name contains
907 a comma, end it with a semicolon to disambiguate: ":Authors: Doe,
908 Jane;".
910 The "Address" field is for a multi-line surface mailing address.
911 Newlines and whitespace will be preserved.
913 The "Dedication" and "Abstract" fields may contain arbitrary body
914 elements.  Only one of each is allowed.  They become topic elements
915 with "Dedication" or "Abstract" titles (or language equivalents)
916 immediately following the docinfo element.
918 This field-name-to-element mapping can be replaced for other
919 languages.  See the `DocInfo transform`_ implementation documentation
920 for details.
922 Unregistered/generic fields may contain one or more paragraphs or
923 arbitrary body elements.
926 RCS Keywords
927 ````````````
929 `Bibliographic fields`_ recognized by the parser are normally checked
930 for RCS [#]_ keywords and cleaned up [#]_.  RCS keywords may be
931 entered into source files as "$keyword$", and once stored under RCS or
932 CVS [#]_, they are expanded to "$keyword: expansion text $".  For
933 example, a "Status" field will be transformed to a "status" element::
935     :Status: $keyword: expansion text $
937 .. [#] Revision Control System.
938 .. [#] RCS keyword processing can be turned off (unimplemented).
939 .. [#] Concurrent Versions System.  CVS uses the same keywords as RCS.
941 Processed, the "status" element's text will become simply "expansion
942 text".  The dollar sign delimiters and leading RCS keyword name are
943 removed.
945 The RCS keyword processing only kicks in when the field list is in
946 bibliographic context (first non-comment construct in the document,
947 after a document title if there is one).
950 Option Lists
951 ------------
953 Doctree elements: option_list, option_list_item, option_group, option,
954 option_string, option_argument, description.
956 Option lists are two-column lists of command-line options and
957 descriptions, documenting a program's options.  For example::
959     -a         Output all.
960     -b         Output both (this description is
961                quite long).
962     -c arg     Output just arg.
963     --long     Output all day long.
965     -p         This option has two paragraphs in the description.
966                This is the first.
968                This is the second.  Blank lines may be omitted between
969                options (as above) or left in (as here and below).
971     --very-long-option  A VMS-style option.  Note the adjustment for
972                         the required two spaces.
974     --an-even-longer-option
975                The description can also start on the next line.
977     -2, --two  This option has two variants.
979     -f FILE, --file=FILE  These two options are synonyms; both have
980                           arguments.
982     /V         A VMS/DOS-style option.
984 There are several types of options recognized by reStructuredText:
986 - Short POSIX options consist of one dash and an option letter.
987 - Long POSIX options consist of two dashes and an option word; some
988   systems use a single dash.
989 - Old GNU-style "plus" options consist of one plus and an option
990   letter ("plus" options are deprecated now, their use discouraged).
991 - DOS/VMS options consist of a slash and an option letter or word.
993 Please note that both POSIX-style and DOS/VMS-style options may be
994 used by DOS or Windows software.  These and other variations are
995 sometimes used mixed together.  The names above have been chosen for
996 convenience only.
998 The syntax for short and long POSIX options is based on the syntax
999 supported by Python's getopt.py_ module, which implements an option
1000 parser similar to the `GNU libc getopt_long()`_ function but with some
1001 restrictions.  There are many variant option systems, and
1002 reStructuredText option lists do not support all of them.
1004 Although long POSIX and DOS/VMS option words may be allowed to be
1005 truncated by the operating system or the application when used on the
1006 command line, reStructuredText option lists do not show or support
1007 this with any special syntax.  The complete option word should be
1008 given, supported by notes about truncation if and when applicable.
1010 Options may be followed by an argument placeholder, whose role and
1011 syntax should be explained in the description text.  Either a space or
1012 an equals sign may be used as a delimiter between options and option
1013 argument placeholders; short options ("-" or "+" prefix only) may omit
1014 the delimiter.  Option arguments may take one of two forms:
1016 - Begins with a letter (``[a-zA-Z]``) and subsequently consists of
1017   letters, numbers, underscores and hyphens (``[a-zA-Z0-9_-]``).
1018 - Begins with an open-angle-bracket (``<``) and ends with a
1019   close-angle-bracket (``>``); any characters except angle brackets
1020   are allowed internally.
1022 Multiple option "synonyms" may be listed, sharing a single
1023 description.  They must be separated by comma-space.
1025 There must be at least two spaces between the option(s) and the
1026 description.  The description may contain multiple body elements.  The
1027 first line after the option marker determines the indentation of the
1028 description.  As with other types of lists, blank lines are required
1029 before the first option list item and after the last, but are optional
1030 between option entries.
1032 Syntax diagram (simplified)::
1034     +----------------------------+-------------+
1035     | option [" " argument] "  " | description |
1036     +-------+--------------------+             |
1037             | (body elements)+                 |
1038             +----------------------------------+
1041 Literal Blocks
1042 --------------
1044 Doctree element: literal_block.
1046 A paragraph consisting of two colons ("::") signifies that the
1047 following text block(s) comprise a literal block.  The literal block
1048 must either be indented or quoted (see below).  No markup processing
1049 is done within a literal block.  It is left as-is, and is typically
1050 rendered in a monospaced typeface::
1052     This is a typical paragraph.  An indented literal block follows.
1054     ::
1056         for a in [5,4,3,2,1]:   # this is program code, shown as-is
1057             print a
1058         print "it's..."
1059         # a literal block continues until the indentation ends
1061     This text has returned to the indentation of the first paragraph,
1062     is outside of the literal block, and is therefore treated as an
1063     ordinary paragraph.
1065 The paragraph containing only "::" will be completely removed from the
1066 output; no empty paragraph will remain.
1068 As a convenience, the "::" is recognized at the end of any paragraph.
1069 If immediately preceded by whitespace, both colons will be removed
1070 from the output (this is the "partially minimized" form).  When text
1071 immediately precedes the "::", *one* colon will be removed from the
1072 output, leaving only one colon visible (i.e., "::" will be replaced by
1073 ":"; this is the "fully minimized" form).
1075 In other words, these are all equivalent (please pay attention to the
1076 colons after "Paragraph"):
1078 1. Expanded form::
1080       Paragraph:
1082       ::
1084           Literal block
1086 2. Partially minimized form::
1088       Paragraph: ::
1090           Literal block
1092 3. Fully minimized form::
1094       Paragraph::
1096           Literal block
1098 All whitespace (including line breaks, but excluding minimum
1099 indentation for indented literal blocks) is preserved.  Blank lines
1100 are required before and after a literal block, but these blank lines
1101 are not included as part of the literal block.
1104 Indented Literal Blocks
1105 ```````````````````````
1107 Indented literal blocks are indicated by indentation relative to the
1108 surrounding text (leading whitespace on each line).  The minimum
1109 indentation will be removed from each line of an indented literal
1110 block.  The literal block need not be contiguous; blank lines are
1111 allowed between sections of indented text.  The literal block ends
1112 with the end of the indentation.
1114 Syntax diagram::
1116     +------------------------------+
1117     | paragraph                    |
1118     | (ends with "::")             |
1119     +------------------------------+
1120        +---------------------------+
1121        | indented literal block    |
1122        +---------------------------+
1125 Quoted Literal Blocks
1126 `````````````````````
1128 Quoted literal blocks are unindented contiguous blocks of text where
1129 each line begins with the same non-alphanumeric printable 7-bit ASCII
1130 character [#]_.  A blank line ends a quoted literal block.  The
1131 quoting characters are preserved in the processed document.
1133 .. [#]
1134    The following are all valid quoting characters::
1136        ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
1138    Note that these are the same characters as are valid for title
1139    adornment of sections_.
1141 Possible uses include literate programming in Haskell and email
1142 quoting::
1144     John Doe wrote::
1146     >> Great idea!
1147     >
1148     > Why didn't I think of that?
1150     You just did!  ;-)
1152 Syntax diagram::
1154     +------------------------------+
1155     | paragraph                    |
1156     | (ends with "::")             |
1157     +------------------------------+
1158     +------------------------------+
1159     | ">" per-line-quoted          |
1160     | ">" contiguous literal block |
1161     +------------------------------+
1164 Line Blocks
1165 -----------
1167 Doctree elements: line_block, line.  (New in Docutils 0.3.5.)
1169 Line blocks are useful for address blocks, verse (poetry, song
1170 lyrics), and unadorned lists, where the structure of lines is
1171 significant.  Line blocks are groups of lines beginning with vertical
1172 bar ("|") prefixes.  Each vertical bar prefix indicates a new line, so
1173 line breaks are preserved.  Initial indents are also significant,
1174 resulting in a nested structure.  Inline markup is supported.
1175 Continuation lines are wrapped portions of long lines; they begin with
1176 a space in place of the vertical bar.  The left edge of a continuation
1177 line must be indented, but need not be aligned with the left edge of
1178 the text above it.  A line block ends with a blank line.
1180 This example illustrates continuation lines::
1182     | Lend us a couple of bob till Thursday.
1183     | I'm absolutely skint.
1184     | But I'm expecting a postal order and I can pay you back
1185       as soon as it comes.
1186     | Love, Ewan.
1188 This example illustrates the nesting of line blocks, indicated by the
1189 initial indentation of new lines::
1191     Take it away, Eric the Orchestra Leader!
1193         | A one, two, a one two three four
1194         |
1195         | Half a bee, philosophically,
1196         |     must, *ipso facto*, half not be.
1197         | But half the bee has got to be,
1198         |     *vis a vis* its entity.  D'you see?
1199         |
1200         | But can a bee be said to be
1201         |     or not to be an entire bee,
1202         |         when half the bee is not a bee,
1203         |             due to some ancient injury?
1204         |
1205         | Singing...
1207 Syntax diagram::
1209     +------+-----------------------+
1210     | "| " | line                  |
1211     +------| continuation line     |
1212            +-----------------------+
1215 Block Quotes
1216 ------------
1218 Doctree element: block_quote, attribution.
1220 A text block that is indented relative to the preceding text, without
1221 preceding markup indicating it to be a literal block or other content,
1222 is a block quote.  All markup processing (for body elements and inline
1223 markup) continues within the block quote::
1225     This is an ordinary paragraph, introducing a block quote.
1227         "It is my business to know things.  That is my trade."
1229         -- Sherlock Holmes
1231 A block quote may end with an attribution: a text block beginning with
1232 "--", "---", or a true em-dash, flush left within the block quote.  If
1233 the attribution consists of multiple lines, the left edges of the
1234 second and subsequent lines must align.
1236 Multiple block quotes may occur consecutively if terminated with
1237 attributions.
1239     Unindented paragraph.
1241         Block quote 1.
1243         -- Attribution 1
1245         Block quote 2.
1247 `Empty comments`_ may be used to explicitly terminate preceding
1248 constructs that would otherwise consume a block quote::
1250     * List item.
1252     ..
1254         Block quote 3.
1256 Empty comments may also be used to separate block quotes::
1258         Block quote 4.
1260     ..
1262         Block quote 5.
1264 Blank lines are required before and after a block quote, but these
1265 blank lines are not included as part of the block quote.
1267 Syntax diagram::
1269     +------------------------------+
1270     | (current level of            |
1271     | indentation)                 |
1272     +------------------------------+
1273        +---------------------------+
1274        | block quote               |
1275        | (body elements)+          |
1276        |                           |
1277        | -- attribution text       |
1278        |    (optional)             |
1279        +---------------------------+
1282 Doctest Blocks
1283 --------------
1285 Doctree element: doctest_block.
1287 Doctest blocks are interactive Python sessions cut-and-pasted into
1288 docstrings.  They are meant to illustrate usage by example, and
1289 provide an elegant and powerful testing environment via the `doctest
1290 module`_ in the Python standard library.
1292 Doctest blocks are text blocks which begin with ``">>> "``, the Python
1293 interactive interpreter main prompt, and end with a blank line.
1294 Doctest blocks are treated as a special case of literal blocks,
1295 without requiring the literal block syntax.  If both are present, the
1296 literal block syntax takes priority over Doctest block syntax::
1298     This is an ordinary paragraph.
1300     >>> print 'this is a Doctest block'
1301     this is a Doctest block
1303     The following is a literal block::
1305         >>> This is not recognized as a doctest block by
1306         reStructuredText.  It *will* be recognized by the doctest
1307         module, though!
1309 Indentation is not required for doctest blocks.
1312 Tables
1313 ------
1315 Doctree elements: table, tgroup, colspec, thead, tbody, row, entry.
1317 ReStructuredText provides two syntaxes for delineating table cells:
1318 `Grid Tables`_ and `Simple Tables`_.
1320 As with other body elements, blank lines are required before and after
1321 tables.  Tables' left edges should align with the left edge of
1322 preceding text blocks; if indented, the table is considered to be part
1323 of a block quote.
1325 Once isolated, each table cell is treated as a miniature document; the
1326 top and bottom cell boundaries act as delimiting blank lines.  Each
1327 cell contains zero or more body elements.  Cell contents may include
1328 left and/or right margins, which are removed before processing.
1331 Grid Tables
1332 ```````````
1334 Grid tables provide a complete table representation via grid-like
1335 "ASCII art".  Grid tables allow arbitrary cell contents (body
1336 elements), and both row and column spans.  However, grid tables can be
1337 cumbersome to produce, especially for simple data sets.  The `Emacs
1338 table mode`_ is a tool that allows easy editing of grid tables, in
1339 Emacs.  See `Simple Tables`_ for a simpler (but limited)
1340 representation.
1342 Grid tables are described with a visual grid made up of the characters
1343 "-", "=", "|", and "+".  The hyphen ("-") is used for horizontal lines
1344 (row separators).  The equals sign ("=") may be used to separate
1345 optional header rows from the table body (not supported by the `Emacs
1346 table mode`_).  The vertical bar ("|") is used for vertical lines
1347 (column separators).  The plus sign ("+") is used for intersections of
1348 horizontal and vertical lines.  Example::
1350     +------------------------+------------+----------+----------+
1351     | Header row, column 1   | Header 2   | Header 3 | Header 4 |
1352     | (header rows optional) |            |          |          |
1353     +========================+============+==========+==========+
1354     | body row 1, column 1   | column 2   | column 3 | column 4 |
1355     +------------------------+------------+----------+----------+
1356     | body row 2             | Cells may span columns.          |
1357     +------------------------+------------+---------------------+
1358     | body row 3             | Cells may  | - Table cells       |
1359     +------------------------+ span rows. | - contain           |
1360     | body row 4             |            | - body elements.    |
1361     +------------------------+------------+---------------------+
1363 Some care must be taken with grid tables to avoid undesired
1364 interactions with cell text in rare cases.  For example, the following
1365 table contains a cell in row 2 spanning from column 2 to column 4::
1367     +--------------+----------+-----------+-----------+
1368     | row 1, col 1 | column 2 | column 3  | column 4  |
1369     +--------------+----------+-----------+-----------+
1370     | row 2        |                                  |
1371     +--------------+----------+-----------+-----------+
1372     | row 3        |          |           |           |
1373     +--------------+----------+-----------+-----------+
1375 If a vertical bar is used in the text of that cell, it could have
1376 unintended effects if accidentally aligned with column boundaries::
1378     +--------------+----------+-----------+-----------+
1379     | row 1, col 1 | column 2 | column 3  | column 4  |
1380     +--------------+----------+-----------+-----------+
1381     | row 2        | Use the command ``ls | more``.   |
1382     +--------------+----------+-----------+-----------+
1383     | row 3        |          |           |           |
1384     +--------------+----------+-----------+-----------+
1386 Several solutions are possible.  All that is needed is to break the
1387 continuity of the cell outline rectangle.  One possibility is to shift
1388 the text by adding an extra space before::
1390     +--------------+----------+-----------+-----------+
1391     | row 1, col 1 | column 2 | column 3  | column 4  |
1392     +--------------+----------+-----------+-----------+
1393     | row 2        |  Use the command ``ls | more``.  |
1394     +--------------+----------+-----------+-----------+
1395     | row 3        |          |           |           |
1396     +--------------+----------+-----------+-----------+
1398 Another possibility is to add an extra line to row 2::
1400     +--------------+----------+-----------+-----------+
1401     | row 1, col 1 | column 2 | column 3  | column 4  |
1402     +--------------+----------+-----------+-----------+
1403     | row 2        | Use the command ``ls | more``.   |
1404     |              |                                  |
1405     +--------------+----------+-----------+-----------+
1406     | row 3        |          |           |           |
1407     +--------------+----------+-----------+-----------+
1410 Simple Tables
1411 `````````````
1413 Simple tables provide a compact and easy to type but limited
1414 row-oriented table representation for simple data sets.  Cell contents
1415 are typically single paragraphs, although arbitrary body elements may
1416 be represented in most cells.  Simple tables allow multi-line rows (in
1417 all but the first column) and column spans, but not row spans.  See
1418 `Grid Tables`_ above for a complete table representation.
1420 Simple tables are described with horizontal borders made up of "=" and
1421 "-" characters.  The equals sign ("=") is used for top and bottom
1422 table borders, and to separate optional header rows from the table
1423 body.  The hyphen ("-") is used to indicate column spans in a single
1424 row by underlining the joined columns, and may optionally be used to
1425 explicitly and/or visually separate rows.
1427 A simple table begins with a top border of equals signs with one or
1428 more spaces at each column boundary (two or more spaces recommended).
1429 Regardless of spans, the top border *must* fully describe all table
1430 columns.  There must be at least two columns in the table (to
1431 differentiate it from section headers).  The top border may be
1432 followed by header rows, and the last of the optional header rows is
1433 underlined with '=', again with spaces at column boundaries.  There
1434 may not be a blank line below the header row separator; it would be
1435 interpreted as the bottom border of the table.  The bottom boundary of
1436 the table consists of '=' underlines, also with spaces at column
1437 boundaries.  For example, here is a truth table, a three-column table
1438 with one header row and four body rows::
1440     =====  =====  =======
1441       A      B    A and B
1442     =====  =====  =======
1443     False  False  False
1444     True   False  False
1445     False  True   False
1446     True   True   True
1447     =====  =====  =======
1449 Underlines of '-' may be used to indicate column spans by "filling in"
1450 column margins to join adjacent columns.  Column span underlines must
1451 be complete (they must cover all columns) and align with established
1452 column boundaries.  Text lines containing column span underlines may
1453 not contain any other text.  A column span underline applies only to
1454 one row immediately above it.  For example, here is a table with a
1455 column span in the header::
1457     =====  =====  ======
1458        Inputs     Output
1459     ------------  ------
1460       A      B    A or B
1461     =====  =====  ======
1462     False  False  False
1463     True   False  True
1464     False  True   True
1465     True   True   True
1466     =====  =====  ======
1468 Each line of text must contain spaces at column boundaries, except
1469 where cells have been joined by column spans.  Each line of text
1470 starts a new row, except when there is a blank cell in the first
1471 column.  In that case, that line of text is parsed as a continuation
1472 line.  For this reason, cells in the first column of new rows (*not*
1473 continuation lines) *must* contain some text; blank cells would lead
1474 to a misinterpretation (but see the tip below).  Also, this mechanism
1475 limits cells in the first column to only one line of text.  Use `grid
1476 tables`_ if this limitation is unacceptable.
1478 .. Tip::
1480    To start a new row in a simple table without text in the first
1481    column in the processed output, use one of these:
1483    * an empty comment (".."), which may be omitted from the processed
1484      output (see Comments_ below)
1486    * a backslash escape ("``\``") followed by a space (see `Escaping
1487      Mechanism`_ above)
1489 Underlines of '-' may also be used to visually separate rows, even if
1490 there are no column spans.  This is especially useful in long tables,
1491 where rows are many lines long.
1493 Blank lines are permitted within simple tables.  Their interpretation
1494 depends on the context.  Blank lines *between* rows are ignored.
1495 Blank lines *within* multi-line rows may separate paragraphs or other
1496 body elements within cells.
1498 The rightmost column is unbounded; text may continue past the edge of
1499 the table (as indicated by the table borders).  However, it is
1500 recommended that borders be made long enough to contain the entire
1501 text.
1503 The following example illustrates continuation lines (row 2 consists
1504 of two lines of text, and four lines for row 3), a blank line
1505 separating paragraphs (row 3, column 2), text extending past the right
1506 edge of the table, and a new row which will have no text in the first
1507 column in the processed output (row 4)::
1509     =====  =====
1510     col 1  col 2
1511     =====  =====
1512     1      Second column of row 1.
1513     2      Second column of row 2.
1514            Second line of paragraph.
1515     3      - Second column of row 3.
1517            - Second item in bullet
1518              list (row 3, column 2).
1519     \      Row 4; column 1 will be empty.
1520     =====  =====
1523 Explicit Markup Blocks
1524 ----------------------
1526 An explicit markup block is a text block:
1528 - whose first line begins with ".." followed by whitespace (the
1529   "explicit markup start"),
1530 - whose second and subsequent lines (if any) are indented relative to
1531   the first, and
1532 - which ends before an unindented line.
1534 Explicit markup blocks are analogous to bullet list items, with ".."
1535 as the bullet.  The text on the lines immediately after the explicit
1536 markup start determines the indentation of the block body.  The
1537 maximum common indentation is always removed from the second and
1538 subsequent lines of the block body.  Therefore if the first construct
1539 fits in one line, and the indentation of the first and second
1540 constructs should differ, the first construct should not begin on the
1541 same line as the explicit markup start.
1543 Blank lines are required between explicit markup blocks and other
1544 elements, but are optional between explicit markup blocks where
1545 unambiguous.
1547 The explicit markup syntax is used for footnotes, citations, hyperlink
1548 targets, directives, substitution definitions, and comments.
1551 Footnotes
1552 `````````
1554 Doctree elements: footnote, label.
1556 Each footnote consists of an explicit markup start (".. "), a left
1557 square bracket, the footnote label, a right square bracket, and
1558 whitespace, followed by indented body elements.  A footnote label can
1561 - a whole decimal number consisting of one or more digits,
1563 - a single "#" (denoting `auto-numbered footnotes`_),
1565 - a "#" followed by a simple reference name (an `autonumber label`_),
1566   or
1568 - a single "*" (denoting `auto-symbol footnotes`_).
1570 The footnote content (body elements) must be consistently indented (by
1571 at least 3 spaces) and left-aligned.  The first body element within a
1572 footnote may often begin on the same line as the footnote label.
1573 However, if the first element fits on one line and the indentation of
1574 the remaining elements differ, the first element must begin on the
1575 line after the footnote label.  Otherwise, the difference in
1576 indentation will not be detected.
1578 Footnotes may occur anywhere in the document, not only at the end.
1579 Where and how they appear in the processed output depends on the
1580 processing system.
1582 Here is a manually numbered footnote::
1584     .. [1] Body elements go here.
1586 Each footnote automatically generates a hyperlink target pointing to
1587 itself.  The text of the hyperlink target name is the same as that of
1588 the footnote label.  `Auto-numbered footnotes`_ generate a number as
1589 their footnote label and reference name.  See `Implicit Hyperlink
1590 Targets`_ for a complete description of the mechanism.
1592 Syntax diagram::
1594     +-------+-------------------------+
1595     | ".. " | "[" label "]" footnote  |
1596     +-------+                         |
1597             | (body elements)+        |
1598             +-------------------------+
1601 Auto-Numbered Footnotes
1602 .......................
1604 A number sign ("#") may be used as the first character of a footnote
1605 label to request automatic numbering of the footnote or footnote
1606 reference.
1608 The first footnote to request automatic numbering is assigned the
1609 label "1", the second is assigned the label "2", and so on (assuming
1610 there are no manually numbered footnotes present; see `Mixed Manual
1611 and Auto-Numbered Footnotes`_ below).  A footnote which has
1612 automatically received a label "1" generates an implicit hyperlink
1613 target with name "1", just as if the label was explicitly specified.
1615 .. _autonumber label: `autonumber labels`_
1617 A footnote may specify a label explicitly while at the same time
1618 requesting automatic numbering: ``[#label]``.  These labels are called
1619 _`autonumber labels`.  Autonumber labels do two things:
1621 - On the footnote itself, they generate a hyperlink target whose name
1622   is the autonumber label (doesn't include the "#").
1624 - They allow an automatically numbered footnote to be referred to more
1625   than once, as a footnote reference or hyperlink reference.  For
1626   example::
1628       If [#note]_ is the first footnote reference, it will show up as
1629       "[1]".  We can refer to it again as [#note]_ and again see
1630       "[1]".  We can also refer to it as note_ (an ordinary internal
1631       hyperlink reference).
1633       .. [#note] This is the footnote labeled "note".
1635 The numbering is determined by the order of the footnotes, not by the
1636 order of the references.  For footnote references without autonumber
1637 labels (``[#]_``), the footnotes and footnote references must be in
1638 the same relative order but need not alternate in lock-step.  For
1639 example::
1641     [#]_ is a reference to footnote 1, and [#]_ is a reference to
1642     footnote 2.
1644     .. [#] This is footnote 1.
1645     .. [#] This is footnote 2.
1646     .. [#] This is footnote 3.
1648     [#]_ is a reference to footnote 3.
1650 Special care must be taken if footnotes themselves contain
1651 auto-numbered footnote references, or if multiple references are made
1652 in close proximity.  Footnotes and references are noted in the order
1653 they are encountered in the document, which is not necessarily the
1654 same as the order in which a person would read them.
1657 Auto-Symbol Footnotes
1658 .....................
1660 An asterisk ("*") may be used for footnote labels to request automatic
1661 symbol generation for footnotes and footnote references.  The asterisk
1662 may be the only character in the label.  For example::
1664     Here is a symbolic footnote reference: [*]_.
1666     .. [*] This is the footnote.
1668 A transform will insert symbols as labels into corresponding footnotes
1669 and footnote references.  The number of references must be equal to
1670 the number of footnotes.  One symbol footnote cannot have multiple
1671 references.
1673 The standard Docutils system uses the following symbols for footnote
1674 marks [#]_:
1676 - asterisk/star ("*")
1677 - dagger (HTML character entity "&dagger;", Unicode U+02020)
1678 - double dagger ("&Dagger;"/U+02021)
1679 - section mark ("&sect;"/U+000A7)
1680 - pilcrow or paragraph mark ("&para;"/U+000B6)
1681 - number sign ("#")
1682 - spade suit ("&spades;"/U+02660)
1683 - heart suit ("&hearts;"/U+02665)
1684 - diamond suit ("&diams;"/U+02666)
1685 - club suit ("&clubs;"/U+02663)
1687 .. [#] This list was inspired by the list of symbols for "Note
1688    Reference Marks" in The Chicago Manual of Style, 14th edition,
1689    section 12.51.  "Parallels" ("||") were given in CMoS instead of
1690    the pilcrow.  The last four symbols (the card suits) were added
1691    arbitrarily.
1693 If more than ten symbols are required, the same sequence will be
1694 reused, doubled and then tripled, and so on ("**" etc.).
1696 .. Note:: When using auto-symbol footnotes, the choice of output
1697    encoding is important.  Many of the symbols used are not encodable
1698    in certain common text encodings such as Latin-1 (ISO 8859-1).  The
1699    use of UTF-8 for the output encoding is recommended.  An
1700    alternative for HTML and XML output is to use the
1701    "xmlcharrefreplace" `output encoding error handler`__.
1703 __ ../../user/config.html#output-encoding-error-handler
1706 Mixed Manual and Auto-Numbered Footnotes
1707 ........................................
1709 Manual and automatic footnote numbering may both be used within a
1710 single document, although the results may not be expected.  Manual
1711 numbering takes priority.  Only unused footnote numbers are assigned
1712 to auto-numbered footnotes.  The following example should be
1713 illustrative::
1715     [2]_ will be "2" (manually numbered),
1716     [#]_ will be "3" (anonymous auto-numbered), and
1717     [#label]_ will be "1" (labeled auto-numbered).
1719     .. [2] This footnote is labeled manually, so its number is fixed.
1721     .. [#label] This autonumber-labeled footnote will be labeled "1".
1722        It is the first auto-numbered footnote and no other footnote
1723        with label "1" exists.  The order of the footnotes is used to
1724        determine numbering, not the order of the footnote references.
1726     .. [#] This footnote will be labeled "3".  It is the second
1727        auto-numbered footnote, but footnote label "2" is already used.
1730 Citations
1731 `````````
1733 Citations are identical to footnotes except that they use only
1734 non-numeric labels such as ``[note]`` or ``[GVR2001]``.  Citation
1735 labels are simple `reference names`_ (case-insensitive single words
1736 consisting of alphanumerics plus internal hyphens, underscores, and
1737 periods; no whitespace).  Citations may be rendered separately and
1738 differently from footnotes.  For example::
1740     Here is a citation reference: [CIT2002]_.
1742     .. [CIT2002] This is the citation.  It's just like a footnote,
1743        except the label is textual.
1746 .. _hyperlinks:
1748 Hyperlink Targets
1749 `````````````````
1751 Doctree element: target.
1753 These are also called _`explicit hyperlink targets`, to differentiate
1754 them from `implicit hyperlink targets`_ defined below.
1756 Hyperlink targets identify a location within or outside of a document,
1757 which may be linked to by `hyperlink references`_.
1759 Hyperlink targets may be named or anonymous.  Named hyperlink targets
1760 consist of an explicit markup start (".. "), an underscore, the
1761 reference name (no trailing underscore), a colon, whitespace, and a
1762 link block::
1764     .. _hyperlink-name: link-block
1766 Reference names are whitespace-neutral and case-insensitive.  See
1767 `Reference Names`_ for details and examples.
1769 Anonymous hyperlink targets consist of an explicit markup start
1770 (".. "), two underscores, a colon, whitespace, and a link block; there
1771 is no reference name::
1773     .. __: anonymous-hyperlink-target-link-block
1775 An alternate syntax for anonymous hyperlinks consists of two
1776 underscores, a space, and a link block::
1778     __ anonymous-hyperlink-target-link-block
1780 See `Anonymous Hyperlinks`_ below.
1782 There are three types of hyperlink targets: internal, external, and
1783 indirect.
1785 1. _`Internal hyperlink targets` have empty link blocks.  They provide
1786    an end point allowing a hyperlink to connect one place to another
1787    within a document.  An internal hyperlink target points to the
1788    element following the target.  For example::
1790        Clicking on this internal hyperlink will take us to the target_
1791        below.
1793        .. _target:
1795        The hyperlink target above points to this paragraph.
1797    Internal hyperlink targets may be "chained".  Multiple adjacent
1798    internal hyperlink targets all point to the same element::
1800        .. _target1:
1801        .. _target2:
1803        The targets "target1" and "target2" are synonyms; they both
1804        point to this paragraph.
1806    If the element "pointed to" is an external hyperlink target (with a
1807    URI in its link block; see #2 below) the URI from the external
1808    hyperlink target is propagated to the internal hyperlink targets;
1809    they will all "point to" the same URI.  There is no need to
1810    duplicate a URI.  For example, all three of the following hyperlink
1811    targets refer to the same URI::
1813        .. _Python DOC-SIG mailing list archive:
1814        .. _archive:
1815        .. _Doc-SIG: http://mail.python.org/pipermail/doc-sig/
1817    An inline form of internal hyperlink target is available; see
1818    `Inline Internal Targets`_.
1820 2. _`External hyperlink targets` have an absolute or relative URI or
1821    email address in their link blocks.  For example, take the
1822    following input::
1824        See the Python_ home page for info.
1826        `Write to me`_ with your questions.
1828        .. _Python: http://www.python.org
1829        .. _Write to me: jdoe@example.com
1831    After processing into HTML, the hyperlinks might be expressed as::
1833        See the <a href="http://www.python.org">Python</a> home page
1834        for info.
1836        <a href="mailto:jdoe@example.com">Write to me</a> with your
1837        questions.
1839    An external hyperlink's URI may begin on the same line as the
1840    explicit markup start and target name, or it may begin in an
1841    indented text block immediately following, with no intervening
1842    blank lines.  If there are multiple lines in the link block, they
1843    are concatenated.  Any whitespace is removed (whitespace is
1844    permitted to allow for line wrapping).  The following external
1845    hyperlink targets are equivalent::
1847        .. _one-liner: http://docutils.sourceforge.net/rst.html
1849        .. _starts-on-this-line: http://
1850           docutils.sourceforge.net/rst.html
1852        .. _entirely-below:
1853           http://docutils.
1854           sourceforge.net/rst.html
1856    If an external hyperlink target's URI contains an underscore as its
1857    last character, it must be escaped to avoid being mistaken for an
1858    indirect hyperlink target::
1860        This link_ refers to a file called ``underscore_``.
1862        .. _link: underscore\_
1864    It is possible (although not generally recommended) to include URIs
1865    directly within hyperlink references.  See `Embedded URIs and Aliases`_
1866    below.
1868 3. _`Indirect hyperlink targets` have a hyperlink reference in their
1869    link blocks.  In the following example, target "one" indirectly
1870    references whatever target "two" references, and target "two"
1871    references target "three", an internal hyperlink target.  In
1872    effect, all three reference the same thing::
1874        .. _one: two_
1875        .. _two: three_
1876        .. _three:
1878    Just as with `hyperlink references`_ anywhere else in a document,
1879    if a phrase-reference is used in the link block it must be enclosed
1880    in backquotes.  As with `external hyperlink targets`_, the link
1881    block of an indirect hyperlink target may begin on the same line as
1882    the explicit markup start or the next line.  It may also be split
1883    over multiple lines, in which case the lines are joined with
1884    whitespace before being normalized.
1886    For example, the following indirect hyperlink targets are
1887    equivalent::
1889        .. _one-liner: `A HYPERLINK`_
1890        .. _entirely-below:
1891           `a    hyperlink`_
1892        .. _split: `A
1893           Hyperlink`_
1895    It is possible to include an alias directly within hyperlink
1896    references. See `Embedded URIs and Aliases`_ below.
1898 If the reference name contains any colons, either:
1900 - the phrase must be enclosed in backquotes::
1902       .. _`FAQTS: Computers: Programming: Languages: Python`:
1903          http://python.faqts.com/
1905 - or the colon(s) must be backslash-escaped in the link target::
1907       .. _Chapter One\: "Tadpole Days":
1909       It's not easy being green...
1911 See `Implicit Hyperlink Targets`_ below for the resolution of
1912 duplicate reference names.
1914 Syntax diagram::
1916     +-------+----------------------+
1917     | ".. " | "_" name ":" link    |
1918     +-------+ block                |
1919             |                      |
1920             +----------------------+
1923 Anonymous Hyperlinks
1924 ....................
1926 The `World Wide Web Consortium`_ recommends in its `HTML Techniques
1927 for Web Content Accessibility Guidelines`_ that authors should
1928 "clearly identify the target of each link."  Hyperlink references
1929 should be as verbose as possible, but duplicating a verbose hyperlink
1930 name in the target is onerous and error-prone.  Anonymous hyperlinks
1931 are designed to allow convenient verbose hyperlink references, and are
1932 analogous to `Auto-Numbered Footnotes`_.  They are particularly useful
1933 in short or one-off documents.  However, this feature is easily abused
1934 and can result in unreadable plaintext and/or unmaintainable
1935 documents.  Caution is advised.
1937 Anonymous `hyperlink references`_ are specified with two underscores
1938 instead of one::
1940     See `the web site of my favorite programming language`__.
1942 Anonymous targets begin with ".. __:"; no reference name is required
1943 or allowed::
1945     .. __: http://www.python.org
1947 As a convenient alternative, anonymous targets may begin with "__"
1948 only::
1950     __ http://www.python.org
1952 The reference name of the reference is not used to match the reference
1953 to its target.  Instead, the order of anonymous hyperlink references
1954 and targets within the document is significant: the first anonymous
1955 reference will link to the first anonymous target.  The number of
1956 anonymous hyperlink references in a document must match the number of
1957 anonymous targets.  For readability, it is recommended that targets be
1958 kept close to references.  Take care when editing text containing
1959 anonymous references; adding, removing, and rearranging references
1960 require attention to the order of corresponding targets.
1963 Directives
1964 ``````````
1966 Doctree elements: depend on the directive.
1968 Directives are an extension mechanism for reStructuredText, a way of
1969 adding support for new constructs without adding new primary syntax
1970 (directives may support additional syntax locally).  All standard
1971 directives (those implemented and registered in the reference
1972 reStructuredText parser) are described in the `reStructuredText
1973 Directives`_ document, and are always available.  Any other directives
1974 are domain-specific, and may require special action to make them
1975 available when processing the document.
1977 For example, here's how an image_ may be placed::
1979     .. image:: mylogo.jpeg
1981 A figure_ (a graphic with a caption) may placed like this::
1983     .. figure:: larch.png
1985        The larch.
1987 An admonition_ (note, caution, etc.) contains other body elements::
1989     .. note:: This is a paragraph
1991        - Here is a bullet list.
1993 Directives are indicated by an explicit markup start (".. ") followed
1994 by the directive type, two colons, and whitespace (together called the
1995 "directive marker").  Directive types are case-insensitive single
1996 words (alphanumerics plus isolated internal hyphens, underscores,
1997 plus signs, colons, and periods; no whitespace).  Two colons are used
1998 after the directive type for these reasons:
2000 - Two colons are distinctive, and unlikely to be used in common text.
2002 - Two colons avoids clashes with common comment text like::
2004       .. Danger: modify at your own risk!
2006 - If an implementation of reStructuredText does not recognize a
2007   directive (i.e., the directive-handler is not installed), a level-3
2008   (error) system message is generated, and the entire directive block
2009   (including the directive itself) will be included as a literal
2010   block.  Thus "::" is a natural choice.
2012 The directive block is consists of any text on the first line of the
2013 directive after the directive marker, and any subsequent indented
2014 text.  The interpretation of the directive block is up to the
2015 directive code.  There are three logical parts to the directive block:
2017 1. Directive arguments.
2018 2. Directive options.
2019 3. Directive content.
2021 Individual directives can employ any combination of these parts.
2022 Directive arguments can be filesystem paths, URLs, title text, etc.
2023 Directive options are indicated using `field lists`_; the field names
2024 and contents are directive-specific.  Arguments and options must form
2025 a contiguous block beginning on the first or second line of the
2026 directive; a blank line indicates the beginning of the directive
2027 content block.  If either arguments and/or options are employed by the
2028 directive, a blank line must separate them from the directive content.
2029 The "figure" directive employs all three parts::
2031     .. figure:: larch.png
2032        :scale: 50
2034        The larch.
2036 Simple directives may not require any content.  If a directive that
2037 does not employ a content block is followed by indented text anyway,
2038 it is an error.  If a block quote should immediately follow a
2039 directive, use an empty comment in-between (see Comments_ below).
2041 Actions taken in response to directives and the interpretation of text
2042 in the directive content block or subsequent text block(s) are
2043 directive-dependent.  See `reStructuredText Directives`_ for details.
2045 Directives are meant for the arbitrary processing of their contents,
2046 which can be transformed into something possibly unrelated to the
2047 original text.  It may also be possible for directives to be used as
2048 pragmas, to modify the behavior of the parser, such as to experiment
2049 with alternate syntax.  There is no parser support for this
2050 functionality at present; if a reasonable need for pragma directives
2051 is found, they may be supported.
2053 Directives do not generate "directive" elements; they are a *parser
2054 construct* only, and have no intrinsic meaning outside of
2055 reStructuredText.  Instead, the parser will transform recognized
2056 directives into (possibly specialized) document elements.  Unknown
2057 directives will trigger level-3 (error) system messages.
2059 Syntax diagram::
2061     +-------+-------------------------------+
2062     | ".. " | directive type "::" directive |
2063     +-------+ block                         |
2064             |                               |
2065             +-------------------------------+
2068 Substitution Definitions
2069 ````````````````````````
2071 Doctree element: substitution_definition.
2073 Substitution definitions are indicated by an explicit markup start
2074 (".. ") followed by a vertical bar, the substitution text, another
2075 vertical bar, whitespace, and the definition block.  Substitution text
2076 may not begin or end with whitespace.  A substitution definition block
2077 contains an embedded inline-compatible directive (without the leading
2078 ".. "), such as "image_" or "replace_".  For example::
2080     The |biohazard| symbol must be used on containers used to
2081     dispose of medical waste.
2083     .. |biohazard| image:: biohazard.png
2085 It is an error for a substitution definition block to directly or
2086 indirectly contain a circular substitution reference.
2088 `Substitution references`_ are replaced in-line by the processed
2089 contents of the corresponding definition (linked by matching
2090 substitution text).  Matches are case-sensitive but forgiving; if no
2091 exact match is found, a case-insensitive comparison is attempted.
2093 Substitution definitions allow the power and flexibility of
2094 block-level directives_ to be shared by inline text.  They are a way
2095 to include arbitrarily complex inline structures within text, while
2096 keeping the details out of the flow of text.  They are the equivalent
2097 of SGML/XML's named entities or programming language macros.
2099 Without the substitution mechanism, every time someone wants an
2100 application-specific new inline structure, they would have to petition
2101 for a syntax change.  In combination with existing directive syntax,
2102 any inline structure can be coded without new syntax (except possibly
2103 a new directive).
2105 Syntax diagram::
2107     +-------+-----------------------------------------------------+
2108     | ".. " | "|" substitution text "| " directive type "::" data |
2109     +-------+ directive block                                     |
2110             |                                                     |
2111             +-----------------------------------------------------+
2113 Following are some use cases for the substitution mechanism.  Please
2114 note that most of the embedded directives shown are examples only and
2115 have not been implemented.
2117 Objects
2118     Substitution references may be used to associate ambiguous text
2119     with a unique object identifier.
2121     For example, many sites may wish to implement an inline "user"
2122     directive::
2124         |Michael| and |Jon| are our widget-wranglers.
2126         .. |Michael| user:: mjones
2127         .. |Jon|     user:: jhl
2129     Depending on the needs of the site, this may be used to index the
2130     document for later searching, to hyperlink the inline text in
2131     various ways (mailto, homepage, mouseover Javascript with profile
2132     and contact information, etc.), or to customize presentation of
2133     the text (include username in the inline text, include an icon
2134     image with a link next to the text, make the text bold or a
2135     different color, etc.).
2137     The same approach can be used in documents which frequently refer
2138     to a particular type of objects with unique identifiers but
2139     ambiguous common names.  Movies, albums, books, photos, court
2140     cases, and laws are possible.  For example::
2142         |The Transparent Society| offers a fascinating alternate view
2143         on privacy issues.
2145         .. |The Transparent Society| book:: isbn=0738201448
2147     Classes or functions, in contexts where the module or class names
2148     are unclear and/or interpreted text cannot be used, are another
2149     possibility::
2151         4XSLT has the convenience method |runString|, so you don't
2152         have to mess with DOM objects if all you want is the
2153         transformed output.
2155         .. |runString| function:: module=xml.xslt class=Processor
2157 Images
2158     Images are a common use for substitution references::
2160         West led the |H| 3, covered by dummy's |H| Q, East's |H| K,
2161         and trumped in hand with the |S| 2.
2163         .. |H| image:: /images/heart.png
2164            :height: 11
2165            :width: 11
2166         .. |S| image:: /images/spade.png
2167            :height: 11
2168            :width: 11
2170         * |Red light| means stop.
2171         * |Green light| means go.
2172         * |Yellow light| means go really fast.
2174         .. |Red light|    image:: red_light.png
2175         .. |Green light|  image:: green_light.png
2176         .. |Yellow light| image:: yellow_light.png
2178         |-><-| is the official symbol of POEE_.
2180         .. |-><-| image:: discord.png
2181         .. _POEE: http://www.poee.org/
2183     The "image_" directive has been implemented.
2185 Styles [#]_
2186     Substitution references may be used to associate inline text with
2187     an externally defined presentation style::
2189         Even |the text in Texas| is big.
2191         .. |the text in Texas| style:: big
2193     The style name may be meaningful in the context of some particular
2194     output format (CSS class name for HTML output, LaTeX style name
2195     for LaTeX, etc), or may be ignored for other output formats (such
2196     as plaintext).
2198     .. @@@ This needs to be rethought & rewritten or removed:
2200        Interpreted text is unsuitable for this purpose because the set
2201        of style names cannot be predefined - it is the domain of the
2202        content author, not the author of the parser and output
2203        formatter - and there is no way to associate a style name
2204        argument with an interpreted text style role.  Also, it may be
2205        desirable to use the same mechanism for styling blocks::
2207            .. style:: motto
2208               At Bob's Underwear Shop, we'll do anything to get in
2209               your pants.
2211            .. style:: disclaimer
2212               All rights reversed.  Reprint what you like.
2214     .. [#] There may be sufficient need for a "style" mechanism to
2215        warrant simpler syntax such as an extension to the interpreted
2216        text role syntax.  The substitution mechanism is cumbersome for
2217        simple text styling.
2219 Templates
2220     Inline markup may be used for later processing by a template
2221     engine.  For example, a Zope_ author might write::
2223         Welcome back, |name|!
2225         .. |name| tal:: replace user/getUserName
2227     After processing, this ZPT output would result::
2229         Welcome back,
2230         <span tal:replace="user/getUserName">name</span>!
2232     Zope would then transform this to something like "Welcome back,
2233     David!" during a session with an actual user.
2235 Replacement text
2236     The substitution mechanism may be used for simple macro
2237     substitution.  This may be appropriate when the replacement text
2238     is repeated many times throughout one or more documents,
2239     especially if it may need to change later.  A short example is
2240     unavoidably contrived::
2242         |RST|_ is a little annoying to type over and over, especially
2243         when writing about |RST| itself, and spelling out the
2244         bicapitalized word |RST| every time isn't really necessary for
2245         |RST| source readability.
2247         .. |RST| replace:: reStructuredText
2248         .. _RST: http://docutils.sourceforge.net/rst.html
2250     Note the trailing underscore in the first use of a substitution
2251     reference.  This indicates a reference to the corresponding
2252     hyperlink target.
2254     Substitution is also appropriate when the replacement text cannot
2255     be represented using other inline constructs, or is obtrusively
2256     long::
2258         But still, that's nothing compared to a name like
2259         |j2ee-cas|__.
2261         .. |j2ee-cas| replace::
2262            the Java `TM`:super: 2 Platform, Enterprise Edition Client
2263            Access Services
2264         __ http://developer.java.sun.com/developer/earlyAccess/
2265            j2eecas/
2267     The "replace_" directive has been implemented.
2270 Comments
2271 ````````
2273 Doctree element: comment.
2275 Arbitrary indented text may follow the explicit markup start and will
2276 be processed as a comment element.  No further processing is done on
2277 the comment block text; a comment contains a single "text blob".
2278 Depending on the output formatter, comments may be removed from the
2279 processed output.  The only restriction on comments is that they not
2280 use the same syntax as any of the other explicit markup constructs:
2281 substitution definitions, directives, footnotes, citations, or
2282 hyperlink targets.  To ensure that none of the other explicit markup
2283 constructs is recognized, leave the ".." on a line by itself::
2285     .. This is a comment
2286     ..
2287        _so: is this!
2288     ..
2289        [and] this!
2290     ..
2291        this:: too!
2292     ..
2293        |even| this:: !
2295 .. _empty comments:
2297 An explicit markup start followed by a blank line and nothing else
2298 (apart from whitespace) is an "_`empty comment`".  It serves to
2299 terminate a preceding construct, and does **not** consume any indented
2300 text following.  To have a block quote follow a list or any indented
2301 construct, insert an unindented empty comment in-between.
2303 Syntax diagram::
2305     +-------+----------------------+
2306     | ".. " | comment              |
2307     +-------+ block                |
2308             |                      |
2309             +----------------------+
2312 Implicit Hyperlink Targets
2313 ==========================
2315 Implicit hyperlink targets are generated by section titles, footnotes,
2316 and citations, and may also be generated by extension constructs.
2317 Implicit hyperlink targets otherwise behave identically to explicit
2318 `hyperlink targets`_.
2320 Problems of ambiguity due to conflicting duplicate implicit and
2321 explicit reference names are avoided by following this procedure:
2323 1. `Explicit hyperlink targets`_ override any implicit targets having
2324    the same reference name.  The implicit hyperlink targets are
2325    removed, and level-1 (info) system messages are inserted.
2327 2. Duplicate implicit hyperlink targets are removed, and level-1
2328    (info) system messages inserted.  For example, if two or more
2329    sections have the same title (such as "Introduction" subsections of
2330    a rigidly-structured document), there will be duplicate implicit
2331    hyperlink targets.
2333 3. Duplicate explicit hyperlink targets are removed, and level-2
2334    (warning) system messages are inserted.  Exception: duplicate
2335    `external hyperlink targets`_ (identical hyperlink names and
2336    referenced URIs) do not conflict, and are not removed.
2338 System messages are inserted where target links have been removed.
2339 See "Error Handling" in `PEP 258`_.
2341 The parser must return a set of *unique* hyperlink targets.  The
2342 calling software (such as the Docutils_) can warn of unresolvable
2343 links, giving reasons for the messages.
2346 Inline Markup
2347 =============
2349 In reStructuredText, inline markup applies to words or phrases within
2350 a text block.  The same whitespace and punctuation that serves to
2351 delimit words in written text is used to delimit the inline markup
2352 syntax constructs.  The text within inline markup may not begin or end
2353 with whitespace.  Arbitrary `character-level inline markup`_ is
2354 supported although not encouraged.  Inline markup cannot be nested.
2356 There are nine inline markup constructs.  Five of the constructs use
2357 identical start-strings and end-strings to indicate the markup:
2359 - emphasis_: "*"
2360 - `strong emphasis`_: "**"
2361 - `interpreted text`_: "`"
2362 - `inline literals`_: "``"
2363 - `substitution references`_: "|"
2365 Three constructs use different start-strings and end-strings:
2367 - `inline internal targets`_: "_`" and "`"
2368 - `footnote references`_: "[" and "]_"
2369 - `hyperlink references`_: "`" and "\`_" (phrases), or just a
2370   trailing "_" (single words)
2372 `Standalone hyperlinks`_ are recognized implicitly, and use no extra
2373 markup.
2375 Inline markup recognition rules
2376 -------------------------------
2378 Inline markup start-strings and end-strings are only recognized if all of
2379 the following conditions are met:
2381 1. Inline markup start-strings must start a text block or be
2382    immediately preceded by
2384    * whitespace,
2385    * one of the ASCII characters ``- : / ' " < ( [ {`` or
2386    * a non-ASCII punctuation character with `Unicode category`_
2387      `Pd` (Dash),
2388      `Po` (Other),
2389      `Ps` (Open),
2390      `Pi` (Initial quote), or
2391      `Pf` (Final quote) [#PiPf]_.
2393 2. Inline markup start-strings must be immediately followed by
2394    non-whitespace.
2396 3. Inline markup end-strings must be immediately preceded by
2397    non-whitespace.
2399 4. Inline markup end-strings must end a text block or be immediately
2400    followed by
2402    * whitespace,
2403    * one of the ASCII characters ``- . , : ; ! ? \ / ' " ) ] } >`` or
2404    * a non-ASCII punctuation character with `Unicode category`_
2405      `Pd` (Dash),
2406      `Po` (Other),
2407      `Pe` (Close),
2408      `Pf` (Final quote), or
2409      `Pi` (Initial quote) [#PiPf]_.
2411 5. If an inline markup start-string is immediately preceded by one of the
2412    ASCII characters ``' " < ( [ {``, or a character with Unicode character
2413    category `Ps`, `Pi`, or `Pf`, it must not be followed by the
2414    corresponding [#corresponding-quotes]_ closing character from
2415    ``' " ) ] } >`` or the categories `Pe`, `Pf`, or `Pi`.
2417 6. An inline markup end-string must be separated by at least one
2418    character from the start-string.
2420 7. An unescaped backslash preceding a start-string or end-string will
2421    disable markup recognition, except for the end-string of `inline
2422    literals`_.  See `Escaping Mechanism`_ above for details.
2424 .. [#PiPf] `Pi` (Punctuation, Initial quote) characters are "usually
2425    closing, sometimes opening". `Pf` (Punctuation, Final quote)
2426    characters are "usually closing, sometimes opening".
2428 .. [#corresponding-quotes] For quotes, corresponding characters can be
2429    any of the `quotation marks in international usage`_
2431 .. _Unicode category:
2432    http://www.unicode.org/Public/5.1.0/ucd/UCD.html#General_Category_Values
2434 .. _quotation marks in international usage:
2435    http://en.wikipedia.org/wiki/Quotation_mark,_non-English_usage
2437 The inline markup recognition rules were devised to allow 90% of non-markup
2438 uses of "*", "`", "_", and "|" without escaping. For example, none of the
2439 following terms are recognized as containing inline markup strings:
2441 - 2*x a**b O(N**2) e**(x*y) f(x)*f(y) a|b file*.* (breaks 1)
2442 - 2 * x  a ** b  (* BOM32_* ` `` _ __ | (breaks 2)
2443 - "*" '|' (*) [*] {*} <*>
2444   ‘*’ ‚*‘ ‘*‚ ’*’ ‚*’
2445   “*” „*“ “*„ ”*” „*”
2446   »*« ›*‹ «*» »*» ›*› (breaks 5)
2447 - || (breaks 6)
2448 - __init__ __init__()
2450 No escaping is required inside the following inline markup examples:
2452 - *2 * x  *a **b *.txt* (breaks 3)
2453 - *2*x a**b O(N**2) e**(x*y) f(x)*f(y) a*(1+2)* (breaks 4)
2455 It may be desirable to use `inline literals`_ for some of these anyhow,
2456 especially if they represent code snippets.  It's a judgment call.
2458 These cases *do* require either literal-quoting or escaping to avoid
2459 misinterpretation:
2461     \*4, class\_, \*args, \**kwargs, \`TeX-quoted', \*ML, \*.txt
2463 In most use cases, `inline literals`_ or `literal blocks`_ are the best
2464 choice (by default, this also selects a monospaced font)::
2466     *4, class_, *args, **kwargs, `TeX-quoted', *ML, *.txt
2468 Recognition order
2469 -----------------
2471 Inline markup delimiter characters are used for multiple constructs,
2472 so to avoid ambiguity there must be a specific recognition order for
2473 each character.  The inline markup recognition order is as follows:
2475 - Asterisks: `Strong emphasis`_ ("**") is recognized before emphasis_
2476   ("*").
2478 - Backquotes: `Inline literals`_ ("``"), `inline internal targets`_
2479   (leading "_`", trailing "`"), are mutually independent, and are
2480   recognized before phrase `hyperlink references`_ (leading "`",
2481   trailing "\`_") and `interpreted text`_ ("`").
2483 - Trailing underscores: Footnote references ("[" + label + "]_") and
2484   simple `hyperlink references`_ (name + trailing "_") are mutually
2485   independent.
2487 - Vertical bars: `Substitution references`_ ("|") are independently
2488   recognized.
2490 - `Standalone hyperlinks`_ are the last to be recognized.
2493 Character-Level Inline Markup
2494 -----------------------------
2496 It is possible to mark up individual characters within a word with
2497 backslash escapes (see `Escaping Mechanism`_ above).  Backslash
2498 escapes can be used to allow arbitrary text to immediately follow
2499 inline markup::
2501     Python ``list``\s use square bracket syntax.
2503 The backslash will disappear from the processed document.  The word
2504 "list" will appear as inline literal text, and the letter "s" will
2505 immediately follow it as normal text, with no space in-between.
2507 Arbitrary text may immediately precede inline markup using
2508 backslash-escaped whitespace::
2510     Possible in *re*\ ``Structured``\ *Text*, though not encouraged.
2512 The backslashes and spaces separating "re", "Structured", and "Text"
2513 above will disappear from the processed document.
2515 .. CAUTION::
2517    The use of backslash-escapes for character-level inline markup is
2518    not encouraged.  Such use is ugly and detrimental to the
2519    unprocessed document's readability.  Please use this feature
2520    sparingly and only where absolutely necessary.
2523 Emphasis
2524 --------
2526 Doctree element: emphasis.
2528 Start-string = end-string = "*".
2530 Text enclosed by single asterisk characters is emphasized::
2532     This is *emphasized text*.
2534 Emphasized text is typically displayed in italics.
2537 Strong Emphasis
2538 ---------------
2540 Doctree element: strong.
2542 Start-string = end-string = "**".
2544 Text enclosed by double-asterisks is emphasized strongly::
2546     This is **strong text**.
2548 Strongly emphasized text is typically displayed in boldface.
2551 Interpreted Text
2552 ----------------
2554 Doctree element: depends on the explicit or implicit role and
2555 processing.
2557 Start-string = end-string = "`".
2559 Interpreted text is text that is meant to be related, indexed, linked,
2560 summarized, or otherwise processed, but the text itself is typically
2561 left alone.  Interpreted text is enclosed by single backquote
2562 characters::
2564     This is `interpreted text`.
2566 The "role" of the interpreted text determines how the text is
2567 interpreted.  The role may be inferred implicitly (as above; the
2568 "default role" is used) or indicated explicitly, using a role marker.
2569 A role marker consists of a colon, the role name, and another colon.
2570 A role name is a single word consisting of alphanumerics plus isolated
2571 internal hyphens, underscores, plus signs, colons, and periods;
2572 no whitespace or other characters are allowed.  A role marker is
2573 either a prefix or a suffix to the interpreted text, whichever reads
2574 better; it's up to the author::
2576     :role:`interpreted text`
2578     `interpreted text`:role:
2580 Interpreted text allows extensions to the available inline descriptive
2581 markup constructs.  To emphasis_, `strong emphasis`_, `inline
2582 literals`_, and `hyperlink references`_, we can add "title reference",
2583 "index entry", "acronym", "class", "red", "blinking" or anything else
2584 we want.  Only pre-determined roles are recognized; unknown roles will
2585 generate errors.  A core set of standard roles is implemented in the
2586 reference parser; see `reStructuredText Interpreted Text Roles`_ for
2587 individual descriptions.  The role_ directive can be used to define
2588 custom interpreted text roles.  In addition, applications may support
2589 specialized roles.
2592 Inline Literals
2593 ---------------
2595 Doctree element: literal.
2597 Start-string = end-string = "``".
2599 Text enclosed by double-backquotes is treated as inline literals::
2601     This text is an example of ``inline literals``.
2603 Inline literals may contain any characters except two adjacent
2604 backquotes in an end-string context (according to the recognition
2605 rules above).  No markup interpretation (including backslash-escape
2606 interpretation) is done within inline literals.
2608 Line breaks are *not* preserved in inline literals.  Although a
2609 reStructuredText parser will preserve runs of spaces in its output,
2610 the final representation of the processed document is dependent on the
2611 output formatter, thus the preservation of whitespace cannot be
2612 guaranteed.  If the preservation of line breaks and/or other
2613 whitespace is important, `literal blocks`_ should be used.
2615 Inline literals are useful for short code snippets.  For example::
2617     The regular expression ``[+-]?(\d+(\.\d*)?|\.\d+)`` matches
2618     floating-point numbers (without exponents).
2621 Hyperlink References
2622 --------------------
2624 Doctree element: reference.
2626 - Named hyperlink references:
2628   - Start-string = "" (empty string), end-string = "_".
2629   - Start-string = "`", end-string = "\`_".  (Phrase references.)
2631 - Anonymous hyperlink references:
2633   - Start-string = "" (empty string), end-string = "__".
2634   - Start-string = "`", end-string = "\`__".  (Phrase references.)
2636 Hyperlink references are indicated by a trailing underscore, "_",
2637 except for `standalone hyperlinks`_ which are recognized
2638 independently.  The underscore can be thought of as a right-pointing
2639 arrow.  The trailing underscores point away from hyperlink references,
2640 and the leading underscores point toward `hyperlink targets`_.
2642 Hyperlinks consist of two parts.  In the text body, there is a source
2643 link, a reference name with a trailing underscore (or two underscores
2644 for `anonymous hyperlinks`_)::
2646     See the Python_ home page for info.
2648 A target link with a matching reference name must exist somewhere else
2649 in the document.  See `Hyperlink Targets`_ for a full description).
2651 `Anonymous hyperlinks`_ (which see) do not use reference names to
2652 match references to targets, but otherwise behave similarly to named
2653 hyperlinks.
2656 Embedded URIs and Aliases
2657 `````````````````````````
2659 A hyperlink reference may directly embed a target URI or (since
2660 Docutils 0.11) a hyperlink reference within angle brackets ("<...>")
2661 as follows::
2663     See the `Python home page <http://www.python.org>`_ for info.
2665     This `link <Python home page_>`_ is an alias to the link above.
2667 This is exactly equivalent to::
2669     See the `Python home page`_ for info.
2671     This link_ is an alias to the link above.
2673     .. _Python home page: http://www.python.org
2674     .. _link: `Python home page`_
2676 The bracketed URI must be preceded by whitespace and be the last text
2677 before the end string.
2679 With a single trailing underscore, the reference is named and the same
2680 target URI may be referred to again.
2681 With two trailing underscores, the reference and target are both
2682 anonymous, and the target cannot be referred to again.  These are
2683 "one-off" hyperlinks.  For example::
2685     `RFC 2396 <http://www.rfc-editor.org/rfc/rfc2396.txt>`__ and `RFC
2686     2732 <http://www.rfc-editor.org/rfc/rfc2732.txt>`__ together
2687     define the syntax of URIs.
2689 Equivalent to::
2691     `RFC 2396`__ and `RFC 2732`__ together define the syntax of URIs.
2693     __ http://www.rfc-editor.org/rfc/rfc2396.txt
2694     __ http://www.rfc-editor.org/rfc/rfc2732.txt
2696 `Standalone hyperlinks`_ are treated as URIs, even if they end with an
2697 underscore like in the example of a Python function documentation::
2699     `__init__ <http:example.py.html#__init__>`__
2701 If a target URI that is not recognized as `standalone hyperlink`_ happens
2702 to end with an underscore, this needs to be backslash-escaped to avoid
2703 being parsed as hyperlink reference. For example ::
2705     Use the `source <parrots.txt\_>`__.
2707 creates an anonymous reference to the file ``parrots.txt_``.
2709 If the reference text happens to end with angle-bracketed text that is
2710 *not* a URI or hyperlink reference, at least one angle-bracket needs to
2711 be backslash-escaped or an escaped space should follow. For example, here
2712 are three references to titles describing a tag::
2714     See `HTML Element: \<a>`_, `HTML Element: <b\> `_, and
2715     `HTML Element: <c>\ `_.
2717 The reference text may also be omitted, in which case the URI will be
2718 duplicated for use as the reference text.  This is useful for relative
2719 URIs where the address or file name is also the desired reference
2720 text::
2722     See `<a_named_relative_link>`_ or `<an_anonymous_relative_link>`__
2723     for details.
2725 .. CAUTION::
2727    This construct offers easy authoring and maintenance of hyperlinks
2728    at the expense of general readability.  Inline URIs, especially
2729    long ones, inevitably interrupt the natural flow of text.  For
2730    documents meant to be read in source form, the use of independent
2731    block-level `hyperlink targets`_ is **strongly recommended**.  The
2732    embedded URI construct is most suited to documents intended *only*
2733    to be read in processed form.
2736 Inline Internal Targets
2737 ------------------------
2739 Doctree element: target.
2741 Start-string = "_`", end-string = "`".
2743 Inline internal targets are the equivalent of explicit `internal
2744 hyperlink targets`_, but may appear within running text.  The syntax
2745 begins with an underscore and a backquote, is followed by a hyperlink
2746 name or phrase, and ends with a backquote.  Inline internal targets
2747 may not be anonymous.
2749 For example, the following paragraph contains a hyperlink target named
2750 "Norwegian Blue"::
2752     Oh yes, the _`Norwegian Blue`.  What's, um, what's wrong with it?
2754 See `Implicit Hyperlink Targets`_ for the resolution of duplicate
2755 reference names.
2758 Footnote References
2759 -------------------
2761 Doctree element: footnote_reference.
2763 Start-string = "[", end-string = "]_".
2765 Each footnote reference consists of a square-bracketed label followed
2766 by a trailing underscore.  Footnote labels are one of:
2768 - one or more digits (i.e., a number),
2770 - a single "#" (denoting `auto-numbered footnotes`_),
2772 - a "#" followed by a simple reference name (an `autonumber label`_),
2773   or
2775 - a single "*" (denoting `auto-symbol footnotes`_).
2777 For example::
2779     Please RTFM [1]_.
2781     .. [1] Read The Fine Manual
2784 Citation References
2785 -------------------
2787 Doctree element: citation_reference.
2789 Start-string = "[", end-string = "]_".
2791 Each citation reference consists of a square-bracketed label followed
2792 by a trailing underscore.  Citation labels are simple `reference
2793 names`_ (case-insensitive single words, consisting of alphanumerics
2794 plus internal hyphens, underscores, and periods; no whitespace).
2796 For example::
2798     Here is a citation reference: [CIT2002]_.
2800 See Citations_ for the citation itself.
2803 Substitution References
2804 -----------------------
2806 Doctree element: substitution_reference, reference.
2808 Start-string = "|", end-string = "|" (optionally followed by "_" or
2809 "__").
2811 Vertical bars are used to bracket the substitution reference text.  A
2812 substitution reference may also be a hyperlink reference by appending
2813 a "_" (named) or "__" (anonymous) suffix; the substitution text is
2814 used for the reference text in the named case.
2816 The processing system replaces substitution references with the
2817 processed contents of the corresponding `substitution definitions`_
2818 (which see for the definition of "correspond").  Substitution
2819 definitions produce inline-compatible elements.
2821 Examples::
2823     This is a simple |substitution reference|.  It will be replaced by
2824     the processing system.
2826     This is a combination |substitution and hyperlink reference|_.  In
2827     addition to being replaced, the replacement text or element will
2828     refer to the "substitution and hyperlink reference" target.
2830 .. _standalone hyperlink:
2832 Standalone Hyperlinks
2833 ---------------------
2835 Doctree element: reference.
2837 Start-string = end-string = "" (empty string).
2839 A URI (absolute URI [#URI]_ or standalone email address) within a text
2840 block is treated as a general external hyperlink with the URI itself
2841 as the link's text.  For example::
2843     See http://www.python.org for info.
2845 would be marked up in HTML as::
2847     See <a href="http://www.python.org">http://www.python.org</a> for
2848     info.
2850 Two forms of URI are recognized:
2852 1. Absolute URIs.  These consist of a scheme, a colon (":"), and a
2853    scheme-specific part whose interpretation depends on the scheme.
2855    The scheme is the name of the protocol, such as "http", "ftp",
2856    "mailto", or "telnet".  The scheme consists of an initial letter,
2857    followed by letters, numbers, and/or "+", "-", ".".  Recognition is
2858    limited to known schemes, per the `Official IANA Registry of URI
2859    Schemes`_ and the W3C's `Retired Index of WWW Addressing Schemes`_.
2861    The scheme-specific part of the resource identifier may be either
2862    hierarchical or opaque:
2864    - Hierarchical identifiers begin with one or two slashes and may
2865      use slashes to separate hierarchical components of the path.
2866      Examples are web pages and FTP sites::
2868          http://www.python.org
2870          ftp://ftp.python.org/pub/python
2872    - Opaque identifiers do not begin with slashes.  Examples are
2873      email addresses and newsgroups::
2875          mailto:someone@somewhere.com
2877          news:comp.lang.python
2879    With queries, fragments, and %-escape sequences, URIs can become
2880    quite complicated.  A reStructuredText parser must be able to
2881    recognize any absolute URI, as defined in RFC2396_ and RFC2732_.
2883 2. Standalone email addresses, which are treated as if they were
2884    absolute URIs with a "mailto:" scheme.  Example::
2886        someone@somewhere.com
2888 Punctuation at the end of a URI is not considered part of the URI,
2889 unless the URI is terminated by a closing angle bracket (">").
2890 Backslashes may be used in URIs to escape markup characters,
2891 specifically asterisks ("*") and underscores ("_") which are vaid URI
2892 characters (see `Escaping Mechanism`_ above).
2894 .. [#URI] Uniform Resource Identifier.  URIs are a general form of
2895    URLs (Uniform Resource Locators).  For the syntax of URIs see
2896    RFC2396_ and RFC2732_.
2899 Units
2900 =====
2902 (New in Docutils 0.3.10.)
2904 All measures consist of a positive floating point number in standard
2905 (non-scientific) notation and a unit, possibly separated by one or
2906 more spaces.
2908 Units are only supported where explicitly mentioned in the reference
2909 manuals.
2912 Length Units
2913 ------------
2915 The following length units are supported by the reStructuredText
2916 parser:
2918 * em (ems, the height of the element's font)
2919 * ex (x-height, the height of the letter "x")
2920 * px (pixels, relative to the canvas resolution)
2921 * in (inches; 1in=2.54cm)
2922 * cm (centimeters; 1cm=10mm)
2923 * mm (millimeters)
2924 * pt (points; 1pt=1/72in)
2925 * pc (picas; 1pc=12pt)
2927 This set corresponds to the `length units in CSS`_.
2929 (List and explanations taken from
2930 http://www.htmlhelp.com/reference/css/units.html#length.)
2932 The following are all valid length values: "1.5em", "20 mm", ".5in".
2934 Length values without unit are completed with a writer-dependent
2935 default (e.g. px with `html4css1`, pt with `latex2e`). See the writer
2936 specific documentation in the `user doc`__ for details.
2938 .. _length units in CSS:
2939    http://www.w3.org/TR/CSS2/syndata.html#length-units
2941 __ ../../user/
2943 Percentage Units
2944 ----------------
2946 Percentage values have a percent sign ("%") as unit.  Percentage
2947 values are relative to other values, depending on the context in which
2948 they occur.
2951 ----------------
2952  Error Handling
2953 ----------------
2955 Doctree element: system_message, problematic.
2957 Markup errors are handled according to the specification in `PEP
2958 258`_.
2961 .. _reStructuredText: http://docutils.sourceforge.net/rst.html
2962 .. _Docutils: http://docutils.sourceforge.net/
2963 .. _The Docutils Document Tree: ../doctree.html
2964 .. _Docutils Generic DTD: ../docutils.dtd
2965 .. _transforms:
2966    http://docutils.sourceforge.net/docutils/transforms/
2967 .. _Grouch: http://www.mems-exchange.org/software/grouch/
2968 .. _RFC822: http://www.rfc-editor.org/rfc/rfc822.txt
2969 .. _DocTitle transform:
2970 .. _DocInfo transform:
2971    http://docutils.sourceforge.net/docutils/transforms/frontmatter.py
2972 .. _getopt.py:
2973    http://www.python.org/doc/current/lib/module-getopt.html
2974 .. _GNU libc getopt_long():
2975    http://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Options.html
2976 .. _doctest module:
2977    http://www.python.org/doc/current/lib/module-doctest.html
2978 .. _Emacs table mode: http://table.sourceforge.net/
2979 .. _Official IANA Registry of URI Schemes:
2980    http://www.iana.org/assignments/uri-schemes
2981 .. _Retired Index of WWW Addressing Schemes:
2982    http://www.w3.org/Addressing/schemes.html
2983 .. _World Wide Web Consortium: http://www.w3.org/
2984 .. _HTML Techniques for Web Content Accessibility Guidelines:
2985    http://www.w3.org/TR/WCAG10-HTML-TECHS/#link-text
2986 .. _image: directives.html#image
2987 .. _replace: directives.html#replace
2988 .. _meta: directives.html#meta
2989 .. _figure: directives.html#figure
2990 .. _admonition: directives.html#admonitions
2991 .. _role: directives.html#custom-interpreted-text-roles
2992 .. _reStructuredText Directives: directives.html
2993 .. _reStructuredText Interpreted Text Roles: roles.html
2994 .. _RFC2396: http://www.rfc-editor.org/rfc/rfc2396.txt
2995 .. _RFC2732: http://www.rfc-editor.org/rfc/rfc2732.txt
2996 .. _Zope: http://www.zope.com/
2997 .. _PEP 258: ../../peps/pep-0258.html
3001    Local Variables:
3002    mode: indented-text
3003    indent-tabs-mode: nil
3004    sentence-end-double-space: t
3005    fill-column: 70
3006    End: