Total Complexity | 2 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Coverage | 28.57% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | """ |
||
15 | 1 | class IconHtmlFormatter(HtmlFormatter): |
|
16 | """ |
||
17 | HtmlFormatter for icons in HTML representation. |
||
18 | """ |
||
19 | |||
20 | # ------------------------------------------------------------------------------------------------------------------ |
||
21 | 1 | def generate(self, node, file): |
|
22 | """ |
||
23 | Generates the HTML code for an icon node. |
||
24 | |||
25 | :param sdoc.sdoc2.node.IconNode.IconNode node: The icon node. |
||
26 | :param file file: The output file. |
||
27 | """ |
||
28 | attributes = IconNode.get_definition(node.argument) |
||
29 | |||
30 | if attributes: |
||
31 | img_element = Html.generate_void_element('img', attributes) |
||
32 | file.write(img_element) |
||
33 | |||
34 | else: |
||
35 | NodeStore.error("There is no definition for icon with name '{}'".format(node.argument)) |
||
36 | |||
39 |