mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
intersphinx role: new inventory parsing from role name
This commit is contained in:
@@ -14,8 +14,31 @@
|
||||
- ``module10`` is only defined here, but should still not be resolved to:
|
||||
:external:py:mod:`module10`
|
||||
|
||||
|
||||
- a function in inv:
|
||||
:external:py:func:`module1.func`
|
||||
- a method, but with old style inventory prefix, which shouldn't work:
|
||||
:external:py:meth:`inv:Foo.bar`
|
||||
- a non-existing role:
|
||||
:external:py:nope:`something`
|
||||
|
||||
.. default-domain:: cpp
|
||||
|
||||
- a type where the default domain is used to find the role:
|
||||
:external:type:`std::uint8_t`
|
||||
- a non-existing role in default domain:
|
||||
:external:nope:`somethingElse`
|
||||
|
||||
- two roles in ``std`` which can be found without a default domain:
|
||||
|
||||
- :external:doc:`docname`
|
||||
- :external:option:`ls -l`
|
||||
|
||||
|
||||
- a function with explicit inventory:
|
||||
:external:inv+c:func:`CFunc`
|
||||
- a class with explicit non-existing inventory, which also has upper-case in name:
|
||||
:external:invNope+cpp:class:`foo::Bar`
|
||||
|
||||
|
||||
- explicit title:
|
||||
:external:cpp:type:`FoonsTitle <foons>`
|
||||
|
||||
@@ -552,3 +552,20 @@ def test_intersphinx_role(app, warning):
|
||||
|
||||
assert html.format('sub/foo.html#module1.func') in content
|
||||
assert "WARNING: external py:meth reference target not found: inv:Foo.bar" in wStr
|
||||
|
||||
assert "WARNING: role for external cross-reference not found: py:nope" in wStr
|
||||
|
||||
# default domain
|
||||
assert html.format('index.html#std_uint8_t') in content
|
||||
assert "WARNING: role for external cross-reference not found: nope" in wStr
|
||||
|
||||
# std roles without domain prefix
|
||||
assert html.format('docname.html') in content
|
||||
assert html.format('index.html#cmdoption-ls-l') in content
|
||||
|
||||
# explicit inventory
|
||||
assert html.format('cfunc.html#CFunc') in content
|
||||
#assert "WARNING: inventory for external cross-reference not found: invNope" in wStr
|
||||
|
||||
# explicit title
|
||||
assert html.format('index.html#foons') in content
|
||||
|
||||
Reference in New Issue
Block a user