def generate(content: List[Tuple[(str, List[IndexEntry])]], collapsed: bool) -> str:
    ret = ['\n@menu\n']
    for (_letter, entries) in content:
        for entry in entries:
            if (not entry[3]):
                continue
            name = self.escape_menu(entry[0])
            sid = self.get_short_id(('%s:%s' % (entry[2], entry[3])))
            desc = self.escape_arg(entry[6])
            me = self.format_menu_entry(name, sid, desc)
            ret.append(me)
    ret.append('@end menu\n')
    return ''.join(ret)
def generate(content: List[Tuple[(str, List[IndexEntry])]], collapsed: bool) -> str:
    ret = ['\n@menu\n']
    for (_letter, entries) in content:
        for entry in entries:
            if (not entry[3]):
                continue
            name = self.escape_menu(entry[0])
            sid = self.get_short_id(('%s:%s' % (entry[2], entry[3])))
            desc = self.escape_arg(entry[6])
            me = self.format_menu_entry(name, sid, desc)
            ret.append(me)
    ret.append('@end menu\n')
    return .join(ret)