def set_toc_id(self): """ Don't do anything. Because we needn't this behaviour here. """ pass # ------------------------------------------------------------------------------------------------------------------ def prune_whitespace(self): """ Removes spaces from end of a paragraph. """ first = self.child_nodes[0] last = self.child_nodes[-1] for node_id in self.child_nodes: node = in_scope(node_id) if isinstance(node, TextNode): if node.id == first: node.prune_whitespace(leading=True) if node.id == last: node.prune_whitespace(trailing=True) if node.id != last and node.id != first: node.prune_whitespace() out_scope(node) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('paragraph', ParagraphNode)
""" return 'icondef' # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self) -> bool: """ Returns False. """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns True. """ return True # ------------------------------------------------------------------------------------------------------------------ def prepare_content_tree(self) -> None: """ Prepares this node for further processing. """ reference_name = self.argument attributes = self._options IconNode.add_definition(reference_name, attributes) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('icondef', IconDefNode)
def get_hierarchy_level(self, parent_hierarchy_level: int = -1) -> int: """ Returns 0. """ return 0 # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self) -> bool: """ Returns False. """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns True. """ return True # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self) -> bool: """ Returns True. """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('date', DateNode)
# ------------------------------------------------------------------------------------------------------------------ def __init__(self, io: OutputStyle, options: Dict[str, str], argument: str): """ Object constructor. :param OutputStyle io: The IO object. :param dict[str,str] options: The options of this chapter. :param str argument: The title of this chapter. """ super().__init__(io, 'chapter', options, argument) # ------------------------------------------------------------------------------------------------------------------ def get_command(self) -> str: """ Returns the command of this node, i.e. chapter. """ return 'chapter' # ------------------------------------------------------------------------------------------------------------------ def get_hierarchy_level(self, parent_hierarchy_level: int = -1) -> int: """ Returns 1. """ return 1 # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('chapter', ChapterNode)
# ------------------------------------------------------------------------------------------------------------------ @staticmethod def add_definition(name, attributes): """ Adds the definition of an icon to the icon definitions. :param str name: The name of a reference to icon definition. :param dict[str,dict[str,str]] attributes: The attributes. """ IconNode._definitions[name] = attributes # ------------------------------------------------------------------------------------------------------------------ @staticmethod def get_definition(name): """ Returns the attributes of a definition, if name of definition is exists. :param str name: The name of a definition :rtype: dict[str,str]|None """ if name in IconNode._definitions: return IconNode._definitions[name] else: return None # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('icon', IconNode)
# ------------------------------------------------------------------------------------------------------------------ def get_command(self): """ Returns the command of this node, i.e. caption. :rtype: str """ return 'caption' # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('caption', CaptionNode)
def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ------------------------------------------------------------------------------------------------------------------ def prepare_content_tree(self): """ Prepares this node for further processing. """ reference_name = self.argument attributes = self._options IconNode.add_definition(reference_name, attributes) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('icondef', IconDefNode)
return 'part' # ------------------------------------------------------------------------------------------------------------------ def get_hierarchy_level(self, parent_hierarchy_level=-1): """ Returns 0. :rtype: int """ return 0 # ------------------------------------------------------------------------------------------------------------------ def number(self, enumerable_numbers): """ Sets number of heading nodes. :param dict[str,sdoc.sdoc2.helper.Enumerable.Enumerable] enumerable_numbers: """ if 'part' not in enumerable_numbers: enumerable_numbers['part'] = Enumerable() enumerable_numbers['part'].generate_numeration(self.get_hierarchy_level()) enumerable_numbers['part'].increment_last_level() enumerable_numbers['part'].remove_starting_zeros() super().number(enumerable_numbers) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('part', PartNode)
""" Object constructor. :param None|cleo.styles.output_style.OutputStyle io: The IO object. :param dict[str,str] options: The options of this section. :param str argument: The title of this section. """ super().__init__(io, 'section', options, argument) # ------------------------------------------------------------------------------------------------------------------ def get_command(self): """ Returns the command of this node, i.e. section. :rtype: str """ return 'section' # ------------------------------------------------------------------------------------------------------------------ def get_hierarchy_level(self, parent_hierarchy_level=-1): """ Returns 2. :rtype: int """ return 2 # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('section', SectionNode)
# ------------------------------------------------------------------------------------------------------------------ def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self): """ Returns True. :rtype: bool """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('smile', SmileNode)
def get_hierarchy_level(self, parent_hierarchy_level: int = -1) -> int: """ Returns 0. """ return 0 # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self) -> bool: """ Returns False. """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns True. """ return True # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self) -> bool: """ Returns True. """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('version', VersionNode)
return 'end_paragraph' # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def prepare_content_tree(self): """ Not implemented for end paragraph nodes. """ raise RuntimeError() # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('end_paragraph', EndParagraphNode)
# ------------------------------------------------------------------------------------------------------------------ def get_command(self): """ Returns the command of this node, i.e. label. :rtype: str """ return 'label' # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('label', LabelNode)
# ------------------------------------------------------------------------------------------------------------------ def __init__(self, io: OutputStyle, options: Dict[str, str], argument: str): """ Object constructor. :param OutputStyle io: The IO object. :param dict[str,str] options: The options of this section. :param str argument: The title of this section. """ super().__init__(io, 'subsection', options, argument) # ------------------------------------------------------------------------------------------------------------------ def get_command(self) -> str: """ Returns the command of this node, i.e. subsection. """ return 'subsection' # ------------------------------------------------------------------------------------------------------------------ def get_hierarchy_level(self, parent_hierarchy_level: int = -1) -> int: """ Returns 3. """ return 3 # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('sub1section', Sub1SectionNode) NodeStore.register_inline_command('subsection', Sub1SectionNode)
def get_command(self) -> str: """ Returns the command of this node, i.e. smile. """ return 'smile' # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self) -> bool: """ Returns False. """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns True. """ return True # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self) -> bool: """ Returns True. """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('smile', SmileNode)
# ------------------------------------------------------------------------------------------------------------------ @staticmethod def strip_start_point(number): """ Removes start point if it in the number. :param str number: The number of last node. :rtype: str """ return number.lstrip('.') # ------------------------------------------------------------------------------------------------------------------ def number(self, numbers): """ Sets number for item nodes. :param dict[str,str] numbers: The number of last node. """ numbers['item'] = self.strip_start_point(numbers['item']) numbers['item'] = self._increment_last_level(numbers['item']) self._options['number'] = numbers['item'] super().number(numbers) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('item', ItemNode)
""" Returns the command of this node, i.e. unknown. """ return 'unknown' # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self) -> bool: """ Returns False. """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns True. """ return False # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self) -> bool: """ Returns True. """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_block_command('unknown', UnknownNode) NodeStore.register_inline_command('unknown', UnknownNode)
# ------------------------------------------------------------------------------------------------------------------ def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self): """ Returns True. :rtype: bool """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('ref', ReferenceNode)
# ------------------------------------------------------------------------------------------------------------------ def get_hierarchy_level(self, parent_hierarchy_level=-1): """ Returns 0. :rtype: int """ return 0 # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('title', TitleNode)
: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)
# ------------------------------------------------------------------------------------------------------------------ def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self): """ Returns True. :rtype: bool """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('br', LineBreakNode)
# ------------------------------------------------------------------------------------------------------------------ def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self): """ Returns True. :rtype: bool """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('version', VersionNode)
def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self): """ Returns True. :rtype: bool """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_block_command('unknown', UnknownNode) NodeStore.register_inline_command('unknown', UnknownNode)
""" # ------------------------------------------------------------------------------------------------------------------ def __init__(self, io: OutputStyle, options: Dict[str, str], argument: str): """ Object constructor. :param OutputStyle io: The IO object. :param dict[str,str] options: The options of this section. :param str argument: The title of this section. """ super().__init__(io, 'section', options, argument) # ------------------------------------------------------------------------------------------------------------------ def get_command(self) -> str: """ Returns the command of this node, i.e. section. """ return 'section' # ------------------------------------------------------------------------------------------------------------------ def get_hierarchy_level(self, parent_hierarchy_level: int = -1) -> int: """ Returns 2. """ return 2 # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('section', SectionNode)
# ------------------------------------------------------------------------------------------------------------------ def is_block_command(self): """ Returns False. :rtype: bool """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self): """ Returns True. :rtype: bool """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('date', DateNode)
: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)
def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ------------------------------------------------------------------------------------------------------------------ def generate_toc(self): """ Generates the table of contents. """ self._options['ids'] = [] for node in node_store.nodes.values(): if not isinstance(node, ParagraphNode) and isinstance(node, HeadingNode): node.set_toc_id() data = {'id': node.get_option_value('id'), 'arg': node.argument, 'level': node.get_hierarchy_level(), 'number': node.get_option_value('number'), 'numbering': node.numbering} self._options['ids'].append(data) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('toc', TocNode)
# ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self): """ Returns True. :rtype: bool """ return True # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self): """ Returns True. :rtype: bool """ return True # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self): """ Returns False. :rtype: bool """ return False # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('hyperlink', HyperlinkNode)
def set_toc_id(self) -> None: """ Don't do anything. Because we needn't this behaviour here. """ pass # ------------------------------------------------------------------------------------------------------------------ def prune_whitespace(self) -> None: """ Removes spaces from end of a paragraph. """ first = self.child_nodes[0] last = self.child_nodes[-1] for node_id in self.child_nodes: node = in_scope(node_id) if isinstance(node, TextNode): if node.id == first: node.prune_whitespace(leading=True) if node.id == last: node.prune_whitespace(trailing=True) if node.id != last and node.id != first: node.prune_whitespace() out_scope(node) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('paragraph', ParagraphNode)
sdoc.sdoc2.node_store.store_node(text_node) text_ids.append(text_node.id) end_paragraph_node = sdoc.sdoc2.node_store.create_inline_node('end_paragraph') text_ids.append(end_paragraph_node.id) # Checking where we need to add paragraph. if text_ids: if list_of_texts[-1]: text_ids.pop() return text_ids # ------------------------------------------------------------------------------------------------------------------ def prune_whitespace(self, leading: bool = False, trailing: bool = False): """ Method for removing whitespace in text. :param bool leading: if True, remove whitespaces from start. :param bool trailing: if True, remove whitespaces from end. """ if leading: self._argument = self._argument.lstrip() if trailing: self._argument = self._argument.rstrip() self._argument = re.sub(r'\s+', ' ', self._argument) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('TEXT', TextNode)
def get_command(self) -> str: """ Returns the command of this node, i.e. br. """ return 'br' # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self) -> bool: """ Returns False. """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns True. """ return True # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self) -> bool: """ Returns True. """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('br', LineBreakNode)
# ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns True. """ return True # ------------------------------------------------------------------------------------------------------------------ def generate_toc(self) -> None: """ Generates the table of contents. """ self._options['ids'] = [] for node in node_store.nodes.values(): if not isinstance(node, ParagraphNode) and isinstance(node, HeadingNode): node.set_toc_id() data = {'id': node.get_option_value('id'), 'arg': node.argument, 'level': node.get_hierarchy_level(), 'number': node.get_option_value('number'), 'numbering': node.numbering} self._options['ids'].append(data) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('toc', TocNode)
""" return 'part' # ------------------------------------------------------------------------------------------------------------------ def get_hierarchy_level(self, parent_hierarchy_level: int = -1) -> int: """ Returns 0. """ return 0 # ------------------------------------------------------------------------------------------------------------------ def number(self, enumerable_numbers: Dict[str, Any]) -> None: """ Sets number of heading nodes. :param dict[str,any] enumerable_numbers: """ if 'part' not in enumerable_numbers: enumerable_numbers['part'] = Enumerable() enumerable_numbers['part'].generate_numeration( self.get_hierarchy_level()) enumerable_numbers['part'].increment_last_level() enumerable_numbers['part'].remove_starting_zeros() super().number(enumerable_numbers) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('part', PartNode)
def get_command(self) -> str: """ Returns the command of this node, i.e. reference. """ return 'ref' # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self) -> bool: """ Returns False. """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns True. """ return True # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self) -> bool: """ Returns True. """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('ref', ReferenceNode)
def get_command(self) -> str: """ Returns the command of this node, i.e. hyperlink. """ return 'hyperlink' # ------------------------------------------------------------------------------------------------------------------ def is_phrasing(self) -> bool: """ Returns True. """ return True # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns True. """ return True # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self) -> bool: """ Returns False. """ return False # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('hyperlink', HyperlinkNode)
Object constructor. :param None|cleo.styles.output_style.OutputStyle io: The IO object. :param dict[str,str] options: The options of this section. :param str argument: The title of this section. """ super().__init__(io, 'sub2section', options, argument) # ------------------------------------------------------------------------------------------------------------------ def get_command(self): """ Returns the command of this node, i.e. sub2section. :rtype: str """ return 'sub2section' # ------------------------------------------------------------------------------------------------------------------ def get_hierarchy_level(self, parent_hierarchy_level=-1): """ Returns 4. :rtype: int """ return 4 # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('sub2section', Sub2SectionNode) NodeStore.register_inline_command('subsubsection', Sub2SectionNode)
# ------------------------------------------------------------------------------------------------------------------ @staticmethod def add_definition(name: str, attributes: Dict[str, str]): """ Adds the definition of an icon to the icon definitions. :param str name: The name of a reference to icon definition. :param dict[str,str] attributes: The attributes. """ IconNode._definitions[name] = attributes # ------------------------------------------------------------------------------------------------------------------ @staticmethod def get_definition(name: str) -> Optional[Dict[str, str]]: """ Returns the attributes of a definition, if name of definition is exists. :param str name: The name of a definition :rtype: dict[str,str]|None """ if name in IconNode._definitions: return IconNode._definitions[name] else: return None # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('icon', IconNode)
Returns the command of this node, i.e. end_paragraph. :rtype: str """ return 'end_paragraph' # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self) -> bool: """ Returns False. """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns False. """ return False # ------------------------------------------------------------------------------------------------------------------ def prepare_content_tree(self) -> None: """ Not implemented for end paragraph nodes. """ raise RuntimeError() # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('end_paragraph', EndParagraphNode)
def get_command(self) -> str: """ Returns the command of this node, i.e. title. """ return 'title' # ------------------------------------------------------------------------------------------------------------------ def get_hierarchy_level(self, parent_hierarchy_level: int = -1) -> int: """ Returns 0. """ return 0 # ------------------------------------------------------------------------------------------------------------------ def is_block_command(self) -> bool: """ Returns False. """ return False # ------------------------------------------------------------------------------------------------------------------ def is_inline_command(self) -> bool: """ Returns True. """ return True # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('title', TitleNode)
sdoc.sdoc2.node_store.store_node(text_node) text_ids.append(text_node.id) end_paragraph_node = sdoc.sdoc2.node_store.create_inline_node('end_paragraph') text_ids.append(end_paragraph_node.id) # Checking where we need to add paragraph. if text_ids: if list_of_texts[-1]: text_ids.pop() return text_ids # ------------------------------------------------------------------------------------------------------------------ def prune_whitespace(self, leading=False, trailing=False): """ Method for removing whitespace in text. :param bool leading: if True, remove whitespaces from start. :param bool trailing: if True, remove whitespaces from end. """ if leading: self._argument = self._argument.lstrip() if trailing: self._argument = self._argument.rstrip() self._argument = re.sub(r'\s+', ' ', self._argument) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('TEXT', TextNode)
return '.'.join(heading_numbers) # ------------------------------------------------------------------------------------------------------------------ @staticmethod def strip_start_point(number: str) -> str: """ Removes start point if it in the number. :param str number: The number of last node. """ return number.lstrip('.') # ------------------------------------------------------------------------------------------------------------------ def number(self, numbers: Dict[str, str]) -> None: """ Sets number for item nodes. :param dict[str,str] numbers: The number of last node. """ numbers['item'] = self.strip_start_point(numbers['item']) numbers['item'] = self._increment_last_level(numbers['item']) self._options['number'] = numbers['item'] super().number(numbers) # ---------------------------------------------------------------------------------------------------------------------- NodeStore.register_inline_command('item', ItemNode)