Completed
Push — master ( 793cf7...172351 )
by P.R.
04:33
created

ItemizeHtmlFormatter.generate()   A

Complexity

Conditions 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.4218

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 10
ccs 1
cts 4
cp 0.25
rs 9.4285
c 1
b 0
f 0
cc 1
crap 1.4218
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9 1
from sdoc.sdoc2 import node_store
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 1
    def generate(self, node, file):
19
        """
20
        Generates the HTML code for an itemize node.
21
22
        :param sdoc.sdoc2.node.ItemizeNode.ItemizeNode node: The itemize node.
23
        :param file file: The output file.
24
        """
25
        file.write('<ul>')
26
        HtmlFormatter.generate(self, node, file)
27
        file.write('</ul>')
28
29
# ----------------------------------------------------------------------------------------------------------------------
30
node_store.register_formatter('itemize', 'html', ItemizeHtmlFormatter)
31