def add_menu(self, node_name: str) -> None:
    entries = self.node_menus[node_name]
    if (not entries):
        return
    self.body.append('\n@menu\n')
    self.add_menu_entries(entries)
    if ((node_name != 'Top') or (not self.node_menus[entries[0]]) or self.config.texinfo_no_detailmenu):
        self.body.append('\n@end menu\n')
        return

    def _add_detailed_menu(name: str) -> None:
        entries = self.node_menus[name]
        if (not entries):
            return
        self.body.append(('\n%s\n\n' % self.escape(self.node_names[name])))
        self.add_menu_entries(entries)
        for subentry in entries:
            _add_detailed_menu(subentry)
    self.body.append('\n@detailmenu\n --- The Detailed Node Listing ---\n')
    for entry in entries:
        _add_detailed_menu(entry)
    self.body.append('\n@end detailmenu\n@end menu\n')
def add_menu(self, node_name: str) -> None:
    entries = self.node_menus[node_name]
    if (not entries):
        return
    self.body.append('\n@menu\n')
    self.add_menu_entries(entries)
    if ((node_name != 'Top') or (not self.node_menus[entries[0]]) or self.config.texinfo_no_detailmenu):
        self.body.append('\n@end menu\n')
        return

    def _add_detailed_menu(name: str) -> None:
        entries = self.node_menus[name]
        if (not entries):
            return
        self.body.append(('\n%s\n\n' % self.escape(self.node_names[name])))
        self.add_menu_entries(entries)
        for subentry in entries:
            _add_detailed_menu(subentry)
    self.body.append('\n@detailmenu\n --- The Detailed Node Listing ---\n')
    for entry in entries:
        _add_detailed_menu(entry)
    self.body.append('\n@end detailmenu\n@end menu\n')