docutils.readers package
This package contains Docutils Reader modules.
- class Reader(parser=None, parser_name=None)[source]
Bases:
Component
Abstract base class for docutils Readers.
Each reader module or package must export a subclass also called ‘Reader’.
The two steps of a Reader’s responsibility are to read data from the source Input object and parse the data with the Parser object. Call read() to process a document.
- component_type = 'reader'
Name of the component type (‘reader’, ‘parser’, ‘writer’). Override in subclasses.
- config_section = 'readers'
The name of the config file section specific to this component (lowercase, no brackets). Override in subclasses.
- __init__(parser=None, parser_name=None)[source]
Initialize the Reader instance.
Several instance attributes are defined with dummy initial values. Subclasses may use these attributes as they wish.
- parser
A parsers.Parser instance shared by all doctrees. May be left unspecified if the document source determines the parser.
- source
docutils.io IO object, source of input data.
- input
Raw text input; either a single string or, for more complex cases, a collection of strings.
- class ReReader(parser=None, parser_name=None)[source]
Bases:
Reader
A reader which rereads an existing document tree (e.g. a deserializer).
Often used in conjunction with writers.UnfilteredWriter.