Give line number info where possible in toctree-related warnings.

This commit is contained in:
Georg Brandl 2011-01-07 14:22:27 +01:00
parent 9d4f8c4a16
commit 33647ec898

View File

@ -1240,11 +1240,12 @@ class BuildEnvironment:
self.warn(docname,
'toctree contains reference to document '
'%r that doesn\'t have a title: no link '
'will be generated' % ref)
'will be generated' % ref, toctreenode.line)
except KeyError:
# this is raised if the included file does not exist
self.warn(docname, 'toctree contains reference to '
'nonexisting document %r' % ref)
'nonexisting document %r' % ref,
toctreenode.line)
else:
# if titles_only is given, only keep the main title and
# sub-toctrees