Minor edit of inline markup documentation (no change of behaviour).
[docutils.git] / docs / ref / rst / restructuredtext.txt
blob1b4a465b631141bd8f02485c299b246527d610b1
1 .. -*- coding: utf-8 -*-
3 =======================================
4  reStructuredText Markup Specification
5 =======================================
7 :Author: David Goodger
8 :Contact: goodger@python.org
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`_ below.
1867 3. _`Indirect hyperlink targets` have a hyperlink reference in their
1868    link blocks.  In the following example, target "one" indirectly
1869    references whatever target "two" references, and target "two"
1870    references target "three", an internal hyperlink target.  In
1871    effect, all three reference the same thing::
1873        .. _one: two_
1874        .. _two: three_
1875        .. _three:
1877    Just as with `hyperlink references`_ anywhere else in a document,
1878    if a phrase-reference is used in the link block it must be enclosed
1879    in backquotes.  As with `external hyperlink targets`_, the link
1880    block of an indirect hyperlink target may begin on the same line as
1881    the explicit markup start or the next line.  It may also be split
1882    over multiple lines, in which case the lines are joined with
1883    whitespace before being normalized.
1885    For example, the following indirect hyperlink targets are
1886    equivalent::
1888        .. _one-liner: `A HYPERLINK`_
1889        .. _entirely-below:
1890           `a    hyperlink`_
1891        .. _split: `A
1892           Hyperlink`_
1894 If the reference name contains any colons, either:
1896 - the phrase must be enclosed in backquotes::
1898       .. _`FAQTS: Computers: Programming: Languages: Python`:
1899          http://python.faqts.com/
1901 - or the colon(s) must be backslash-escaped in the link target::
1903       .. _Chapter One\: "Tadpole Days":
1905       It's not easy being green...
1907 See `Implicit Hyperlink Targets`_ below for the resolution of
1908 duplicate reference names.
1910 Syntax diagram::
1912     +-------+----------------------+
1913     | ".. " | "_" name ":" link    |
1914     +-------+ block                |
1915             |                      |
1916             +----------------------+
1919 Anonymous Hyperlinks
1920 ....................
1922 The `World Wide Web Consortium`_ recommends in its `HTML Techniques
1923 for Web Content Accessibility Guidelines`_ that authors should
1924 "clearly identify the target of each link."  Hyperlink references
1925 should be as verbose as possible, but duplicating a verbose hyperlink
1926 name in the target is onerous and error-prone.  Anonymous hyperlinks
1927 are designed to allow convenient verbose hyperlink references, and are
1928 analogous to `Auto-Numbered Footnotes`_.  They are particularly useful
1929 in short or one-off documents.  However, this feature is easily abused
1930 and can result in unreadable plaintext and/or unmaintainable
1931 documents.  Caution is advised.
1933 Anonymous `hyperlink references`_ are specified with two underscores
1934 instead of one::
1936     See `the web site of my favorite programming language`__.
1938 Anonymous targets begin with ".. __:"; no reference name is required
1939 or allowed::
1941     .. __: http://www.python.org
1943 As a convenient alternative, anonymous targets may begin with "__"
1944 only::
1946     __ http://www.python.org
1948 The reference name of the reference is not used to match the reference
1949 to its target.  Instead, the order of anonymous hyperlink references
1950 and targets within the document is significant: the first anonymous
1951 reference will link to the first anonymous target.  The number of
1952 anonymous hyperlink references in a document must match the number of
1953 anonymous targets.  For readability, it is recommended that targets be
1954 kept close to references.  Take care when editing text containing
1955 anonymous references; adding, removing, and rearranging references
1956 require attention to the order of corresponding targets.
1959 Directives
1960 ``````````
1962 Doctree elements: depend on the directive.
1964 Directives are an extension mechanism for reStructuredText, a way of
1965 adding support for new constructs without adding new primary syntax
1966 (directives may support additional syntax locally).  All standard
1967 directives (those implemented and registered in the reference
1968 reStructuredText parser) are described in the `reStructuredText
1969 Directives`_ document, and are always available.  Any other directives
1970 are domain-specific, and may require special action to make them
1971 available when processing the document.
1973 For example, here's how an image_ may be placed::
1975     .. image:: mylogo.jpeg
1977 A figure_ (a graphic with a caption) may placed like this::
1979     .. figure:: larch.png
1981        The larch.
1983 An admonition_ (note, caution, etc.) contains other body elements::
1985     .. note:: This is a paragraph
1987        - Here is a bullet list.
1989 Directives are indicated by an explicit markup start (".. ") followed
1990 by the directive type, two colons, and whitespace (together called the
1991 "directive marker").  Directive types are case-insensitive single
1992 words (alphanumerics plus isolated internal hyphens, underscores,
1993 plus signs, colons, and periods; no whitespace).  Two colons are used
1994 after the directive type for these reasons:
1996 - Two colons are distinctive, and unlikely to be used in common text.
1998 - Two colons avoids clashes with common comment text like::
2000       .. Danger: modify at your own risk!
2002 - If an implementation of reStructuredText does not recognize a
2003   directive (i.e., the directive-handler is not installed), a level-3
2004   (error) system message is generated, and the entire directive block
2005   (including the directive itself) will be included as a literal
2006   block.  Thus "::" is a natural choice.
2008 The directive block is consists of any text on the first line of the
2009 directive after the directive marker, and any subsequent indented
2010 text.  The interpretation of the directive block is up to the
2011 directive code.  There are three logical parts to the directive block:
2013 1. Directive arguments.
2014 2. Directive options.
2015 3. Directive content.
2017 Individual directives can employ any combination of these parts.
2018 Directive arguments can be filesystem paths, URLs, title text, etc.
2019 Directive options are indicated using `field lists`_; the field names
2020 and contents are directive-specific.  Arguments and options must form
2021 a contiguous block beginning on the first or second line of the
2022 directive; a blank line indicates the beginning of the directive
2023 content block.  If either arguments and/or options are employed by the
2024 directive, a blank line must separate them from the directive content.
2025 The "figure" directive employs all three parts::
2027     .. figure:: larch.png
2028        :scale: 50
2030        The larch.
2032 Simple directives may not require any content.  If a directive that
2033 does not employ a content block is followed by indented text anyway,
2034 it is an error.  If a block quote should immediately follow a
2035 directive, use an empty comment in-between (see Comments_ below).
2037 Actions taken in response to directives and the interpretation of text
2038 in the directive content block or subsequent text block(s) are
2039 directive-dependent.  See `reStructuredText Directives`_ for details.
2041 Directives are meant for the arbitrary processing of their contents,
2042 which can be transformed into something possibly unrelated to the
2043 original text.  It may also be possible for directives to be used as
2044 pragmas, to modify the behavior of the parser, such as to experiment
2045 with alternate syntax.  There is no parser support for this
2046 functionality at present; if a reasonable need for pragma directives
2047 is found, they may be supported.
2049 Directives do not generate "directive" elements; they are a *parser
2050 construct* only, and have no intrinsic meaning outside of
2051 reStructuredText.  Instead, the parser will transform recognized
2052 directives into (possibly specialized) document elements.  Unknown
2053 directives will trigger level-3 (error) system messages.
2055 Syntax diagram::
2057     +-------+-------------------------------+
2058     | ".. " | directive type "::" directive |
2059     +-------+ block                         |
2060             |                               |
2061             +-------------------------------+
2064 Substitution Definitions
2065 ````````````````````````
2067 Doctree element: substitution_definition.
2069 Substitution definitions are indicated by an explicit markup start
2070 (".. ") followed by a vertical bar, the substitution text, another
2071 vertical bar, whitespace, and the definition block.  Substitution text
2072 may not begin or end with whitespace.  A substitution definition block
2073 contains an embedded inline-compatible directive (without the leading
2074 ".. "), such as "image_" or "replace_".  For example::
2076     The |biohazard| symbol must be used on containers used to
2077     dispose of medical waste.
2079     .. |biohazard| image:: biohazard.png
2081 It is an error for a substitution definition block to directly or
2082 indirectly contain a circular substitution reference.
2084 `Substitution references`_ are replaced in-line by the processed
2085 contents of the corresponding definition (linked by matching
2086 substitution text).  Matches are case-sensitive but forgiving; if no
2087 exact match is found, a case-insensitive comparison is attempted.
2089 Substitution definitions allow the power and flexibility of
2090 block-level directives_ to be shared by inline text.  They are a way
2091 to include arbitrarily complex inline structures within text, while
2092 keeping the details out of the flow of text.  They are the equivalent
2093 of SGML/XML's named entities or programming language macros.
2095 Without the substitution mechanism, every time someone wants an
2096 application-specific new inline structure, they would have to petition
2097 for a syntax change.  In combination with existing directive syntax,
2098 any inline structure can be coded without new syntax (except possibly
2099 a new directive).
2101 Syntax diagram::
2103     +-------+-----------------------------------------------------+
2104     | ".. " | "|" substitution text "| " directive type "::" data |
2105     +-------+ directive block                                     |
2106             |                                                     |
2107             +-----------------------------------------------------+
2109 Following are some use cases for the substitution mechanism.  Please
2110 note that most of the embedded directives shown are examples only and
2111 have not been implemented.
2113 Objects
2114     Substitution references may be used to associate ambiguous text
2115     with a unique object identifier.
2117     For example, many sites may wish to implement an inline "user"
2118     directive::
2120         |Michael| and |Jon| are our widget-wranglers.
2122         .. |Michael| user:: mjones
2123         .. |Jon|     user:: jhl
2125     Depending on the needs of the site, this may be used to index the
2126     document for later searching, to hyperlink the inline text in
2127     various ways (mailto, homepage, mouseover Javascript with profile
2128     and contact information, etc.), or to customize presentation of
2129     the text (include username in the inline text, include an icon
2130     image with a link next to the text, make the text bold or a
2131     different color, etc.).
2133     The same approach can be used in documents which frequently refer
2134     to a particular type of objects with unique identifiers but
2135     ambiguous common names.  Movies, albums, books, photos, court
2136     cases, and laws are possible.  For example::
2138         |The Transparent Society| offers a fascinating alternate view
2139         on privacy issues.
2141         .. |The Transparent Society| book:: isbn=0738201448
2143     Classes or functions, in contexts where the module or class names
2144     are unclear and/or interpreted text cannot be used, are another
2145     possibility::
2147         4XSLT has the convenience method |runString|, so you don't
2148         have to mess with DOM objects if all you want is the
2149         transformed output.
2151         .. |runString| function:: module=xml.xslt class=Processor
2153 Images
2154     Images are a common use for substitution references::
2156         West led the |H| 3, covered by dummy's |H| Q, East's |H| K,
2157         and trumped in hand with the |S| 2.
2159         .. |H| image:: /images/heart.png
2160            :height: 11
2161            :width: 11
2162         .. |S| image:: /images/spade.png
2163            :height: 11
2164            :width: 11
2166         * |Red light| means stop.
2167         * |Green light| means go.
2168         * |Yellow light| means go really fast.
2170         .. |Red light|    image:: red_light.png
2171         .. |Green light|  image:: green_light.png
2172         .. |Yellow light| image:: yellow_light.png
2174         |-><-| is the official symbol of POEE_.
2176         .. |-><-| image:: discord.png
2177         .. _POEE: http://www.poee.org/
2179     The "image_" directive has been implemented.
2181 Styles [#]_
2182     Substitution references may be used to associate inline text with
2183     an externally defined presentation style::
2185         Even |the text in Texas| is big.
2187         .. |the text in Texas| style:: big
2189     The style name may be meaningful in the context of some particular
2190     output format (CSS class name for HTML output, LaTeX style name
2191     for LaTeX, etc), or may be ignored for other output formats (such
2192     as plaintext).
2194     .. @@@ This needs to be rethought & rewritten or removed:
2196        Interpreted text is unsuitable for this purpose because the set
2197        of style names cannot be predefined - it is the domain of the
2198        content author, not the author of the parser and output
2199        formatter - and there is no way to associate a style name
2200        argument with an interpreted text style role.  Also, it may be
2201        desirable to use the same mechanism for styling blocks::
2203            .. style:: motto
2204               At Bob's Underwear Shop, we'll do anything to get in
2205               your pants.
2207            .. style:: disclaimer
2208               All rights reversed.  Reprint what you like.
2210     .. [#] There may be sufficient need for a "style" mechanism to
2211        warrant simpler syntax such as an extension to the interpreted
2212        text role syntax.  The substitution mechanism is cumbersome for
2213        simple text styling.
2215 Templates
2216     Inline markup may be used for later processing by a template
2217     engine.  For example, a Zope_ author might write::
2219         Welcome back, |name|!
2221         .. |name| tal:: replace user/getUserName
2223     After processing, this ZPT output would result::
2225         Welcome back,
2226         <span tal:replace="user/getUserName">name</span>!
2228     Zope would then transform this to something like "Welcome back,
2229     David!" during a session with an actual user.
2231 Replacement text
2232     The substitution mechanism may be used for simple macro
2233     substitution.  This may be appropriate when the replacement text
2234     is repeated many times throughout one or more documents,
2235     especially if it may need to change later.  A short example is
2236     unavoidably contrived::
2238         |RST|_ is a little annoying to type over and over, especially
2239         when writing about |RST| itself, and spelling out the
2240         bicapitalized word |RST| every time isn't really necessary for
2241         |RST| source readability.
2243         .. |RST| replace:: reStructuredText
2244         .. _RST: http://docutils.sourceforge.net/rst.html
2246     Note the trailing underscore in the first use of a substitution
2247     reference.  This indicates a reference to the corresponding
2248     hyperlink target.
2250     Substitution is also appropriate when the replacement text cannot
2251     be represented using other inline constructs, or is obtrusively
2252     long::
2254         But still, that's nothing compared to a name like
2255         |j2ee-cas|__.
2257         .. |j2ee-cas| replace::
2258            the Java `TM`:super: 2 Platform, Enterprise Edition Client
2259            Access Services
2260         __ http://developer.java.sun.com/developer/earlyAccess/
2261            j2eecas/
2263     The "replace_" directive has been implemented.
2266 Comments
2267 ````````
2269 Doctree element: comment.
2271 Arbitrary indented text may follow the explicit markup start and will
2272 be processed as a comment element.  No further processing is done on
2273 the comment block text; a comment contains a single "text blob".
2274 Depending on the output formatter, comments may be removed from the
2275 processed output.  The only restriction on comments is that they not
2276 use the same syntax as any of the other explicit markup constructs:
2277 substitution definitions, directives, footnotes, citations, or
2278 hyperlink targets.  To ensure that none of the other explicit markup
2279 constructs is recognized, leave the ".." on a line by itself::
2281     .. This is a comment
2282     ..
2283        _so: is this!
2284     ..
2285        [and] this!
2286     ..
2287        this:: too!
2288     ..
2289        |even| this:: !
2291 .. _empty comments:
2293 An explicit markup start followed by a blank line and nothing else
2294 (apart from whitespace) is an "_`empty comment`".  It serves to
2295 terminate a preceding construct, and does **not** consume any indented
2296 text following.  To have a block quote follow a list or any indented
2297 construct, insert an unindented empty comment in-between.
2299 Syntax diagram::
2301     +-------+----------------------+
2302     | ".. " | comment              |
2303     +-------+ block                |
2304             |                      |
2305             +----------------------+
2308 Implicit Hyperlink Targets
2309 ==========================
2311 Implicit hyperlink targets are generated by section titles, footnotes,
2312 and citations, and may also be generated by extension constructs.
2313 Implicit hyperlink targets otherwise behave identically to explicit
2314 `hyperlink targets`_.
2316 Problems of ambiguity due to conflicting duplicate implicit and
2317 explicit reference names are avoided by following this procedure:
2319 1. `Explicit hyperlink targets`_ override any implicit targets having
2320    the same reference name.  The implicit hyperlink targets are
2321    removed, and level-1 (info) system messages are inserted.
2323 2. Duplicate implicit hyperlink targets are removed, and level-1
2324    (info) system messages inserted.  For example, if two or more
2325    sections have the same title (such as "Introduction" subsections of
2326    a rigidly-structured document), there will be duplicate implicit
2327    hyperlink targets.
2329 3. Duplicate explicit hyperlink targets are removed, and level-2
2330    (warning) system messages are inserted.  Exception: duplicate
2331    `external hyperlink targets`_ (identical hyperlink names and
2332    referenced URIs) do not conflict, and are not removed.
2334 System messages are inserted where target links have been removed.
2335 See "Error Handling" in `PEP 258`_.
2337 The parser must return a set of *unique* hyperlink targets.  The
2338 calling software (such as the Docutils_) can warn of unresolvable
2339 links, giving reasons for the messages.
2342 Inline Markup
2343 =============
2345 In reStructuredText, inline markup applies to words or phrases within
2346 a text block.  The same whitespace and punctuation that serves to
2347 delimit words in written text is used to delimit the inline markup
2348 syntax constructs.  The text within inline markup may not begin or end
2349 with whitespace.  Arbitrary `character-level inline markup`_ is
2350 supported although not encouraged.  Inline markup cannot be nested.
2352 There are nine inline markup constructs.  Five of the constructs use
2353 identical start-strings and end-strings to indicate the markup:
2355 - emphasis_: "*"
2356 - `strong emphasis`_: "**"
2357 - `interpreted text`_: "`"
2358 - `inline literals`_: "``"
2359 - `substitution references`_: "|"
2361 Three constructs use different start-strings and end-strings:
2363 - `inline internal targets`_: "_`" and "`"
2364 - `footnote references`_: "[" and "]_"
2365 - `hyperlink references`_: "`" and "\`_" (phrases), or just a
2366   trailing "_" (single words)
2368 `Standalone hyperlinks`_ are recognized implicitly, and use no extra
2369 markup.
2371 The inline markup start-string and end-string recognition rules are as
2372 follows.  If any of the conditions are not met, the start-string or
2373 end-string will not be recognized or processed.
2375 1. Inline markup start-strings must start a text block or be
2376    immediately preceded by whitespace, one of the ASCII
2377    characters ``( [ { <``, or the Unicode characters:
2379        .. class:: borderless
2381        ===  ==========================================================
2382        ‘    (U+2018, left single-quote)
2383        “    (U+201C, left double-quote)
2384        ’    (U+2019, apostrophe)
2385        «    (U+00AB, left guillemet, or double angle quotation mark)
2386        ¡    (U+00A1, inverted exclamation mark)
2387        ¿    (U+00BF, inverted question mark)
2388        ===  ==========================================================
2390    The ASCII characters ``" ' - / :`` and the Unicode characters
2392        .. class:: borderless
2394        ===  ==========================================================
2395        ‐    (U+2010, hyphen)
2396        ‑    (U+2011, non-breaking hyphen)
2397        ‒    (U+2012, figure dash)
2398        –    (U+2013, en dash)
2399        —    (U+2014, em dash)
2401        " "  (U+00A0, non-breaking space [between the quotes])
2402        ===  ==========================================================
2404    are _`delimiters`. They may precede or follow inline markup.
2406 2. Inline markup start-strings must be immediately followed by
2407    non-whitespace.
2409 3. Inline markup end-strings must be immediately preceded by
2410    non-whitespace.
2412 4. Inline markup end-strings must end a text block or be immediately
2413    followed by whitespace, the ASCII characters
2414    ``) ] } > . , ; ! ? \`` or the Unicode characters:
2416        .. class:: borderless
2418        ===  ==========================================================
2419        ’    (U+2019, right single-quote, or apostrophe)
2420        ”    (U+201D, right double-quote)
2421        »    (U+00BB, right guillemet, or double angle quotation mark)
2422        ===  ==========================================================
2424    The `delimiters`_ listed in (1) above may precede or follow inline
2425    markup.
2427 5. If an inline markup start-string is immediately preceded by a
2428    single or double quote, "(", "[", "{", or "<", it must not be
2429    immediately followed by the corresponding single or double quote,
2430    ")", "]", "}", or ">".
2432 6. An inline markup end-string must be separated by at least one
2433    character from the start-string.
2435 7. An unescaped backslash preceding a start-string or end-string will
2436    disable markup recognition, except for the end-string of `inline
2437    literals`_.  See `Escaping Mechanism`_ above for details.
2439 For example, none of the following are recognized as containing inline
2440 markup start-strings:
2442 - asterisks: * "*" '*' (*) (* [*] {*} 1*x BOM32_*
2443 - double asterisks: **  a**b O(N**2) etc.
2444 - backquotes: ` `` etc.
2445 - underscores: _ __ __init__ __init__() etc.
2446 - vertical bars: | || etc.
2448 It may be desirable to use inline literals for some of these anyhow,
2449 especially if they represent code snippets.  It's a judgment call.
2451 These cases *do* require either literal-quoting or escaping to avoid
2452 misinterpretation::
2454     *4, class_, *args, **kwargs, `TeX-quoted', *ML, *.txt
2456 The inline markup recognition rules were devised intentionally to
2457 allow 90% of non-markup uses of "*", "`", "_", and "|" *without*
2458 resorting to backslashes.  For 9 of the remaining 10%, use inline
2459 literals or literal blocks::
2461     "``\*``" -> "\*" (possibly in another font or quoted)
2463 Only those who understand the escaping and inline markup rules should
2464 attempt the remaining 1%.  ;-)
2466 Inline markup delimiter characters are used for multiple constructs,
2467 so to avoid ambiguity there must be a specific recognition order for
2468 each character.  The inline markup recognition order is as follows:
2470 - Asterisks: `Strong emphasis`_ ("**") is recognized before emphasis_
2471   ("*").
2473 - Backquotes: `Inline literals`_ ("``"), `inline internal targets`_
2474   (leading "_`", trailing "`"), are mutually independent, and are
2475   recognized before phrase `hyperlink references`_ (leading "`",
2476   trailing "\`_") and `interpreted text`_ ("`").
2478 - Trailing underscores: Footnote references ("[" + label + "]_") and
2479   simple `hyperlink references`_ (name + trailing "_") are mutually
2480   independent.
2482 - Vertical bars: `Substitution references`_ ("|") are independently
2483   recognized.
2485 - `Standalone hyperlinks`_ are the last to be recognized.
2488 Character-Level Inline Markup
2489 -----------------------------
2491 It is possible to mark up individual characters within a word with
2492 backslash escapes (see `Escaping Mechanism`_ above).  Backslash
2493 escapes can be used to allow arbitrary text to immediately follow
2494 inline markup::
2496     Python ``list``\s use square bracket syntax.
2498 The backslash will disappear from the processed document.  The word
2499 "list" will appear as inline literal text, and the letter "s" will
2500 immediately follow it as normal text, with no space in-between.
2502 Arbitrary text may immediately precede inline markup using
2503 backslash-escaped whitespace::
2505     Possible in *re*\ ``Structured``\ *Text*, though not encouraged.
2507 The backslashes and spaces separating "re", "Structured", and "Text"
2508 above will disappear from the processed document.
2510 .. CAUTION::
2512    The use of backslash-escapes for character-level inline markup is
2513    not encouraged.  Such use is ugly and detrimental to the
2514    unprocessed document's readability.  Please use this feature
2515    sparingly and only where absolutely necessary.
2518 Emphasis
2519 --------
2521 Doctree element: emphasis.
2523 Start-string = end-string = "*".
2525 Text enclosed by single asterisk characters is emphasized::
2527     This is *emphasized text*.
2529 Emphasized text is typically displayed in italics.
2532 Strong Emphasis
2533 ---------------
2535 Doctree element: strong.
2537 Start-string = end-string = "**".
2539 Text enclosed by double-asterisks is emphasized strongly::
2541     This is **strong text**.
2543 Strongly emphasized text is typically displayed in boldface.
2546 Interpreted Text
2547 ----------------
2549 Doctree element: depends on the explicit or implicit role and
2550 processing.
2552 Start-string = end-string = "`".
2554 Interpreted text is text that is meant to be related, indexed, linked,
2555 summarized, or otherwise processed, but the text itself is typically
2556 left alone.  Interpreted text is enclosed by single backquote
2557 characters::
2559     This is `interpreted text`.
2561 The "role" of the interpreted text determines how the text is
2562 interpreted.  The role may be inferred implicitly (as above; the
2563 "default role" is used) or indicated explicitly, using a role marker.
2564 A role marker consists of a colon, the role name, and another colon.
2565 A role name is a single word consisting of alphanumerics plus isolated
2566 internal hyphens, underscores, plus signs, colons, and periods;
2567 no whitespace or other characters are allowed.  A role marker is
2568 either a prefix or a suffix to the interpreted text, whichever reads
2569 better; it's up to the author::
2571     :role:`interpreted text`
2573     `interpreted text`:role:
2575 Interpreted text allows extensions to the available inline descriptive
2576 markup constructs.  To emphasis_, `strong emphasis`_, `inline
2577 literals`_, and `hyperlink references`_, we can add "title reference",
2578 "index entry", "acronym", "class", "red", "blinking" or anything else
2579 we want.  Only pre-determined roles are recognized; unknown roles will
2580 generate errors.  A core set of standard roles is implemented in the
2581 reference parser; see `reStructuredText Interpreted Text Roles`_ for
2582 individual descriptions.  The role_ directive can be used to define
2583 custom interpreted text roles.  In addition, applications may support
2584 specialized roles.
2587 Inline Literals
2588 ---------------
2590 Doctree element: literal.
2592 Start-string = end-string = "``".
2594 Text enclosed by double-backquotes is treated as inline literals::
2596     This text is an example of ``inline literals``.
2598 Inline literals may contain any characters except two adjacent
2599 backquotes in an end-string context (according to the recognition
2600 rules above).  No markup interpretation (including backslash-escape
2601 interpretation) is done within inline literals.
2603 Line breaks are *not* preserved in inline literals.  Although a
2604 reStructuredText parser will preserve runs of spaces in its output,
2605 the final representation of the processed document is dependent on the
2606 output formatter, thus the preservation of whitespace cannot be
2607 guaranteed.  If the preservation of line breaks and/or other
2608 whitespace is important, `literal blocks`_ should be used.
2610 Inline literals are useful for short code snippets.  For example::
2612     The regular expression ``[+-]?(\d+(\.\d*)?|\.\d+)`` matches
2613     floating-point numbers (without exponents).
2616 Hyperlink References
2617 --------------------
2619 Doctree element: reference.
2621 - Named hyperlink references:
2623   - Start-string = "" (empty string), end-string = "_".
2624   - Start-string = "`", end-string = "\`_".  (Phrase references.)
2626 - Anonymous hyperlink references:
2628   - Start-string = "" (empty string), end-string = "__".
2629   - Start-string = "`", end-string = "\`__".  (Phrase references.)
2631 Hyperlink references are indicated by a trailing underscore, "_",
2632 except for `standalone hyperlinks`_ which are recognized
2633 independently.  The underscore can be thought of as a right-pointing
2634 arrow.  The trailing underscores point away from hyperlink references,
2635 and the leading underscores point toward `hyperlink targets`_.
2637 Hyperlinks consist of two parts.  In the text body, there is a source
2638 link, a reference name with a trailing underscore (or two underscores
2639 for `anonymous hyperlinks`_)::
2641     See the Python_ home page for info.
2643 A target link with a matching reference name must exist somewhere else
2644 in the document.  See `Hyperlink Targets`_ for a full description).
2646 `Anonymous hyperlinks`_ (which see) do not use reference names to
2647 match references to targets, but otherwise behave similarly to named
2648 hyperlinks.
2651 Embedded URIs
2652 `````````````
2654 A hyperlink reference may directly embed a target URI inline, within
2655 angle brackets ("<...>") as follows::
2657     See the `Python home page <http://www.python.org>`_ for info.
2659 This is exactly equivalent to::
2661     See the `Python home page`_ for info.
2663     .. _Python home page: http://www.python.org
2665 The bracketed URI must be preceded by whitespace and be the last text
2666 before the end string.  With a single trailing underscore, the
2667 reference is named and the same target URI may be referred to again.
2669 With two trailing underscores, the reference and target are both
2670 anonymous, and the target cannot be referred to again.  These are
2671 "one-off" hyperlinks.  For example::
2673     `RFC 2396 <http://www.rfc-editor.org/rfc/rfc2396.txt>`__ and `RFC
2674     2732 <http://www.rfc-editor.org/rfc/rfc2732.txt>`__ together
2675     define the syntax of URIs.
2677 Equivalent to::
2679     `RFC 2396`__ and `RFC 2732`__ together define the syntax of URIs.
2681     __ http://www.rfc-editor.org/rfc/rfc2396.txt
2682     __ http://www.rfc-editor.org/rfc/rfc2732.txt
2684 If reference text happens to end with angle-bracketed text that is
2685 *not* a URI, the open-angle-bracket needs to be backslash-escaped.
2686 For example, here is a reference to a title describing a tag::
2688     See `HTML Element: \<a>`_ below.
2690 The reference text may also be omitted, in which case the URI will be
2691 duplicated for use as the reference text.  This is useful for relative
2692 URIs where the address or file name is also the desired reference
2693 text::
2695     See `<a_named_relative_link>`_ or `<an_anonymous_relative_link>`__
2696     for details.
2698 .. CAUTION::
2700    This construct offers easy authoring and maintenance of hyperlinks
2701    at the expense of general readability.  Inline URIs, especially
2702    long ones, inevitably interrupt the natural flow of text.  For
2703    documents meant to be read in source form, the use of independent
2704    block-level `hyperlink targets`_ is **strongly recommended**.  The
2705    embedded URI construct is most suited to documents intended *only*
2706    to be read in processed form.
2709 Inline Internal Targets
2710 ------------------------
2712 Doctree element: target.
2714 Start-string = "_`", end-string = "`".
2716 Inline internal targets are the equivalent of explicit `internal
2717 hyperlink targets`_, but may appear within running text.  The syntax
2718 begins with an underscore and a backquote, is followed by a hyperlink
2719 name or phrase, and ends with a backquote.  Inline internal targets
2720 may not be anonymous.
2722 For example, the following paragraph contains a hyperlink target named
2723 "Norwegian Blue"::
2725     Oh yes, the _`Norwegian Blue`.  What's, um, what's wrong with it?
2727 See `Implicit Hyperlink Targets`_ for the resolution of duplicate
2728 reference names.
2731 Footnote References
2732 -------------------
2734 Doctree element: footnote_reference.
2736 Start-string = "[", end-string = "]_".
2738 Each footnote reference consists of a square-bracketed label followed
2739 by a trailing underscore.  Footnote labels are one of:
2741 - one or more digits (i.e., a number),
2743 - a single "#" (denoting `auto-numbered footnotes`_),
2745 - a "#" followed by a simple reference name (an `autonumber label`_),
2746   or
2748 - a single "*" (denoting `auto-symbol footnotes`_).
2750 For example::
2752     Please RTFM [1]_.
2754     .. [1] Read The Fine Manual
2757 Citation References
2758 -------------------
2760 Doctree element: citation_reference.
2762 Start-string = "[", end-string = "]_".
2764 Each citation reference consists of a square-bracketed label followed
2765 by a trailing underscore.  Citation labels are simple `reference
2766 names`_ (case-insensitive single words, consisting of alphanumerics
2767 plus internal hyphens, underscores, and periods; no whitespace).
2769 For example::
2771     Here is a citation reference: [CIT2002]_.
2773 See Citations_ for the citation itself.
2776 Substitution References
2777 -----------------------
2779 Doctree element: substitution_reference, reference.
2781 Start-string = "|", end-string = "|" (optionally followed by "_" or
2782 "__").
2784 Vertical bars are used to bracket the substitution reference text.  A
2785 substitution reference may also be a hyperlink reference by appending
2786 a "_" (named) or "__" (anonymous) suffix; the substitution text is
2787 used for the reference text in the named case.
2789 The processing system replaces substitution references with the
2790 processed contents of the corresponding `substitution definitions`_
2791 (which see for the definition of "correspond").  Substitution
2792 definitions produce inline-compatible elements.
2794 Examples::
2796     This is a simple |substitution reference|.  It will be replaced by
2797     the processing system.
2799     This is a combination |substitution and hyperlink reference|_.  In
2800     addition to being replaced, the replacement text or element will
2801     refer to the "substitution and hyperlink reference" target.
2804 Standalone Hyperlinks
2805 ---------------------
2807 Doctree element: reference.
2809 Start-string = end-string = "" (empty string).
2811 A URI (absolute URI [#URI]_ or standalone email address) within a text
2812 block is treated as a general external hyperlink with the URI itself
2813 as the link's text.  For example::
2815     See http://www.python.org for info.
2817 would be marked up in HTML as::
2819     See <a href="http://www.python.org">http://www.python.org</a> for
2820     info.
2822 Two forms of URI are recognized:
2824 1. Absolute URIs.  These consist of a scheme, a colon (":"), and a
2825    scheme-specific part whose interpretation depends on the scheme.
2827    The scheme is the name of the protocol, such as "http", "ftp",
2828    "mailto", or "telnet".  The scheme consists of an initial letter,
2829    followed by letters, numbers, and/or "+", "-", ".".  Recognition is
2830    limited to known schemes, per the `Official IANA Registry of URI
2831    Schemes`_ and the W3C's `Retired Index of WWW Addressing Schemes`_.
2833    The scheme-specific part of the resource identifier may be either
2834    hierarchical or opaque:
2836    - Hierarchical identifiers begin with one or two slashes and may
2837      use slashes to separate hierarchical components of the path.
2838      Examples are web pages and FTP sites::
2840          http://www.python.org
2842          ftp://ftp.python.org/pub/python
2844    - Opaque identifiers do not begin with slashes.  Examples are
2845      email addresses and newsgroups::
2847          mailto:someone@somewhere.com
2849          news:comp.lang.python
2851    With queries, fragments, and %-escape sequences, URIs can become
2852    quite complicated.  A reStructuredText parser must be able to
2853    recognize any absolute URI, as defined in RFC2396_ and RFC2732_.
2855 2. Standalone email addresses, which are treated as if they were
2856    absolute URIs with a "mailto:" scheme.  Example::
2858        someone@somewhere.com
2860 Punctuation at the end of a URI is not considered part of the URI,
2861 unless the URI is terminated by a closing angle bracket (">").
2862 Backslashes may be used in URIs to escape markup characters,
2863 specifically asterisks ("*") and underscores ("_") which are vaid URI
2864 characters (see `Escaping Mechanism`_ above).
2866 .. [#URI] Uniform Resource Identifier.  URIs are a general form of
2867    URLs (Uniform Resource Locators).  For the syntax of URIs see
2868    RFC2396_ and RFC2732_.
2871 Units
2872 =====
2874 (New in Docutils 0.3.10.)
2876 All measures consist of a positive floating point number in standard
2877 (non-scientific) notation and a unit, possibly separated by one or
2878 more spaces.
2880 Units are only supported where explicitly mentioned in the reference
2881 manuals.
2884 Length Units
2885 ------------
2887 The following length units are supported by the reStructuredText
2888 parser:
2890 * em (ems, the height of the element's font)
2891 * ex (x-height, the height of the letter "x")
2892 * px (pixels, relative to the canvas resolution)
2893 * in (inches; 1in=2.54cm)
2894 * cm (centimeters; 1cm=10mm)
2895 * mm (millimeters)
2896 * pt (points; 1pt=1/72in)
2897 * pc (picas; 1pc=12pt)
2899 This set corresponds to the `length units in CSS`_.
2901 (List and explanations taken from
2902 http://www.htmlhelp.com/reference/css/units.html#length.)
2904 The following are all valid length values: "1.5em", "20 mm", ".5in".
2906 Length values without unit are completed with a writer-dependent
2907 default (e.g. px with `html4css1`, pt with `latex2e`). See the writer
2908 specific documentation in the `user doc`__ for details.
2910 .. _length units in CSS:
2911    http://www.w3.org/TR/CSS2/syndata.html#length-units
2913 __ ../../user/
2915 Percentage Units
2916 ----------------
2918 Percentage values have a percent sign ("%") as unit.  Percentage
2919 values are relative to other values, depending on the context in which
2920 they occur.
2923 ----------------
2924  Error Handling
2925 ----------------
2927 Doctree element: system_message, problematic.
2929 Markup errors are handled according to the specification in `PEP
2930 258`_.
2933 .. _reStructuredText: http://docutils.sourceforge.net/rst.html
2934 .. _Docutils: http://docutils.sourceforge.net/
2935 .. _The Docutils Document Tree: ../doctree.html
2936 .. _Docutils Generic DTD: ../docutils.dtd
2937 .. _transforms:
2938    http://docutils.sourceforge.net/docutils/transforms/
2939 .. _Grouch: http://www.mems-exchange.org/software/grouch/
2940 .. _RFC822: http://www.rfc-editor.org/rfc/rfc822.txt
2941 .. _DocTitle transform:
2942 .. _DocInfo transform:
2943    http://docutils.sourceforge.net/docutils/transforms/frontmatter.py
2944 .. _getopt.py:
2945    http://www.python.org/doc/current/lib/module-getopt.html
2946 .. _GNU libc getopt_long():
2947    http://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Options.html
2948 .. _doctest module:
2949    http://www.python.org/doc/current/lib/module-doctest.html
2950 .. _Emacs table mode: http://table.sourceforge.net/
2951 .. _Official IANA Registry of URI Schemes:
2952    http://www.iana.org/assignments/uri-schemes
2953 .. _Retired Index of WWW Addressing Schemes:
2954    http://www.w3.org/Addressing/schemes.html
2955 .. _World Wide Web Consortium: http://www.w3.org/
2956 .. _HTML Techniques for Web Content Accessibility Guidelines:
2957    http://www.w3.org/TR/WCAG10-HTML-TECHS/#link-text
2958 .. _image: directives.html#image
2959 .. _replace: directives.html#replace
2960 .. _meta: directives.html#meta
2961 .. _figure: directives.html#figure
2962 .. _admonition: directives.html#admonitions
2963 .. _role: directives.html#custom-interpreted-text-roles
2964 .. _reStructuredText Directives: directives.html
2965 .. _reStructuredText Interpreted Text Roles: roles.html
2966 .. _RFC2396: http://www.rfc-editor.org/rfc/rfc2396.txt
2967 .. _RFC2732: http://www.rfc-editor.org/rfc/rfc2732.txt
2968 .. _Zope: http://www.zope.com/
2969 .. _PEP 258: ../../peps/pep-0258.html
2973    Local Variables:
2974    mode: indented-text
2975    indent-tabs-mode: nil
2976    sentence-end-double-space: t
2977    fill-column: 70
2978    End: