feat(dom): Add support for generic drawer outputs.
Some checks failed
Some checks failed
This commit is contained in:
parent
34446bdb3b
commit
bd1c464a2a
@ -24,6 +24,14 @@ class ResultsDrawerNode(DrawerNode):
|
|||||||
return "<Results: {}>".format(len(self.children))
|
return "<Results: {}>".format(len(self.children))
|
||||||
|
|
||||||
|
|
||||||
|
class GenericDrawerNode(DrawerNode):
|
||||||
|
def __init__(self, drawer_name):
|
||||||
|
self.drawer_name = drawer_name
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return "<Drawer(): {}>".format(self.drawer_name, len(self.children))
|
||||||
|
|
||||||
|
|
||||||
class PropertyNode:
|
class PropertyNode:
|
||||||
def __init__(self, key, value):
|
def __init__(self, key, value):
|
||||||
self.key = key
|
self.key = key
|
||||||
|
@ -122,6 +122,7 @@ NON_FINISHED_GROUPS = (
|
|||||||
dom.ListGroupNode,
|
dom.ListGroupNode,
|
||||||
dom.ResultsDrawerNode,
|
dom.ResultsDrawerNode,
|
||||||
dom.PropertyDrawerNode,
|
dom.PropertyDrawerNode,
|
||||||
|
dom.GenericDrawerNode,
|
||||||
)
|
)
|
||||||
FREE_GROUPS = (dom.CodeBlock,)
|
FREE_GROUPS = (dom.CodeBlock,)
|
||||||
|
|
||||||
@ -636,6 +637,13 @@ class Headline:
|
|||||||
assert current_node is None
|
assert current_node is None
|
||||||
current_node = dom.ResultsDrawerNode()
|
current_node = dom.ResultsDrawerNode()
|
||||||
|
|
||||||
|
# TODO: Allow indentation of these blocks inside others
|
||||||
|
indentation_tree = [current_node]
|
||||||
|
tree.append(current_node)
|
||||||
|
elif content.strip().startswith(':') and content.strip().endswith(':'):
|
||||||
|
assert current_node is None
|
||||||
|
current_node = dom.GenericDrawerNode(content.strip().strip(':'))
|
||||||
|
|
||||||
# TODO: Allow indentation of these blocks inside others
|
# TODO: Allow indentation of these blocks inside others
|
||||||
indentation_tree = [current_node]
|
indentation_tree = [current_node]
|
||||||
tree.append(current_node)
|
tree.append(current_node)
|
||||||
|
Loading…
Reference in New Issue
Block a user