summaryrefslogtreecommitdiff
path: root/sphinx/builder.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-11-04 08:41:42 +0100
committerGeorg Brandl <georg@python.org>2008-11-04 08:41:42 +0100
commit40fbd63eefff2314da7bb62710b390fea004d3a3 (patch)
treeab886c3c1555ab7890e11383bf3d7533257e87eb /sphinx/builder.py
parentaf94c013196a2381f48fd2168109854670a1462c (diff)
downloadsphinx-git-40fbd63eefff2314da7bb62710b390fea004d3a3.tar.gz
Don't generate HTML modindex if no modules are present.
Diffstat (limited to 'sphinx/builder.py')
-rw-r--r--sphinx/builder.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/builder.py b/sphinx/builder.py
index b3e36b455..eaaaaf1a4 100644
--- a/sphinx/builder.py
+++ b/sphinx/builder.py
@@ -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))