Link to class method in Python docstring

The solution that works for Sphinx is to prefix the reference with ~. Per the Sphinx documentation on Cross-referencing Syntax, If you prefix the content with ~, the link text will only be the last component of the target. For example, :py:meth:`~Queue.Queue.get` will refer to Queue.Queue.get but only display get as the link text. So … Read more

Adding a cross-reference to a subheading or anchor in another page

The expression “reST/Sphinx” makes the scope of the question unclear. Is it about reStructuredText in general and Sphinx, or only about reStructuredText as used in Sphinx (and not reStructuredText in general)? I’m going to cover both since people using RST are likely to run into both cases at some point: Sphinx Besides the domain-specific directives … Read more