Completed
Push — master ( 9e402b...ef0f01 )
by P.R.
02:03
created

LineBreakHtmlFormatter.generate()   A

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 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.NodeStore import NodeStore
11
from sdoc.sdoc2.formatter.html.HtmlFormatter import HtmlFormatter
12
13
14
class LineBreakHtmlFormatter(HtmlFormatter):
15
    """
16
    HtmlFormatter for generating HTML code for a linebreak.
17
    """
18
19
    # ------------------------------------------------------------------------------------------------------------------
20
    def generate(self, node, file):
21
        """
22
        Generates the HTML code for a smile node.
23
24
        :param sdoc.sdoc2.node.LineBreakNode.LineBreakNode node: The linebreak node.
25
        :param file file: The output file.
26
        """
27
        file.write('</br>')
28
29
30
# ----------------------------------------------------------------------------------------------------------------------
31
NodeStore.register_formatter('br', 'html', LineBreakHtmlFormatter)
32