Skip to content

Can't use intersphinx with Sphinx's documentation settings #5562

@ericholscher

Description

@ericholscher

Problem

  • I can't use intersphinx with Sphinx's documentation settings

Procedure to reproduce the problem

intersphinx_mapping = {
    'sphinx': ('http://sphinx.readthedocs.io/en/latest/', None),
}
:ref:`gettext_uuid <sphinx:gettext_uuid>`

Error logs / results

/Users/eric/projects/readthedocs.org/docs/guides/manage-translations.rst:43: WARNING: undefined label: sphinx:gettext_uuid (if the link has no caption the label must precede a section header)

Expected results

It should generate a URL to the proper Sphinx docs

Debugging

I tracked this down to the fact that my Sphinx run doesn't know about the std:confval reference type. I have it in the intersphinx data:

ipdb> env.intersphinx_inventory.keys()
dict_keys(['py:class', 'py:method', 'py:module', 'py:attribute', 'py:data', 'py:function', 'py:classmethod', 'py:exception', 'py:staticmethod', 'std:option', 'std:label', 'std:setting', 'std:envvar', 'std:templatefilter', 'std:term', 'std:fieldlookup', 'std:templatetag', 'std:django-admin', 'std:doc', 'c:var', 'c:type', 'c:function', 'c:member', 'c:macro', 'std:pdbcommand', 'std:cmdoption', 'std:opcode', 'std:token', 'std:2to3fixer', 'cpp:class', 'cpp:union', 'cpp:member', 'cpp:type', 'cpp:templateParam', 'cpp:function', 'cpp:functionParam', 'cpp:concept', 'js:function', 'js:class', 'rst:role', 'rst:directive', 'std:confval', 'std:event'])

But when I create the list of possible targets from my list of domains, it isn't there:

ipdb> objtypes
['c:function', 'c:member', 'c:macro', 'c:type', 'c:var', 'cpp:class', 'cpp:union', 'cpp:function', 'cpp:member', 'cpp:type', 'cpp:concept', 'cpp:enum', 'cpp:enumerator', 'js:function', 'js:method', 'js:class', 'js:data', 'js:attribute', 'js:module', 'py:function', 'py:data', 'py:class', 'py:exception', 'py:method', 'py:classmethod', 'py:staticmethod', 'py:attribute', 'py:module', 'rst:directive', 'rst:role', 'std:term', 'std:token', 'std:label', 'std:envvar', 'std:cmdoption', 'std:doc', 'std:setting', 'http:options', 'http:head', 'http:post', 'http:get', 'http:put', 'http:patch', 'http:delete', 'http:trace', 'http:connect', 'http:copy', 'http:any']

Code

I believe the issue is the logic here, which takes into account the installed Domains, but not the known labels in the intersphinx_inventory:

objtypes = ['%s:%s' % (domain.name, objtype)
for domain in env.domains.values()
for objtype in domain.object_types]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions