class documentation

class BlockParser: (source)

View In Hierarchy

Parse Markdown blocks into an ElementTree object. A wrapper class that stitches the various BlockProcessors together, looping through them and creating an ElementTree object.

Method __init__ Undocumented
Method parseBlocks Process blocks of markdown text and attach to given etree node.
Method parseChunk Parse a chunk of markdown text and attach to given etree node.
Method parseDocument Parse a markdown document into an ElementTree.
Instance Variable blockprocessors Undocumented
Instance Variable md Undocumented
Instance Variable root Undocumented
Instance Variable state Undocumented
def __init__(self, md): (source)

Undocumented

def parseBlocks(self, parent, blocks): (source)

Process blocks of markdown text and attach to given etree node. Given a list of ``blocks``, each blockprocessor is stepped through until there are no blocks left. While an extension could potentially call this method directly, it's generally expected to be used internally. This is a public method as an extension may need to add/alter additional BlockProcessors which call this method to recursively parse a nested block.

def parseChunk(self, parent, text): (source)

Parse a chunk of markdown text and attach to given etree node. While the ``text`` argument is generally assumed to contain multiple blocks which will be split on blank lines, it could contain only one block. Generally, this method would be called by extensions when block parsing is required. The ``parent`` etree Element passed in is altered in place. Nothing is returned.

def parseDocument(self, lines): (source)

Parse a markdown document into an ElementTree. Given a list of lines, an ElementTree object (not just a parent Element) is created and the root element is passed to the parser as the parent. The ElementTree object is returned. This should only be called on an entire document, not pieces.

blockprocessors = (source)

Undocumented

Undocumented

root = (source)

Undocumented

state = (source)

Undocumented