Example #1
0
 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)
Example #2
0
 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)
Example #3
0
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)
Example #4
0
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)
Example #5
0
 def _add_section(self, node):
     entry = {
         "docname": self.docname,
         "fullname": get_fullname(node),
         "refid": get_refid(node),
     }
     self.env.pyg_sections.append(entry)
Example #6
0
 def _add_section(self, node):
     entry = {
         'docname': self.docname,
         'fullname': get_fullname(node),
         'refid': get_refid(node)
     }
     self.env.pyg_sections.append(entry)
Example #7
0
def get_descinfo(node, env):
    return get_descinfo_refid(get_refid(node), env)
Example #8
0
 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
Example #9
0
def get_descinfo(node, env):
    return get_descinfo_refid(get_refid(node), env)
Example #10
0
 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
Example #11
0
 def _add_section(self, node): 
     entry = {'docname': self.docname,
              'fullname': get_fullname(node),
              'refid': get_refid(node)}
     self.env.pyg_sections.append(entry)