aboutsummaryrefslogtreecommitdiff
path: root/mammoth/documents.py
blob: c8082d3cb5e6f87a724bc7fbc3e8441403bf6e45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import collections

Document = collections.namedtuple("Document", ["children"])
Paragraph = collections.namedtuple("Paragraph", ["children", "style_name", "numbering"])
Run = collections.namedtuple("Run", ["children", "style_name", "is_bold", "is_italic"])
Text = collections.namedtuple("Text", ["value"])
class Tab(object):
    pass


document = Document

def paragraph(children, style_name=None, numbering=None):
    return Paragraph(children, style_name, numbering)

def run(children, style_name=None, is_bold=None, is_italic=None):
    return Run(children, style_name, bool(is_bold), bool(is_italic))

text = Text
_tab = Tab()
def tab():
    return _tab