mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
[texinfo] Do not add the "Index" node when there are no entries.
This commit is contained in:
@@ -469,7 +469,11 @@ class TexinfoTranslator(nodes.NodeVisitor):
|
||||
continue
|
||||
self.indices.append((indexcls.localname,
|
||||
generate(content, collapsed)))
|
||||
self.indices.append((_('Index'), '\n@printindex ge\n'))
|
||||
# only add the main Index if it's not empty
|
||||
for docname in self.builder.docnames:
|
||||
if self.builder.env.indexentries[docname]:
|
||||
self.indices.append((_('Index'), '\n@printindex ge\n'))
|
||||
break
|
||||
|
||||
# this is copied from the latex writer
|
||||
# TODO: move this to sphinx.util
|
||||
|
||||
Reference in New Issue
Block a user