mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
intersphinx: more role testing
This commit is contained in:
parent
35dcc60a7c
commit
8605644e83
@ -4,8 +4,22 @@
|
|||||||
.. py:module:: module1
|
.. py:module:: module1
|
||||||
|
|
||||||
:intersphinx:py:func:`func`
|
:intersphinx:py:func:`func`
|
||||||
|
:intersphinx:py:func:`inv:func`
|
||||||
:intersphinx:py:meth:`Foo.bar`
|
:intersphinx:py:meth:`Foo.bar`
|
||||||
|
:intersphinx:py:meth:`inv:Foo.bar`
|
||||||
|
|
||||||
:intersphinx:c:func:`CFunc`
|
:intersphinx:c:func:`CFunc`
|
||||||
|
:intersphinx:c:func:`inv:CFunc`
|
||||||
:intersphinx:doc:`docname`
|
:intersphinx:doc:`docname`
|
||||||
|
:intersphinx:doc:`inv:docname`
|
||||||
:intersphinx:option:`ls -l`
|
:intersphinx:option:`ls -l`
|
||||||
|
:intersphinx:option:`inv:ls -l`
|
||||||
|
|
||||||
|
.. cpp:type:: std::uint8_t
|
||||||
|
.. cpp:class:: foo::Bar
|
||||||
|
|
||||||
|
:intersphinx:cpp:type:`std::uint8_t`
|
||||||
|
:intersphinx:cpp:class:`inv:foo::Bar`
|
||||||
|
|
||||||
|
:intersphinx:cpp:type:`FoonsTitle <foons>`
|
||||||
|
:intersphinx:cpp:type:`inv:BarType <foons::bartype>`
|
@ -543,30 +543,18 @@ def test_intersphinx_role(app):
|
|||||||
app.build()
|
app.build()
|
||||||
content = (app.outdir / 'index.html').read_text()
|
content = (app.outdir / 'index.html').read_text()
|
||||||
|
|
||||||
# :intersphinx:py:module:`module1`
|
targets = (
|
||||||
assert ('<a class="reference external" href="http://example.org/foo.html#module-module1"'
|
'foo.html#module-module1',
|
||||||
' title="(in foo v2.0)">' in content)
|
'foo.html#module-module2',
|
||||||
|
'sub/foo.html#module1.func',
|
||||||
# :intersphinx:py:module:`inv:module2`
|
'index.html#foo.Bar.baz',
|
||||||
assert ('<a class="reference external" href="http://example.org/foo.html#module-module2"'
|
'cfunc.html#CFunc',
|
||||||
' title="(in foo v2.0)">' in content)
|
'docname.html',
|
||||||
|
'index.html#cmdoption-ls-l',
|
||||||
# py:module + :intersphinx:py:function:`func`
|
'index.html#std_uint8_t',
|
||||||
assert ('<a class="reference external" href="http://example.org/sub/foo.html#module1.func"'
|
'index.html#foons',
|
||||||
' title="(in foo v2.0)">' in content)
|
'index.html#foons_bartype',
|
||||||
|
)
|
||||||
# py:module + :intersphinx:py:method:`Foo.bar`
|
html = '<a class="reference external" href="http://example.org/{}" title="(in foo v2.0)">'
|
||||||
assert ('<a class="reference external" href="http://example.org/index.html#foo.Bar.baz"'
|
for t in targets:
|
||||||
' title="(in foo v2.0)">' in content)
|
assert html.format(t) in content
|
||||||
|
|
||||||
# :intersphinx:c:function:`CFunc`
|
|
||||||
assert ('<a class="reference external" href="http://example.org/cfunc.html#CFunc"'
|
|
||||||
' title="(in foo v2.0)">' in content)
|
|
||||||
|
|
||||||
# :intersphinx:doc:`docname`
|
|
||||||
assert ('<a class="reference external" href="http://example.org/docname.html"'
|
|
||||||
' title="(in foo v2.0)">' in content)
|
|
||||||
|
|
||||||
# :intersphinx:option:`ls -l`
|
|
||||||
assert ('<a class="reference external" href="http://example.org/index.html#cmdoption-ls-l"'
|
|
||||||
' title="(in foo v2.0)">' in content)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user