class documentation

Base token class.

Token has two subclasses:

  • block_token.BlockToken, for all block level tokens. A block level token is text which occupies the entire horizontal width of the "page" and is offset for the surrounding sibling block with line breaks.
  • span_token.SpanToken, for all span-level (or inline-level) tokens. A span-level token appears inside the flow of the text lines without any surrounding line break.

Custom __repr__ methods in subclasses: The default __repr__ implementation outputs the number of child tokens (from the attribute children) if applicable, and the content attribute if applicable. If any additional attributes should be included in the __repr__ output, this can be specified by setting the class attribute repr_attributes to a tuple containing the attribute names to be output.

Method __repr__ Undocumented
Class Variable repr_attributes Undocumented