for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from typing import Dict
from cleo.io.io import IO
from sdoc.sdoc2.node.Node import Node
from sdoc.sdoc2.NodeStore import NodeStore
class LabelNode(Node):
"""
SDoc2 node for labels.
# ------------------------------------------------------------------------------------------------------------------
def __init__(self, io: IO, options: Dict[str, str], argument: str):
Object constructor.
:param OutputStyle io: The IO object.
:param dict[str,str] options: The options of this label.
:param str argument: The title of this label.
super().__init__(io, 'label', options, argument)
def get_command(self) -> str:
Returns the command of this node, i.e. label.
return 'label'
def is_block_command(self) -> bool:
Returns False.
return False
def is_inline_command(self) -> bool:
Returns True.
return True
# ----------------------------------------------------------------------------------------------------------------------
NodeStore.register_inline_command('label', LabelNode)