aboutsummaryrefslogtreecommitdiff
path: root/mammoth/html/nodes.py
blob: aae4888eed64d00d5cabdb3f42774ec229c5e823 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)