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

ItemizeHtmlFormatter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 40%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
dl 0
loc 15
ccs 2
cts 5
cp 0.4
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 10 1
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