| Total Complexity | 1 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| 1 | """ |
||
| 14 | class ReferenceHtmlFormatter(HtmlFormatter): |
||
| 15 | """ |
||
| 16 | HtmlFormatter for generating HTML code for references. |
||
| 17 | """ |
||
| 18 | |||
| 19 | # ------------------------------------------------------------------------------------------------------------------ |
||
| 20 | def generate(self, node, file): |
||
| 21 | """ |
||
| 22 | Generates the HTML code for a reference node. |
||
| 23 | |||
| 24 | :param sdoc.sdoc2.node.ReferenceNode.ReferenceNode node: The reference node. |
||
| 25 | :param file file: The output file. |
||
| 26 | """ |
||
| 27 | attributes = {'href': node.get_option_value('href')} |
||
| 28 | |||
| 29 | file.write(Html.generate_element('a', attributes, node._argument)) |
||
|
|
|||
| 30 | |||
| 31 | super().generate(node, file) |
||
| 32 | |||
| 35 |
Prefixing a member variable
_is usually regarded as the equivalent of declaring it with protected visibility that exists in other languages. Consequentially, such a member should only be accessed from the same class or a child class: