|
1
|
|
|
""" |
|
2
|
|
|
SDoc |
|
3
|
|
|
|
|
4
|
|
|
Copyright 2016 Set Based IT Consultancy |
|
5
|
|
|
|
|
6
|
|
|
Licence MIT |
|
7
|
|
|
""" |
|
8
|
|
|
# ---------------------------------------------------------------------------------------------------------------------- |
|
9
|
|
|
from sdoc.sdoc2.NodeStore import NodeStore |
|
10
|
|
|
from sdoc.sdoc2.node.Node import Node |
|
11
|
|
|
|
|
12
|
|
|
|
|
13
|
|
|
class LineBreakNode(Node): |
|
14
|
|
|
""" |
|
15
|
|
|
SDoc2 node for line breaks. |
|
16
|
|
|
""" |
|
17
|
|
|
|
|
18
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
|
19
|
|
|
def __init__(self, io, options, argument): |
|
20
|
|
|
""" |
|
21
|
|
|
Object constructor. |
|
22
|
|
|
|
|
23
|
|
|
:param None|cleo.styles.output_style.OutputStyle io: The IO object. |
|
24
|
|
|
:param dict[str,str] options: The options of this smile. |
|
25
|
|
|
:param str argument: Not used. |
|
26
|
|
|
""" |
|
27
|
|
|
super().__init__(io, 'br', options, argument) |
|
28
|
|
|
|
|
29
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
|
30
|
|
|
def get_command(self): |
|
31
|
|
|
""" |
|
32
|
|
|
Returns the command of this node, i.e. br. |
|
33
|
|
|
|
|
34
|
|
|
:rtype: str |
|
35
|
|
|
""" |
|
36
|
|
|
return 'br' |
|
37
|
|
|
|
|
38
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
|
39
|
|
|
def is_block_command(self): |
|
40
|
|
|
""" |
|
41
|
|
|
Returns False. |
|
42
|
|
|
|
|
43
|
|
|
:rtype: bool |
|
44
|
|
|
""" |
|
45
|
|
|
return False |
|
46
|
|
|
|
|
47
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
|
48
|
|
|
def is_inline_command(self): |
|
49
|
|
|
""" |
|
50
|
|
|
Returns True. |
|
51
|
|
|
|
|
52
|
|
|
:rtype: bool |
|
53
|
|
|
""" |
|
54
|
|
|
return True |
|
55
|
|
|
|
|
56
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
|
57
|
|
|
def is_phrasing(self): |
|
58
|
|
|
""" |
|
59
|
|
|
Returns True. |
|
60
|
|
|
|
|
61
|
|
|
:rtype: bool |
|
62
|
|
|
""" |
|
63
|
|
|
return True |
|
64
|
|
|
|
|
65
|
|
|
|
|
66
|
|
|
# ---------------------------------------------------------------------------------------------------------------------- |
|
67
|
|
|
NodeStore.register_inline_command('br', LineBreakNode) |
|
68
|
|
|
|