Passed
Push — master ( 1ac98c...ed1e15 )
by P.R.
01:49
created

ItemizeHtmlFormatter.generate()   A

Complexity

Conditions 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
crap 1
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9 1
from sdoc.sdoc2.NodeStore import NodeStore
10 1
from sdoc.sdoc2.formatter.html.HtmlFormatter import HtmlFormatter
11
12
13 1
class ItemizeHtmlFormatter(HtmlFormatter):
14
    """
15
    HtmlFormatter for generating HTML code for itemize.
16
    """
17
18
    # ------------------------------------------------------------------------------------------------------------------
19 1
    def generate(self, node, file):
20
        """
21
        Generates the HTML code for an itemize node.
22
23
        :param sdoc.sdoc2.node.ItemizeNode.ItemizeNode node: The itemize node.
24
        :param file file: The output file.
25
        """
26 1
        file.write('<ul>')
27 1
        HtmlFormatter.generate(self, node, file)
28 1
        file.write('</ul>')
29
30
31
# ----------------------------------------------------------------------------------------------------------------------
32
NodeStore.register_formatter('itemize', 'html', ItemizeHtmlFormatter)
33