module documentation

Built-in block-level token classes.
Class ​Block​Code Indented code.
Class ​Block​Token Base class for block-level tokens. Recursively parse inner tokens.
Class ​Code​Fence Code fence. (["`sh\n", "rm -rf /", ..., "`"]) Boundary between span-level and block-level tokens.
Class ​Document Document token.
Class ​Footnote Footnote token. A "link reference definition" according to the spec.
Class ​Heading Heading token. (["### some heading ###n"]) Boundary between span-level and block-level tokens.
Class ​HTMLBlock Block-level HTML tokens.
Class ​List List token.
Class ​List​Item List items. Not included in the parsing process, but called by List.
Class ​Paragraph Paragraph token. (["somen", "continuousn", "linesn"]) Boundary between span-level and block-level tokens.
Class ​Quote Quote token. (["> # headingn", "> paragraphn"])
Class ​Setext​Heading Setext headings.
Class ​Table Table token.
Class ​Table​Cell Table cell token. Boundary between span-level and block-level tokens.
Class ​Table​Row Table row token. Supports escaped pipes in table cells (for primary use within code spans).
Class ​Thematic​Break Thematic break token (a.k.a. horizontal rule.)
Function add​_token Allows external manipulation of the parsing process. This function is usually called in BaseRenderer.__enter__.
Function remove​_token Allows external manipulation of the parsing process. This function is usually called in BaseRenderer.__exit__.
Function reset​_tokens Resets global _token_types to all token classes in __all__.
Function tokenize A wrapper around block_tokenizer.tokenize. Pass in all block-level token constructors as arguments to block_tokenizer.tokenize.
Variable ​_root​_node Undocumented
Variable ​_token​_types Undocumented
def add_token(token_cls, position=0):
Allows external manipulation of the parsing process. This function is usually called in BaseRenderer.__enter__.
Parameters
token​_cls:SpanTokentoken to be included in the parsing process.
position:intthe position for the token class to be inserted into.
def remove_token(token_cls):
Allows external manipulation of the parsing process. This function is usually called in BaseRenderer.__exit__.
Parameters
token​_cls:BlockTokentoken to be removed from the parsing process.
def reset_tokens():
Resets global _token_types to all token classes in __all__.
def tokenize(lines):

A wrapper around block_tokenizer.tokenize. Pass in all block-level token constructors as arguments to block_tokenizer.tokenize.

Doing so (instead of importing block_token module in block_tokenizer) avoids cyclic dependency issues, and allows for future injections of custom token classes.

_token_types variable is at the bottom of this module.

See also: block_tokenizer.tokenize, span_token.tokenize_inner.

_root_node =

Undocumented

_token_types: list =

Undocumented