'Get the total table of contents, containing the master_doc
and pre and post files not managed by sphinx.'

def get_toc(self):

    doctree = self.env.get_and_resolve_doctree(self.config.master_doc, self, prune_toctrees=False, includehidden=True)
    self.refnodes = self.get_refnodes(doctree, [])
    master_dir = path.dirname(self.config.master_doc)
    if master_dir:
        master_dir += '/'
        for item in self.refnodes:
            item['refuri'] = (master_dir + item['refuri'])
    self.toc_add_files(self.refnodes)
