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 CaptionNode(Node):
"""
SDoc2 node for captions.
# ------------------------------------------------------------------------------------------------------------------
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 caption.
:param str argument: The title of this caption.
super().__init__(io, 'caption', options, argument)
def get_command(self) -> str:
Returns the command of this node, i.e. caption.
return 'caption'
def is_block_command(self) -> bool:
Returns False.
return False
def is_inline_command(self) -> bool:
Returns True.
return True
# ----------------------------------------------------------------------------------------------------------------------
NodeStore.register_inline_command('caption', CaptionNode)