class Body(RSTState): (source)
Known subclasses: docutils.parsers.rst.states.RFC2822Body
, docutils.parsers.rst.states.SpecializedBody
, docutils.parsers.rst.states.SubstitutionDef
Generic classifier of the first line of a block.
Method | add |
Undocumented |
Method | anonymous |
Anonymous hyperlink targets. |
Method | anonymous |
Undocumented |
Method | block |
Undocumented |
Method | build |
Undocumented |
Method | build |
Undocumented |
Method | bullet |
Bullet list item. |
Method | check |
Check attribution shape. Return the index past the end of the attribution, and the indent. |
Method | citation |
Undocumented |
Method | comment |
Undocumented |
Method | directive |
Returns a 2-tuple: list of nodes, and a "blank finish" boolean. |
Method | disallowed |
Undocumented |
Method | doctest |
Undocumented |
Method | enumerator |
Enumerated List Item |
Method | explicit |
Determine which explicit construct this is, parse & return it. |
Method | explicit |
Create a nested state machine for a series of explicit markup constructs (including anonymous hyperlink targets). |
Method | explicit |
Footnotes, hyperlink targets, directives, comments. |
Method | field |
Undocumented |
Method | field |
Field list item. |
Method | footnote |
Undocumented |
Method | grid |
Top border of a full table. |
Method | hyperlink |
Undocumented |
Method | indent |
Block quote. |
Method | is |
Check validity based on the ordinal value and the second line. |
Method | is |
Undocumented |
Method | isolate |
Undocumented |
Method | isolate |
Undocumented |
Method | line |
Section title overline or transition marker. |
Method | line |
First line of a line block. |
Method | line |
Return one line element of a line_block. |
Method | list |
Undocumented |
Method | make |
Construct and return the next enumerated list item marker, and an auto-enumerator ("#" instead of the regular enumerator). |
Method | make |
Undocumented |
Method | malformed |
Undocumented |
Method | nest |
Undocumented |
Method | nest |
Undocumented |
Method | option |
Undocumented |
Method | option |
Option list item. |
Method | parse |
Undocumented |
Method | parse |
Undocumented |
Method | parse |
Undocumented |
Method | parse |
Undocumented |
Method | parse |
Analyze an enumerator and return the results. |
Method | parse |
Parse `datalines` for a field list containing extension options matching `option_spec`. |
Method | parse |
Undocumented |
Method | parse |
Extract & return field name from a field marker match. |
Method | parse |
Return a list of `node.option` and `node.option_argument` objects, parsed from an option marker match. |
Method | parse |
Determine the type of reference of a target. |
Method | run |
Parse a directive then run its directive function. |
Method | simple |
Top border of a simple table. |
Method | split |
Check for a block quote attribution and split it off: |
Method | substitution |
Undocumented |
Method | table |
Parse a table. |
Method | table |
Top border of a generic table. |
Method | text |
Titles, definition lists, paragraphs. |
Method | unknown |
Undocumented |
Class Variable | attribution |
Undocumented |
Class Variable | enum |
Enumerated list parsing information. |
Class Variable | explicit |
Patterns and constants used for explicit markup recognition. |
Class Variable | grid |
Matches the top (& bottom) of a full table). |
Class Variable | initial |
A list of transitions to initialize when a `State` is instantiated. Each entry is either a transition name string, or a (transition name, next state name) pair. See `make_transitions()`. Override in subclasses. |
Class Variable | pats |
Fragments of patterns used by transitions. |
Class Variable | patterns |
{Name: pattern} mapping, used by `make_transition()`. Each pattern may be a string or a compiled `re` pattern. Override in subclasses. |
Class Variable | simple |
Matches the bottom & header bottom of a simple table. |
Class Variable | simple |
Matches the top of a simple table. |
Inherited from RSTState
:
Method | __init__ |
Initialize a `StateSM` object; extends `State.__init__()`. |
Method | bof |
Called at beginning of file. |
Method | check |
Check for a valid subsection header. Return True or False. |
Method | goto |
Jump to input line `abs_line_offset`, ignoring jumps past the end. |
Method | inline |
Return 2 lists: nodes (text and inline elements), and system_messages. |
Method | nested |
Create a new StateMachine rooted at `node` and run it over the input `block`. Also keep track of optional intermediate blank lines and the required final one. |
Method | nested |
Create a new StateMachine rooted at `node` and run it over the input `block`. |
Method | new |
Append new subsection to document tree. On return, check level. |
Method | no |
Override `StateWS.no_match` to generate a system message. |
Method | paragraph |
Return a list (paragraph & messages) & a boolean: literal_block next? |
Method | runtime |
Initialize this `State` before running the state machine; called from `self.state_machine.run()`. |
Method | section |
Check for a valid subsection and create one if it checks out. |
Method | title |
Undocumented |
Method | unindent |
Undocumented |
Class Variable | nested |
Undocumented |
Instance Variable | document |
Undocumented |
Instance Variable | inliner |
Undocumented |
Instance Variable | memo |
Undocumented |
Instance Variable | nested |
Keyword arguments dictionary, passed to the `nested_sm` constructor. |
Instance Variable | parent |
Undocumented |
Instance Variable | reporter |
Undocumented |
Inherited from StateWS
(via RSTState
):
Method | add |
Add whitespace-specific transitions before those defined in subclass. |
Method | blank |
Handle blank lines. Does nothing. Override in subclasses. |
Method | first |
Handle an indented text block (first line's indent known). |
Method | known |
Handle a known-indent text block. Extend or override in subclasses. |
Class Variable | ws |
Default initial whitespace transitions, added before those listed in `State.initial_transitions`. May be overridden in subclasses. |
Class Variable | ws |
Patterns for default whitespace transitions. May be overridden in subclasses. |
Instance Variable | indent |
The `StateMachine` class handling indented text blocks. |
Instance Variable | indent |
Keyword arguments dictionary, passed to the `indent_sm` constructor. |
Instance Variable | known |
The `StateMachine` class handling known-indented text blocks. |
Instance Variable | known |
Keyword arguments dictionary, passed to the `known_indent_sm` constructor. |
Inherited from State
(via RSTState
, StateWS
):
Method | add |
Add a transition to the start of the transition list. |
Method | add |
Add a list of transitions to the start of the transition list. |
Method | eof |
Handle end-of-file. Return empty result. |
Method | make |
Make & return a transition tuple based on `name`. |
Method | make |
Return a list of transition names and a transition mapping. |
Method | nop |
A "do nothing" transition method. |
Method | remove |
Remove a transition by `name`. |
Method | unlink |
Remove circular references to objects no longer required. |
Instance Variable | debug |
Debugging mode on/off. |
Instance Variable | nested |
The `StateMachine` class for handling nested processing. |
Instance Variable | state |
A reference to the controlling `StateMachine` object. |
Instance Variable | transition |
A list of transition names in search order. |
Instance Variable | transitions |
A mapping of transition names to 3-tuples containing (compiled_pattern, transition_method, next_state_name). Initialized as an instance attribute dynamically (instead of as a class attribute) because it may make forward references to patterns and methods in this or other classes. |
Create a nested state machine for a series of explicit markup constructs (including anonymous hyperlink targets).
docutils.parsers.rst.states.Explicit
Footnotes, hyperlink targets, directives, comments.
Check validity based on the ordinal value and the second line. Return true if the ordinal is valid and the second line is blank, indented, or starts with the next enumerator or an auto-enumerator.
Construct and return the next enumerated list item marker, and an auto-enumerator ("#" instead of the regular enumerator). Return ``None`` for invalid (out of range) ordinals.
Analyze an enumerator and return the results. :Return: - the enumerator format ('period', 'parens', or 'rparen'), - the sequence used ('arabic', 'loweralpha', 'upperroman', etc.), - the text of the enumerator, stripped of formatting, and - the ordinal value of the enumerator ('a' -> 1, 'ii' -> 2, etc.; ``None`` is returned for invalid enumerator text). The enumerator format has already been determined by the regular expression match. If `expected_sequence` is given, that sequence is tried first. If not, we check for Roman numeral 1. This way, single-character Roman numerals (which are also alphabetical) can be matched. If no sequence has been matched, all sequences are checked in order.
Parse `datalines` for a field list containing extension options matching `option_spec`. :Parameters: - `option_spec`: a mapping of option name to conversion function, which should raise an exception on bad input. - `datalines`: a list of input strings. :Return: - Success value, 1 or 0. - An option dictionary on success, an error string on failure.
Return a list of `node.option` and `node.option_argument` objects, parsed from an option marker match. :Exception: `MarkupError` for invalid option markers.
Determine the type of reference of a target. :Return: A 2-tuple, one of: - 'refname' and the indirect reference name - 'refuri' and the URI - 'malformed' and a system_message node
Parse a directive then run its directive function. Parameters: - `directive`: The class implementing the directive. Must be a subclass of `rst.Directive`. - `match`: A regular expression match object which matched the first line of the directive. - `type_name`: The directive name, as used in the source text. - `option_presets`: A dictionary of preset options, defaults for the directive options. Currently, only an "alt" option is passed by substitution definitions (value: the substitution name), which may be used by an embedded image directive. Returns a 2-tuple: list of nodes, and a "blank finish" boolean.
Check for a block quote attribution and split it off: * First line after a blank line must begin with a dash ("--", "---", em-dash; matches `self.attribution_pattern`). * Every line after that must have consistent indentation. * Attributions must be preceded by block quote content. Return a tuple of: (block quote content lines, attribution lines, attribution offset, remaining indented lines, remaining lines offset).
docutils.parsers.rst.states.DefinitionList
, docutils.parsers.rst.states.SubstitutionDef
Titles, definition lists, paragraphs.
A list of transitions to initialize when a `State` is instantiated. Each entry is either a transition name string, or a (transition name, next state name) pair. See `make_transitions()`. Override in subclasses.
docutils.statemachine.StateWS.patterns
{Name: pattern} mapping, used by `make_transition()`. Each pattern may be a string or a compiled `re` pattern. Override in subclasses.