feat(dom): Add support for generic drawer outputs.
Some checks failed
Some checks failed
This commit is contained in:
parent
c0fc78fe33
commit
df178d08d8
@ -24,6 +24,14 @@ class ResultsDrawerNode(DrawerNode):
|
||||
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:
|
||||
def __init__(self, key, value):
|
||||
self.key = key
|
||||
|
@ -122,6 +122,7 @@ NON_FINISHED_GROUPS = (
|
||||
dom.ListGroupNode,
|
||||
dom.ResultsDrawerNode,
|
||||
dom.PropertyDrawerNode,
|
||||
dom.GenericDrawerNode,
|
||||
)
|
||||
FREE_GROUPS = (dom.CodeBlock,)
|
||||
|
||||
@ -636,6 +637,13 @@ class Headline:
|
||||
assert current_node is None
|
||||
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
|
||||
indentation_tree = [current_node]
|
||||
tree.append(current_node)
|
||||
|
Loading…
Reference in New Issue
Block a user