sphinx-contrib / napoleon

Other
148 stars 48 forks source link

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

Open TheFriendlyCoder opened 4 years ago

TheFriendlyCoder commented 4 years ago

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:

McSinyx commented 4 years ago

Hi @TheFriendlyCoder, you might want to consider filing this issue against Sphinx. Before doing so, please perform a quick check to see if the problem persists with the latest release.