diff options
author | Georg Brandl <georg@python.org> | 2008-05-02 09:00:09 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-02 09:00:09 +0000 |
commit | ea5f9d7de77a8e3260c1797a08600f82e3a7b7d2 (patch) | |
tree | 7a65ee7af73cc11d39df0abad28fb899bab8e0cf /sphinx/htmlhelp.py | |
parent | b6f8f5d37c8ed554a1764c4b81183c7d24e56951 (diff) | |
download | sphinx-git-ea5f9d7de77a8e3260c1797a08600f82e3a7b7d2.tar.gz |
Allow any master document structure when writing the HTML help contents file.
Diffstat (limited to 'sphinx/htmlhelp.py')
-rw-r--r-- | sphinx/htmlhelp.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sphinx/htmlhelp.py b/sphinx/htmlhelp.py index b3bbd4f63..7ad6b2e70 100644 --- a/sphinx/htmlhelp.py +++ b/sphinx/htmlhelp.py @@ -150,7 +150,8 @@ def build_hhx(builder, outdir, outname): if builder.config.html_use_modindex: f.write('<LI> ' + object_sitemap % ('Global Module Index', 'modindex.html')) # the TOC - toc = builder.env.get_and_resolve_doctree(builder.config.master_doc, builder) + tocdoc = builder.env.get_and_resolve_doctree(builder.config.master_doc, builder, + prune_toctrees=False) def write_toc(node, ullevel=0): if isinstance(node, nodes.list_item): f.write('<LI> ') @@ -169,11 +170,10 @@ def build_hhx(builder, outdir, outname): elif isinstance(node, addnodes.compact_paragraph): for subnode in node: write_toc(subnode, ullevel) - elif isinstance(node, nodes.section): - write_toc(node[1], ullevel) - elif isinstance(node, nodes.document): - write_toc(node[0], ullevel) - write_toc(toc) + istoctree = lambda node: isinstance(node, addnodes.compact_paragraph) and \ + node.has_key('toctree') + for node in tocdoc.traverse(istoctree): + write_toc(node) f.write(contents_footer) finally: f.close() |