mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
This commit fixes the issue of `objects.inv` denoting object names, whilst the `external` role only allows for role names. As an example, take the `objects.inv` for the sphinx documentation, which contains: ``` py:function compile : usage/domains/python.html#compile ``` A user might understandably expect that they could reference this using `` :external:py:function:`compile` ``, but actually this would previously error with: ``` WARNING: role for external cross-reference not found: py:function ``` this is because, `function` is the object type, yet `external` expects the related role name `func`. It should not be necessary for the user to know about this distinction, so in this commit, we add logic, to first look if the name relates to a role name (as previous, to not be back-breaking) but, if not, then also look if the name relates to an object that has a known role and, if so, use that. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> |
||
---|---|---|
.. | ||
certs | ||
js | ||
roots | ||
test_builders | ||
test_config | ||
test_directives | ||
test_domains | ||
test_environment | ||
test_extensions | ||
test_intl | ||
test_markup | ||
test_pycode | ||
test_theming | ||
test_transforms | ||
test_util | ||
test_writers | ||
__init__.py | ||
conftest.py | ||
test_addnodes.py | ||
test_application.py | ||
test_errors.py | ||
test_events.py | ||
test_highlighting.py | ||
test_project.py | ||
test_quickstart.py | ||
test_roles.py | ||
test_search.py | ||
test_toctree.py | ||
test_versioning.py | ||
utils.py |