mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#4251: some module links didn't have proper anchors.
This commit is contained in:
parent
8f1aa1c5f0
commit
ef3528b36e
2
CHANGES
2
CHANGES
@ -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
|
||||
|
@ -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 ''))
|
||||
|
Loading…
Reference in New Issue
Block a user