Test Failed
Push — master ( 714282...4cb748 )
by P.R.
01:55 queued 13s
created

sdoc.sdoc2.formatter.html.DateHtmlFormatter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A DateHtmlFormatter.generate() 0 10 1
1
from typing import Any
2
3
from sdoc.helper.Html import Html
4
from sdoc.sdoc2.formatter.html.HtmlFormatter import HtmlFormatter
5
from sdoc.sdoc2.node.DateNode import DateNode
6
from sdoc.sdoc2.NodeStore import NodeStore
7
8
9
class DateHtmlFormatter(HtmlFormatter):
10
    """
11
    HtmlFormatter for generating HTML code for date of SDoc document.
12
    """
13
14
    # ------------------------------------------------------------------------------------------------------------------
15
    def generate(self, node: DateNode, file: Any) -> None:
16
        """
17
        Generates HTML code for a date node.
18
19
        :param DateNode node: The date node.
20
        :param any file: The output file.
21
        """
22
        html = Html.generate_element('span', {}, node.argument)
23
24
        file.write(html)
25
26
27
# ----------------------------------------------------------------------------------------------------------------------
28
NodeStore.register_formatter('date', 'html', DateHtmlFormatter)
29