#4251: some module links didn't have proper anchors.

This commit is contained in:
Georg Brandl 2008-11-08 13:55:17 +01:00
parent 8f1aa1c5f0
commit ef3528b36e
2 changed files with 4 additions and 8 deletions

View File

@ -141,6 +141,8 @@ New features added
Bugs fixed
----------
* Fix a problem with module links not being generated in LaTeX output.
* Fix the handling of images in different directories.
* Support option lists in the text writer. Make sure that dashes

View File

@ -1045,10 +1045,6 @@ class BuildEnvironment:
elif typ == 'mod':
docname, synopsis, platform, deprecated = \
self.modules.get(target, ('','','', ''))
# just link to an anchor if there are multiple modules in one file
# because the anchor is generally below the heading which is ugly
# but can't be helped easily
anchor = ''
if not docname:
newnode = builder.app.emit_firstresult('missing-reference',
self, node, contnode)
@ -1058,11 +1054,9 @@ class BuildEnvironment:
# don't link to self
newnode = contnode
else:
if len(self.filemodules[docname]) > 1:
anchor = '#' + 'module-' + target
newnode = nodes.reference('', '')
newnode['refuri'] = (
builder.get_relative_uri(fromdocname, docname) + anchor)
newnode['refuri'] = builder.get_relative_uri(
fromdocname, docname) + '#module-' + target
newnode['reftitle'] = '%s%s%s' % (
(platform and '(%s) ' % platform),
synopsis, (deprecated and ' (deprecated)' or ''))