sphinx/tests
Chris Sewell 565d4104d5
👌 Handle external references pointing to object types (#12133)
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>
2024-03-19 13:42:50 +01:00
..
certs linkcheck: Specify subjectAltName in test self-signed certificate 2020-11-15 18:25:39 +01:00
js [search] filter script and style elements from search result summary text. (#12057) 2024-03-17 15:14:03 +01:00
roots 👌 Handle external references pointing to object types (#12133) 2024-03-19 13:42:50 +01:00
test_builders [tests] linkcheck: add test coverage for behaviour of a locally-existing file. (#12128) 2024-03-18 18:36:22 +01:00
test_config [config] copyright correction logic: handle year-to-year ranges without trailing authorship info (#11914) 2024-02-24 16:21:29 +01:00
test_directives Split `test_build_html` 2024-01-18 00:52:25 +00:00
test_domains [lint] add FURB105 lint (#12069) 2024-03-14 11:05:40 +01:00
test_environment Organise tests into directories 2024-01-17 03:56:35 +00:00
test_extensions 👌 Handle external references pointing to object types (#12133) 2024-03-19 13:42:50 +01:00
test_intl [tests] use deduced `srcdir` instead of an explicit one (#12124) 2024-03-18 10:59:48 +01:00
test_markup Organise tests into directories 2024-01-17 03:56:35 +00:00
test_pycode Added support for `slice` objects in subscriptions (#11981) 2024-02-14 14:45:30 +01:00
test_theming Load themes through iteration rather than recursion 2024-01-21 03:59:31 +00:00
test_transforms Organise tests into directories 2024-01-17 03:56:35 +00:00
test_util Add show_warning_types configuration variable (#12131) 2024-03-19 10:22:28 +01:00
test_writers Organise tests into directories 2024-01-17 03:56:35 +00:00
__init__.py Make tests/ a Python package 2020-11-20 19:43:02 +01:00
conftest.py [lint] whitelist all test files except configuration and utils in tests (#12109) 2024-03-16 18:06:58 +01:00
test_addnodes.py [lint] run `mypy on tests/test_addnodes.py` (#12111) 2024-03-16 18:38:22 +01:00
test_application.py [lint] run `mypy on test_application.py` (#12112) 2024-03-16 18:29:44 +01:00
test_errors.py Drop python 3.6 support (#10468) 2022-06-16 19:33:55 +01:00
test_events.py Enable the entire pycodestyle category (#11820) 2023-12-28 06:41:32 +00:00
test_highlighting.py Relax Pygments parsing on lexing failures 2023-08-12 06:27:16 +01:00
test_project.py Cache the docname<->filename map in `Project` instances (#11575) 2023-08-10 12:25:38 +01:00
test_quickstart.py Organise tests into directories 2024-01-17 03:56:35 +00:00
test_roles.py Collapse single line docstrings 2022-02-20 03:13:45 +00:00
test_search.py Organise tests into directories 2024-01-17 03:56:35 +00:00
test_toctree.py Organise tests into directories 2024-01-17 03:56:35 +00:00
test_versioning.py Start using `pathlib.Path and deprecate sphinx.testing.path` (#11526) 2023-07-28 00:39:12 +01:00
utils.py [lint] whitelist all test files except configuration and utils in tests (#12109) 2024-03-16 18:06:58 +01:00