I have the following classes:
class A:
def x():
""" Do the thing. """
class B(A):
def x():
"""
Do the thing, but better than the :py:meth:`parent <A.x>`
"""
The entire module is autodoc
ed. I would like to have a link to the parent implementation of x
that renders as "parent", not as "parent
". How do I remove the code formatting from the custom method reference?
The link itself is interpreted correctly based on the first rule of cross reference formats.
Here is the generated HTML for the link:
<a class="reference internal" href="#my_module.A.x" title="my_module.A.x">
<code class="xref py py-meth docutils literal">
<span class="pre">parent</span>
</code>
</a>
[Line breaks inserted by me for legibility. Original HTML has no breaks or spaces between tags.]
I am using Sphinx 1.6.3 with Python 3.6.2 in an Anaconda environment.
Inverse question is here: Sphinx add code formatting to :ref: