diff options
| author | georg.brandl <devnull@localhost> | 2008-05-02 09:00:09 +0000 |
|---|---|---|
| committer | georg.brandl <devnull@localhost> | 2008-05-02 09:00:09 +0000 |
| commit | 061d4d72ac4fdf9d2be55b80aa3e5d6513a07940 (patch) | |
| tree | 7a65ee7af73cc11d39df0abad28fb899bab8e0cf /sphinx/htmlhelp.py | |
| parent | dcdb22a32739d810f0f562d9e9d422e5a7be1693 (diff) | |
| download | sphinx-061d4d72ac4fdf9d2be55b80aa3e5d6513a07940.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 b3bbd4f6..7ad6b2e7 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() |
