Completed
Pull Request — master (#22)
by Oleg
01:36
created

sdoc.sdoc2.formatter.html.LabelHtmlFormatter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %
Metric Value
dl 0
loc 24
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generate() 0 8 1
A generate_chapter() 0 8 1
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9
from sdoc.helper.Html import Html
0 ignored issues
show
Unused Code introduced by
Unused Html imported from sdoc.helper.Html
Loading history...
10
from sdoc.sdoc2 import node_store
11
from sdoc.sdoc2.formatter.html.HtmlFormatter import HtmlFormatter
12
13
14
class LabelHtmlFormatter(HtmlFormatter):
15
    """
16
    HtmlFormatter for generating HTML code for labels.
17
    """
18
19
    # ------------------------------------------------------------------------------------------------------------------
20
    def generate(self, node, file):
21
        """
22
        Generates the HTML code for a label node.
23
24
        :param sdoc.sdoc2.node.LabelNode.LabelNode node: The label node.
25
        :param file file: The output file.
26
        """
27
        super().generate(node, file)
28
29
    # ------------------------------------------------------------------------------------------------------------------
30
    def generate_chapter(self, node, file):
31
        """
32
        Generates the HTML code for a label node.
33
34
        :param sdoc.sdoc2.node.LabelNode.LabelNode node: The label node.
35
        :param file file: The output file.
36
        """
37
        super().generate_chapter(node, file)
38
39
# ----------------------------------------------------------------------------------------------------------------------
40
node_store.register_formatter('label', 'html', LabelHtmlFormatter)
41