Don't generate HTML modindex if no modules are present.

This commit is contained in:
Georg Brandl
2008-11-04 08:41:42 +01:00
parent af94c01319
commit 40fbd63eef
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -58,6 +58,9 @@ New features added
used to disable the anchor-link creation after headlines and
definition links.
- Only generate a module index if there are some modules in the
documentation.
* New and changed config values:
- Added support for internationalization in generated text with the
+2 -2
View File
@@ -425,7 +425,7 @@ class StandaloneHTMLBuilder(Builder):
rellinks = []
if self.config.html_use_index:
rellinks.append(('genindex', _('General Index'), 'I', _('index')))
if self.config.html_use_modindex:
if self.config.html_use_modindex and self.env.modules:
rellinks.append(('modindex', _('Global Module Index'), 'M', _('modules')))
self.globalcontext = dict(
@@ -559,7 +559,7 @@ class StandaloneHTMLBuilder(Builder):
# the global module index
if self.config.html_use_modindex:
if self.config.html_use_modindex and self.env.modules:
# the sorted list of all modules, for the global module index
modules = sorted(((mn, (self.get_relative_uri('modindex', fn) +
'#module-' + mn, sy, pl, dep))