tables
Tables Extension for Python-Markdown.
Added parsing of tables to Python-Markdown.
See https://pythonhosted.org/Markdown/extensions/tables.html for documentation.
Original code Copyright 2009 Waylan Limberg
All changes Copyright 2008-2014 The Python Markdown Project
License: BSD
Classes
TableProcessor(parser)
Bases: BlockProcessor
Process Tables.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/tables.py
Attributes
parser = parser
instance-attribute
tab_length = parser.markdown.tab_length
instance-attribute
RE_CODE_PIPES = re.compile('(?:(\\\\\\\\)|(\\\\`+)|(`+)|(\\\\\\|)|(\\|))')
class-attribute
instance-attribute
RE_END_BORDER = re.compile('(?<!\\\\)(?:\\\\\\\\)*\\|$')
class-attribute
instance-attribute
border = False
instance-attribute
separator = ''
instance-attribute
Functions
lastChild(parent)
detab(text)
Remove a tab from the front of each line of the given text.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
looseDetab(text, level=1)
Remove a tab from front of lines but allowing dedented lines.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
test(parent, block)
Ensure first two rows (column header and separator row) are valid table rows.
Keep border check and separator row do avoid repeating the work.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/tables.py
run(parent, blocks)
Parse a table block and build table.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/tables.py
TableExtension(*args, **kwargs)
Bases: Extension
Add tables to Markdown.
Initiate Extension and set up configs.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/__init__.py
Attributes
config = {}
class-attribute
instance-attribute
Functions
getConfig(key, default='')
Return a setting for the given key or an empty string.
getConfigs()
getConfigInfo()
setConfig(key, value)
Set a config setting for key
with the given value
.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/__init__.py
setConfigs(items)
Set multiple config settings given a dict or list of tuples.
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/__init__.py
extendMarkdown(md, md_globals)
Add an instance of TableProcessor to BlockParser.