Fixes #1204: use the correct relative path referring to local intersphinx targets.

This commit is contained in:
Georg Brandl 2013-09-16 10:34:29 +02:00
parent ae8782178e
commit 0551a8731c
2 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,7 @@ Bugs fixed
* #1176: Fix i18n: footnote reference number missing for auto numbered named * #1176: Fix i18n: footnote reference number missing for auto numbered named
footnote and auto symbol footnote. footnote and auto symbol footnote.
* PR#146,#1172: Fix ZeroDivisionError in parallel builds. Thanks to tychoish. * PR#146,#1172: Fix ZeroDivisionError in parallel builds. Thanks to tychoish.
* #1204: Fix wrong generation of links to local intersphinx targets.
* #1206: Fix i18n: gettext did not translate admonition directive's title. * #1206: Fix i18n: gettext did not translate admonition directive's title.
* #1232: Sphinx generated broken ePub files on Windows. * #1232: Sphinx generated broken ePub files on Windows.
* #1259: Guard the debug output call when emitting events; to prevent the * #1259: Guard the debug output call when emitting events; to prevent the

View File

@ -33,6 +33,7 @@ from os import path
import re import re
from docutils import nodes from docutils import nodes
from docutils.utils import relative_path
from sphinx.locale import _ from sphinx.locale import _
from sphinx.builders.html import INVENTORY_FILENAME from sphinx.builders.html import INVENTORY_FILENAME
@ -236,6 +237,9 @@ def missing_reference(app, env, node, contnode):
if objtype not in inventory or target not in inventory[objtype]: if objtype not in inventory or target not in inventory[objtype]:
continue continue
proj, version, uri, dispname = inventory[objtype][target] proj, version, uri, dispname = inventory[objtype][target]
if '://' not in uri and node.get('refdoc'):
# get correct path in case of subdirectories
uri = path.join(relative_path(node['refdoc'], env.srcdir), uri)
newnode = nodes.reference('', '', internal=False, refuri=uri, newnode = nodes.reference('', '', internal=False, refuri=uri,
reftitle=_('(in %s v%s)') % (proj, version)) reftitle=_('(in %s v%s)') % (proj, version))
if node.get('refexplicit'): if node.get('refexplicit'):