pyndoc.readers.gfm package
Submodules
pyndoc.readers.gfm.blocks module
- class pyndoc.readers.gfm.blocks.Space[source]
Bases:
Space- classmethod match_pattern(**kwargs: Unpack[AtomMatchParams]) tuple[Match | None, str][source]
Check if the block matches a given token. Returns a regex match (or None if match failed)
- Parameters:
**kwargs – See below
- Keyword Arguments:
text (
str) – the token to be matched against the pattern attribute
- class pyndoc.readers.gfm.blocks.SoftBreak[source]
Bases:
SoftBreak- classmethod match_pattern(**kwargs: Unpack[AtomMatchParams]) tuple[Match | None, str][source]
Check if the block matches a given token. Returns a regex match (or None if match failed)
- Parameters:
**kwargs – See below
- Keyword Arguments:
text (
str) – the token to be matched against the pattern attribute
- class pyndoc.readers.gfm.blocks.Header[source]
Bases:
Header- process_read(**kwargs: Unpack[ProcessParams]) None[source]
Process additional keyword arguments after block initialization. Not used here, the function is meant to be used inside of blocks inherited from basic AST blocks. Otherwise no processing will be done
- class pyndoc.readers.gfm.blocks.Emph(**_: None)[source]
Bases:
Emph- classmethod start(**kwargs: Unpack[StartParams]) tuple[Match | None, str][source]
Check if a block has started. Returns a match if matched, otherwise None
- Parameters:
**kwargs – See below
- Keyword Arguments:
token (
str) – the current token
- class pyndoc.readers.gfm.blocks.BulletList[source]
Bases:
_GFMList,BulletList- process_read(**kwargs: Unpack[ProcessParams]) None[source]
Process additional keyword arguments after block initialization. Not used here, the function is meant to be used inside of blocks inherited from basic AST blocks. Otherwise no processing will be done
- class pyndoc.readers.gfm.blocks.OrderedList[source]
Bases:
_GFMList,OrderedList- separator_dict = {')': Separator.CLOSING_PAREN, '.': Separator.PERIOD}
- numbering_type = 1
- process_read(**kwargs: Unpack[ProcessParams]) None[source]
Process additional keyword arguments after block initialization. Not used here, the function is meant to be used inside of blocks inherited from basic AST blocks. Otherwise no processing will be done
- class pyndoc.readers.gfm.blocks.Table[source]
Bases:
Table- process_read(**kwargs: Unpack[ProcessParams]) None[source]
Process additional keyword arguments after block initialization. Not used here, the function is meant to be used inside of blocks inherited from basic AST blocks. Otherwise no processing will be done
- classmethod handle_premature_closure(**kwargs: Unpack[EndParams]) str[source]
Used when when the file has ended, but context has not been closed Potentially modify recieved token end return it
- Parameters:
token (str) – The current token to be modified
- classmethod start(**kwargs: Unpack[StartParams]) tuple[Match | None, str][source]
Check if a block has started. Returns a match if matched, otherwise None
- Parameters:
**kwargs – See below
- Keyword Arguments:
token (
str) – the current token
- class pyndoc.readers.gfm.blocks.Row[source]
Bases:
Row
- class pyndoc.readers.gfm.blocks.Cell[source]
Bases:
Cell- delimiter_regex = '(?P<l>:?)-+(?P<r>:?)'
- classmethod is_delimiter_cell(cell: Cell) bool[source]
Determines whether a cell is delimiter cell - has only one element that is a string and its content is in format matches regular expression (?P<l>:?)-+(?P<l>:?) e.g.: “-”, “:—-”, “–:”, “:—:”
- Parameters:
cell (Cell) – cell being checked
- Returns:
true if passed cell is delimiter cell, otherwise false
- Return type:
bool
- classmethod get_delimiter_cell_alignment(cell: Cell) Alignment[source]
Returns the alignment of delimiter cell. To be used with cell that passed is_delimiter_cell method
- classmethod start(**kwargs: Unpack[StartParams]) tuple[Match | None, str][source]
Check if a block has started. Returns a match if matched, otherwise None
- Parameters:
**kwargs – See below
- Keyword Arguments:
token (
str) – the current token
- class pyndoc.readers.gfm.blocks.CodeBlockHelper[source]
Bases:
ASTCompositeBlockA composite helper for parsing
CodeBlocksThis block will create aCodeBlockin its contents, parse its metadata and adjust contents. When the block ends, it will replace itself with theCodeBlockin the context stack.- process_read(**kwargs: Unpack[ProcessParams]) None[source]
Parse a
CodeBlockmetadata and add an emptyCodeBlockto the block’s contents
- class pyndoc.readers.gfm.blocks.CodeHelper[source]
Bases:
ASTCompositeBlockA Helper for parsing inline code This block will create a
Codein its contents, parse its metadata and adjust contents. When the block ends, it will replace itself with theCodein the context stack.- process_read(**kwargs: Unpack[ProcessParams]) None[source]
Set the end pattern of the block based on the start pattern. Then add an empty
Codeblock to the contents
- classmethod start(**kwargs: Unpack[StartParams]) tuple[Match | None, str][source]
Check if a block has started. Returns a match if matched, otherwise None
- Parameters:
**kwargs – See below
- Keyword Arguments:
token (
str) – the current token