def_list
Definition List Extension for Python-Markdown.
Adds parsing of Definition Lists to Python-Markdown.
See https://pythonhosted.org/Markdown/extensions/definition_lists.html for documentation.
Original code Copyright 2008 Waylan Limberg
All changes Copyright 2008-2014 The Python Markdown Project
License: BSD
Classes
DefListProcessor(parser)
Bases: BlockProcessor
Process Definition Lists.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
Attributes
parser = parser
instance-attribute
tab_length = parser.markdown.tab_length
instance-attribute
RE = re.compile('(^|\\n)[ ]{0,3}:[ ]{1,3}(.*?)(\\n|$)')
class-attribute
instance-attribute
NO_INDENT_RE = re.compile('^[ ]{0,3}[^ :]')
class-attribute
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)
run(parent, blocks)
Source code in pyrevitlib/pyrevit/coreutils/markdown/extensions/def_list.py
DefListIndentProcessor(*args)
Bases: ListIndentProcessor
Process indented children of definition list items.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
Attributes
parser = parser
instance-attribute
tab_length = parser.markdown.tab_length
instance-attribute
INDENT_RE = re.compile('^(([ ]{%s})+)' % self.tab_length)
instance-attribute
ITEM_TYPES = ['dd']
class-attribute
instance-attribute
LIST_TYPES = ['dl']
class-attribute
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)
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
run(parent, blocks)
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
get_level(parent, block)
Get level of indent based on list level.
Source code in pyrevitlib/pyrevit/coreutils/markdown/blockprocessors.py
create_item(parent, block)
Create a new dd and parse the block with it as the parent.
DefListExtension(*args, **kwargs)
Bases: Extension
Add definition lists 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 DefListProcessor to BlockParser.