I have this problem all the time that I want to write a docstring like this:
def foo(arg):
'''Add ``arg`` to the list of :class:`foo.bar.baz.Argument`s.'''
pass
However, that doesn't work, Sphinx will warn that
py:class reference target not found: foo.bar.baz.Argument`s
so it's treating the s after the closing backtick as part of the class name. This does not happen with e.g. punctuation marks like the dot ..
Is there anything to be done about this, except adding a space between the class name and the Plural-s (which looks crazy)?
You should be able to use backslash-escaped whitespace.
def foo(arg):
'''Add ``arg`` to the list of :class:`foo.bar.baz.Argument`\ s.'''
pass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With