You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
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.
To Reproduce
Steps to reproduce the behavior:
$ git clone git@github.com:TheFriendlyCoder/friendlypins.git
$ cd friendlypins
$ pip install -r requirements.txt
$ tax -e py38-docs
$ open htmldocs/index.html
# Navigate to the docs for the board class (ie: htmldocs/api/friendlypins.board.html#friendlypins.board.Board.pins)
Expected behavior
The data type should be decorated / marked up the same way it appears when using the Return attribute when using the Yield attribute
What about introducing a :ytype: field that would specify the type of the yielded values, just as :rtype: ? :)
Then napoleon can use this to link to the type.
tk0miya
added a commit
to tk0miya/sphinx
that referenced
this issue
Jan 23, 2021
Describe the bug
Typically when one defines a return value in a method they will use the following syntax:
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:
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.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The data type should be decorated / marked up the same way it appears when using the Return attribute when using the Yield attribute
Your project
https://github.com/TheFriendlyCoder/friendlypins
Screenshots
Example output generated on ReadTheDocs: https://friendlypins.readthedocs.io/en/latest/api/friendlypins.board.html#friendlypins.board.Board.pins
Environment info
Additional context
The text was updated successfully, but these errors were encountered: