[Python-checkins] r65121 - doctools/branches/0.4.x/sphinx/environment.py
georg.brandl
python-checkins at python.org
Fri Jul 18 23:41:35 CEST 2008
Author: georg.brandl
Date: Fri Jul 18 23:41:35 2008
New Revision: 65121
Log:
Warn if a toctree-included document doesn't contain a title.
Modified:
doctools/branches/0.4.x/sphinx/environment.py
Modified: doctools/branches/0.4.x/sphinx/environment.py
==============================================================================
--- doctools/branches/0.4.x/sphinx/environment.py (original)
+++ doctools/branches/0.4.x/sphinx/environment.py Fri Jul 18 23:41:35 2008
@@ -810,10 +810,15 @@
for includefile in includefiles:
try:
toc = self.tocs[includefile].deepcopy()
+ if not toc.children:
+ # empty toc means: no titles will show up in the toctree
+ self.warn(docname, 'toctree contains reference to document '
+ '%r that doesn\'t have a title: no link will be '
+ 'generated' % includefile)
except KeyError:
# this is raised if the included file does not exist
- self.warn(docname, 'toctree contains ref to nonexisting '
- 'file %r' % includefile)
+ self.warn(docname, 'toctree contains reference to nonexisting '
+ 'document %r' % includefile)
else:
# if titles_only is given, only keep the main title and
# sub-toctrees
More information about the Python-checkins
mailing list