napoleon icon indicating copy to clipboard operation
napoleon copied to clipboard

Data types defined under a Yield attribute aren't properly linked

Open TheFriendlyCoder opened this issue 3 years ago • 1 comments

Typically when one defines a return value in a method they will use the following syntax:

Returns:
    int:
        some value

When doing so the return type, int in this case, is hyperlinked to the api docs for the appropriate data type (ie: using interphinx).

However, when writing doc strings for generators using the same / similar syntax provided by the Yield attribute, the data type associated with the generator is not appropriately decorated. Taking the previous example code snippet and making a small modification as show below is sufficient to demonstrate the change in behavior:

Yields:
    int:
        some value

The HTML markup produced by this code snippet simply format the data type using custom font formatting based on the theme, but it fails to associate / generate the hyperlink for the API docs for the data type as is done by the Return attribute.

NOTE: I am using the apidocs Sphinx extension to generate the API docs for my projects in case that has any impact on this behavior.

Here are my key dependencies and versions in case this helps track down the problem:

  • sphinx (with the built-in napoleon and intersphinx plugins) v2.3.1
  • sphinxcontrib-apidoc v0.3.0

TheFriendlyCoder avatar Jul 24 '20 14:07 TheFriendlyCoder