'Note a TOC tree directive in a document and gather information about
file relations from it.'

def note_toctree(self, docname, toctreenode):

    if toctreenode['glob']:
        self.glob_toctrees.add(docname)
    if toctreenode.get('numbered'):
        self.numbered_toctrees.add(docname)
    includefiles = toctreenode['includefiles']
    for includefile in includefiles:
        self.files_to_rebuild.setdefault(includefile, set()).add(docname)
    self.toctree_includes.setdefault(docname, []).extend(includefiles)
