def process_autosummary_toc(app, doctree):
 env = app.builder.env
 crawled = {}
 def crawl_toc(node, depth=1):
  crawled[node] = True
  for (j, subnode) in enumerate(node):
   try:
    if (isinstance(subnode, autosummary_toc) and isinstance(subnode[0], addnodes.toctree)):
     env.note_toctree(env.docname, subnode[0])
     continue
   except IndexError:
    continue
   if (not isinstance(subnode, nodes.section)):
    continue
   if (subnode not in crawled):
    crawl_toc(subnode, (depth + 1))
 crawl_toc(doctree)

def process_autosummary_toc ( app , doctree ) : env = app . builder . env crawled = { } def crawl_toc ( node , depth = 1 ) : crawled [ node ] = True for ( j , subnode ) in enumerate ( node ) : try : if ( isinstance ( subnode , autosummary_toc ) and isinstance ( subnode [ 0 ] , addnodes . toctree ) ) : env . note_toctree ( env . docname , subnode [ 0 ] ) continue except IndexError : continue if ( not isinstance ( subnode , nodes . section ) ) : continue if ( subnode not in crawled ) : crawl_toc ( subnode , ( depth + 1 ) ) crawl_toc ( doctree )
insert items described in autosummary:: to the toc tree .