Issues (60)

sdoc/sdoc2/node/ReferenceNode.py (1 issue)

1 1
from typing import Dict
2
3 1
from cleo.io.io import IO
4
5 1
from sdoc.sdoc2.node.Node import Node
6 1
from sdoc.sdoc2.NodeStore import NodeStore
7
8
9 1 View Code Duplication
class ReferenceNode(Node):
0 ignored issues
show
This code seems to be duplicated in your project.
Loading history...
10
    """
11
    SDoc2 node for references.
12
    """
13
14
    # ------------------------------------------------------------------------------------------------------------------
15 1
    def __init__(self, io: IO, options: Dict[str, str], argument: str):
16
        """
17
        Object constructor.
18
19
        :param OutputStyle io: The IO object.
20
        :param dict[str,str] options: The options of this reference.
21
        :param str argument: The title of this reference.
22
        """
23 1
        super().__init__(io, 'ref', options, argument)
24
25 1
        self.text = ''
26 1
        """
27
        The text of a reference.
28
29
        :type: str
30
        """
31
32
    # ------------------------------------------------------------------------------------------------------------------
33 1
    def get_command(self) -> str:
34
        """
35
        Returns the command of this node, i.e. reference.
36
        """
37 1
        return 'ref'
38
39
    # ------------------------------------------------------------------------------------------------------------------
40 1
    def is_block_command(self) -> bool:
41
        """
42
        Returns False.
43
        """
44 1
        return False
45
46
    # ------------------------------------------------------------------------------------------------------------------
47 1
    def is_inline_command(self) -> bool:
48
        """
49
        Returns True.
50
        """
51
        return True
52
53
    # ------------------------------------------------------------------------------------------------------------------
54 1
    def is_phrasing(self) -> bool:
55
        """
56
        Returns True.
57
        """
58 1
        return True
59
60
61
# ----------------------------------------------------------------------------------------------------------------------
62
NodeStore.register_inline_command('ref', ReferenceNode)
63