def collect_node_names(self) -> None:
    'Generates a unique id for each section.\n\n        Assigns the attribute ``node_name`` to each section.'

    def add_node_name(name: str) -> str:
        node_id = self.escape_id(name)
        (nth, suffix) = (1, '')
        while (((node_id + suffix) in self.written_ids) or ((node_id + suffix) in self.node_names)):
            nth += 1
            suffix = ('<%s>' % nth)
        node_id += suffix
        self.written_ids.add(node_id)
        self.node_names[node_id] = name
        return node_id
    self.document['node_name'] = 'Top'
    add_node_name('Top')
    add_node_name('top')
    self.indices = [(add_node_name(name), content) for (name, content) in self.indices]
    for section in self.document.findall(nodes.section):
        title = cast(nodes.TextElement, section.next_node(nodes.Titular))
        name = (title.astext() if title else '<untitled>')
        section['node_name'] = add_node_name(name)
Generates a unique id for each section.

Assigns the attribute ``node_name`` to each section.
def collect_node_names(self) -> None:
    'Generates a unique id for each section.\n\n        Assigns the attribute ``node_name`` to each section.'

    def add_node_name(name: str) -> str:
        node_id = self.escape_id(name)
        (nth, suffix) = (1, )
        while (((node_id + suffix) in self.written_ids) or ((node_id + suffix) in self.node_names)):
            nth += 1
            suffix = ('<%s>' % nth)
        node_id += suffix
        self.written_ids.add(node_id)
        self.node_names[node_id] = name
        return node_id
    self.document['node_name'] = 'Top'
    add_node_name('Top')
    add_node_name('top')
    self.indices = [(add_node_name(name), content) for (name, content) in self.indices]
    for section in self.document.findall(nodes.section):
        title = cast(nodes.TextElement, section.next_node(nodes.Titular))
        name = (title.astext() if title else '<untitled>')
        section['node_name'] = add_node_name(name)