This is the docutils.parsers.rst.states module, the core of the reStructuredText parser. It defines the following:
The reStructuredText parser is implemented as a recursive state machine,
examining its input one line at a time. To understand how the parser works,
please first become familiar with the docutils.statemachine
module. In the
description below, references are made to classes defined in this module;
please see the individual classes for details.
Parsing proceeds as follows:
Body
, in order, looking for a match.
The implicit transitions (blank lines and indentation) are checked before
any others. The 'text' transition is a catch-all (matches anything).Body.doctest
parses a doctest block). The parser's
current line index is advanced to the end of the element, and parsing
continues with step 1.BulletList
in the case of the
'bullet' transition; see SpecializedBody
for more detail). This
state machine is run to parse the compound element (or series of
explicit markup elements), and returns as soon as a non-member element
is encountered. For example, the BulletList
state machine ends as
soon as it encounters an element which is not a list item of that
bullet list. The optional omission of inter-element blank lines is
enabled by this nested state machine.Text
, under which the second line is
examined. If the second line is:DefinitionList
state.Body
is still
used.Unknown Field: classes | |
| |
Unknown Field: exception | |
classes | |
Unknown Field: functions | |
| |
Unknown Field: attributes | |
|
Class | Body |
Generic classifier of the first line of a block. |
Class | BulletList |
Second and subsequent bullet_list list_items. |
Class | Definition |
Second line of potential definition_list_item. |
Class | DefinitionList |
Second and subsequent definition_list_items. |
Class | EnumeratedList |
Second and subsequent enumerated_list list_items. |
Class | Explicit |
Second and subsequent explicit markup construct. |
Class | ExtensionOptions |
Parse field_list fields for extension options. |
Class | FieldList |
Second and subsequent field_list fields. |
Class | Inliner |
Parse inline markup; call the parse() method. |
Class | InterpretedRoleNotImplementedError |
Undocumented |
Class | Line |
Second line of over- & underlined section title or transition marker. |
Class | LineBlock |
Second and subsequent lines of a line_block. |
Class | MarkupError |
Undocumented |
Class | MarkupMismatch |
Undocumented |
Class | NestedStateMachine |
StateMachine run from within other StateMachine runs, to parse nested document structures. |
Class | OptionList |
Second and subsequent option_list option_list_items. |
Class | ParserError |
Undocumented |
Class | QuotedLiteralBlock |
Nested parse handler for quoted (unindented) literal blocks. |
Class | RFC2822Body |
RFC2822 headers are only valid as the first constructs in documents. As soon as anything else appears, the Body state should take over. |
Class | RFC2822List |
Second and subsequent RFC2822-style field_list fields. |
Class | RSTState |
reStructuredText State superclass. |
Class | RSTStateMachine |
reStructuredText's master StateMachine. |
Class | SpecializedBody |
Superclass for second and subsequent compound element members. Compound elements are lists and list-like constructs. |
Class | SpecializedText |
Superclass for second and subsequent lines of Text-variants. |
Class | Struct |
Stores data attributes for dotted-attribute access. |
Class | SubstitutionDef |
Parser for the contents of a substitution_definition element. |
Class | Text |
Classifier of second line of a text block. |
Class | UnknownInterpretedRoleError |
Undocumented |
Function | build_regexp |
Build, compile and return a regular expression based on definition . |
Variable | state_classes |
Standard set of State classes used to start RSTStateMachine . |
Function | _loweralpha_to_int |
Undocumented |
Function | _lowerroman_to_int |
Undocumented |
Function | _upperalpha_to_int |
Undocumented |
definition
.Unknown Field: parameter | |
definition : a 4-tuple (group name, prefix, suffix, parts),
where "parts" is a list of regular expressions and/or regular
expression definitions to be joined into an or-group. |