Completed
Push — master ( 793cf7...172351 )
by P.R.
04:33
created

ParagraphHtmlFormatter.generate_chapter()   A

Complexity

Conditions 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 4.3145

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 1
cts 6
cp 0.1666
rs 9.4285
c 0
b 0
f 0
cc 2
crap 4.3145
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9 1
from sdoc.sdoc2 import node_store
10 1
from sdoc.sdoc2.formatter.html.HtmlFormatter import HtmlFormatter
11
12
13 1
class ParagraphHtmlFormatter(HtmlFormatter):
14
    """
15
    HtmlFormatter for generating HTML code for paragraph.
16
    """
17
    # ------------------------------------------------------------------------------------------------------------------
18 1
    def generate(self, node, file):
19
        """
20
        Generates the HTML code for a paragraph node.
21
22
        :param sdoc.sdoc2.node.ParagraphNode.ParagraphNode node: The paragraph node.
23
        :param file file: The output file.
24
        """
25
        file.write('<p>')
26
        HtmlFormatter.generate(self, node, file)
27
        file.write('</p>')
28
29
# ----------------------------------------------------------------------------------------------------------------------
30
node_store.register_formatter('paragraph', 'html', ParagraphHtmlFormatter)
31