sdoc.sdoc2.formatter.html.ItemizeHtmlFormatter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 28
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ItemizeHtmlFormatter.generate() 0 10 1
1 1
from typing import Any
2
3 1
from sdoc.sdoc2.formatter.html.HtmlFormatter import HtmlFormatter
4 1
from sdoc.sdoc2.node.ItemizeNode import ItemizeNode
5 1
from sdoc.sdoc2.NodeStore import NodeStore
6
7
8 1
class ItemizeHtmlFormatter(HtmlFormatter):
9
    """
10
    HtmlFormatter for generating HTML code for itemize.
11
    """
12
13
    # ------------------------------------------------------------------------------------------------------------------
14 1
    def generate(self, node: ItemizeNode, file: Any) -> None:
15
        """
16
        Generates the HTML code for an itemize node.
17
18
        :param ItemizeNode node: The itemize node.
19
        :param any file: The output file.
20
        """
21 1
        file.write('<ul>')
22 1
        HtmlFormatter.generate(self, node, file)
23 1
        file.write('</ul>')
24
25
26
# ----------------------------------------------------------------------------------------------------------------------
27
NodeStore.register_formatter('itemize', 'html', ItemizeHtmlFormatter)
28