summaryrefslogtreecommitdiff
path: root/sphinx
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
commit499fdf51ac58975d258cd601e1be9486e66663dc (patch)
treeab886c3c1555ab7890e11383bf3d7533257e87eb /sphinx
parent3d2af2e3c655e794cd7ec253294cda84fded43fa (diff)
downloadsphinx-499fdf51ac58975d258cd601e1be9486e66663dc.tar.gz
Don't generate HTML modindex if no modules are present.
Diffstat (limited to 'sphinx')
-rw-r--r--sphinx/builder.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/builder.py b/sphinx/builder.py
index b3e36b45..eaaaaf1a 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))