aboutsummaryrefslogtreecommitdiff
path: root/mammoth/html/nodes.py
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth/html/nodes.py')
-rw-r--r--mammoth/html/nodes.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/mammoth/html/nodes.py b/mammoth/html/nodes.py
new file mode 100644
index 0000000..aae4888
--- /dev/null
+++ b/mammoth/html/nodes.py
@@ -0,0 +1,32 @@
+import cobble
+
+
+class Node(object):
+ pass
+
+
+@cobble.data
+class TextNode(Node):
+ value = cobble.field()
+
+
+@cobble.data
+class Element(Node):
+ tag_names = cobble.field()
+ attributes = cobble.field()
+ children = cobble.field()
+ collapsible = cobble.field()
+
+
+@cobble.data
+class SelfClosingElement(Node):
+ tag_name = cobble.field()
+ attributes = cobble.field()
+
+
+@cobble.visitable
+class ForceWrite(Node):
+ pass
+
+
+NodeVisitor = cobble.visitor(Node)