def _add_descinfo(self, node, summary, sigs, child_descs): entry = {'fullname': get_fullname(node), 'desctype': node.get('desctype', 'module'), 'summary': summary, 'signatures': sigs, 'children': [get_refid(n) for n in child_descs], 'refid': get_refid(node), 'docname': self.docname} self._add_descinfo_entry(node, entry)
def _add_descinfo(self, node, summary, sigs, child_descs): entry = { "fullname": get_fullname(node), "desctype": node.get("desctype", "module"), "summary": summary, "signatures": sigs, "children": [get_refid(n) for n in child_descs], "refid": get_refid(node), "docname": self.docname, } self._add_descinfo_entry(node, entry)
def add_toc(desc_node, env, section_node=None): """Add a table of contents to a desc node""" if (section_node is not None): refid = get_refid(section_node) else: refid = get_refid(desc_node) descinfo = get_descinfo_refid(refid, env) toc = build_toc(descinfo, env) if toc is None: return content_node = desc_node[-1] insert_at = 0 if descinfo['summary']: # if have a summary insert_at += 1 content_node.insert(insert_at, toc)
def add_toc(desc_node, env, section_node=None): """Add a table of contents to a desc node""" if section_node is not None: refid = get_refid(section_node) else: refid = get_refid(desc_node) descinfo = get_descinfo_refid(refid, env) toc = build_toc(descinfo, env) if toc is None: return content_node = desc_node[-1] insert_at = 0 if descinfo["summary"]: # if have a summary insert_at += 1 content_node.insert(insert_at, toc)
def _add_section(self, node): entry = { "docname": self.docname, "fullname": get_fullname(node), "refid": get_refid(node), } self.env.pyg_sections.append(entry)
def _add_section(self, node): entry = { 'docname': self.docname, 'fullname': get_fullname(node), 'refid': get_refid(node) } self.env.pyg_sections.append(entry)
def get_descinfo(node, env): return get_descinfo_refid(get_refid(node), env)
def _add_descinfo_entry(self, node, entry): key = get_refid(node) if key.startswith(MODULE_ID_PREFIX): key = key[len(MODULE_ID_PREFIX):] self.env.pyg_descinfo_tbl[key] = entry
def _add_section(self, node): entry = {'docname': self.docname, 'fullname': get_fullname(node), 'refid': get_refid(node)} self.env.pyg_sections.append(entry)