Completed
Push — master ( 57e7bf...8a74a7 )
by P.R.
01:36
created

LabelHtmlFormatter   A

Complexity

Total Complexity 2

Size/Duplication

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

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.sdoc2 import node_store
10
from sdoc.sdoc2.formatter.html.HtmlFormatter import HtmlFormatter
11
12
13
class LabelHtmlFormatter(HtmlFormatter):
14
    """
15
    HtmlFormatter for generating HTML code for labels.
16
    """
17
18
    # ------------------------------------------------------------------------------------------------------------------
19
    def generate(self, node, file):
20
        """
21
        Generates the HTML code for a label node.
22
23
        :param sdoc.sdoc2.node.LabelNode.LabelNode node: The label node.
24
        :param file file: The output file.
25
        """
26
        super().generate(node, file)
27
28
    # ------------------------------------------------------------------------------------------------------------------
29
    def generate_chapter(self, node, file):
30
        """
31
        Generates the HTML code for a label node.
32
33
        :param sdoc.sdoc2.node.LabelNode.LabelNode node: The label node.
34
        :param file file: The output file.
35
        """
36
        super().generate_chapter(node, file)
37
38
# ----------------------------------------------------------------------------------------------------------------------
39
node_store.register_formatter('label', 'html', LabelHtmlFormatter)
40