Commits

Georg Brandl  committed 98ab679 Merge

Merged in michaeljones/sphinx (pull request #3)

  • Participants
  • Parent commits 2dfe268, f4cdcca

Comments (0)

Files changed (1)

File sphinx/environment.py

                                 toplevel[1][:] = subtrees
                     # resolve all sub-toctrees
                     for toctreenode in toc.traverse(addnodes.toctree):
-                        i = toctreenode.parent.index(toctreenode) + 1
-                        for item in _entries_from_toctree(toctreenode,
-                                                          subtree=True):
-                            toctreenode.parent.insert(i, item)
-                            i += 1
-                        toctreenode.parent.remove(toctreenode)
+                        if not ( toctreenode.get('hidden', False) and not includehidden ):
+                            i = toctreenode.parent.index(toctreenode) + 1
+                            for item in _entries_from_toctree(toctreenode,
+                                                              subtree=True):
+                                toctreenode.parent.insert(i, item)
+                                i += 1
+                            toctreenode.parent.remove(toctreenode)
                     if separate:
                         entries.append(toc)
                     else:
                 if 'orphan' in self.metadata[docname]:
                     continue
                 self.warn(docname, 'document isn\'t included in any toctree')
+