Superclass for second and subsequent lines of Text-variants.
All transition methods are disabled. Override individual methods in subclasses to re-enable.
There are no implemented interfaces.
classifier_delimiter
(type: SRE_Pattern
)
<_sre.SRE_Pattern object at 0x41f9dc80>
indent_sm
(type: NoneType
)
None
indent_sm_kwargs
(type: NoneType
)
None
initial_transitions
(type:
list
)
[('underline', 'Body'), ('text', 'Body')]
known_indent_sm
(type: NoneType
)
None
known_indent_sm_kwargs
(type: NoneType
)
None
nested_sm
(type: classobj
)
<class docutils.parsers.rst.states.NestedStateMachine at 0x4137fb3c>
nested_sm_kwargs
(type: NoneType
)
None
patterns
(type:
dict
)
{'indent': ' +', 'blank': ' *$', 'text': '', 'underline': '([!-/:-@[-`{-~])\\1* *$'}
ws_initial_transitions
(type:
tuple
)
('blank', 'indent')
ws_patterns
(type:
dict
)
{'indent': ' +', 'blank': ' *$'}
add_initial_transitions()
Add whitespace-specific transitions before those defined in subclass.
Extends State.add_initial_transitions().
add_transition(name, transition)
Add a transition to the start of the transition list.
Parameter transition: a ready-made transition 3-tuple.
Exception: DuplicateTransitionError.
add_transitions(names, transitions)
Add a list of transitions to the start of the transition list.
Parameters:
Exceptions: DuplicateTransitionError, UnknownTransitionError.
blank(match=None, context=None, next_state=None)
Not a compound element member. Abort this state machine.
bof(context)
Called at beginning of file.
check_subsection(source, style, lineno)
Check for a valid subsection header. Return 1 (true) or None (false).
When a new section is reached that isn't a subsection of the current section, back up the line count (use previous_line(-x)), then raise EOFError. The current StateMachine will finish, then the calling StateMachine can re-examine the title. This will work its way back up the calling chain until the correct section level isreached.
@@@ Alternative: Evaluate the title, store the title info & level, and back up the chain until that level is reached. Store in memo? Or return in results?
Exception: | EOFError when a sibling or supersection encountered. |
---|
definition_list_item(termline)
eof(context)
Incomplete construct.
first_known_indent(match, context, next_state)
Handle an indented text block (first line's indent known).
Extend or override in subclasses.
Recursively run the registered state machine for known-indent indented blocks (self.known_indent_sm). The indent is the length of the match, match.end().
goto_line(abs_line_offset)
Jump to input line abs_line_offset, ignoring jumps past the end.
indent(match=None, context=None, next_state=None)
Not a compound element member. Abort this state machine.
inline_text(text, lineno)
Return 2 lists: nodes (text and inline elements), and system_messages.
invalid_input(match=None, context=None, next_state=None)
Not a compound element member. Abort this state machine.
known_indent(match, context, next_state)
Handle a known-indent text block. Extend or override in subclasses.
Recursively run the registered state machine for known-indent indented blocks (self.known_indent_sm). The indent is the length of the match, match.end().
literal_block()
Return a list of nodes.
make_transition(name, next_state=None)
Make & return a transition tuple based on name.
This is a convenience function to simplify transition creation.
Parameters:
Exceptions: TransitionPatternNotFound, TransitionMethodNotFound.
make_transitions(name_list)
Return a list of transition names and a transition mapping.
Parameter name_list: a list, where each entry is either a transition name string, or a 1- or 2-tuple (transition name, optional next state name).
nested_list_parse(block, input_offset, node, initial_state, blank_finish, blank_finish_state=None, extra_settings={}, match_titles=0, state_machine_class=None, state_machine_kwargs=None)
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.
nested_parse(block, input_offset, node, match_titles=0, state_machine_class=None, state_machine_kwargs=None)
Create a new StateMachine rooted at node and run it over the input block.
new_subsection(title, lineno, messages)
Append new subsection to document tree. On return, check level.
no_match(context, transitions)
Override StateWS.no_match to generate a system message.
This code should never be run.
nop(match, context, next_state)
A "do nothing" transition method.
Return unchanged context & next_state, empty result. Useful for simple state changes (actionless transitions).
paragraph(lines, lineno)
Return a list (paragraph & messages) & a boolean: literal_block next?
quoted_literal_block()
remove_transition(name)
Remove a transition by name.
Exception: UnknownTransitionError.
runtime_init()
section(title, source, style, lineno, messages)
Check for a valid subsection and create one if it checks out.
term(lines, lineno)
Return a definition_list's term and optional classifiers.
text(match=None, context=None, next_state=None)
Not a compound element member. Abort this state machine.
title_inconsistent(sourcetext, lineno)
underline(match=None, context=None, next_state=None)
Not a compound element member. Abort this state machine.
unindent_warning(node_name)
unlink()
Remove circular references to objects no longer required.