- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
.. py:data:: :type: option does not correctly link to type supplied #9899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I did also want to mention the use of :py:class: I have also placed the import of "Unit" before the docstring and explicitly set the docstring to doc and that did not work either. |
Reproduced with this:
In this case, |
…r_in_typefield Fix #9899: py domain: Allows cross-reference specifier to :type: option
Man o Man you are fast. Thanks for fixing this so it will work properly. |
Describe the bug
when using the .. py:data:: directive there is the :type: option to specify the type for the data being stored in the module level attribute. It does not work within the context of the module. What I mean by that is I have to key out the entire module path and the class for the type instead of importing the type into the module and only having to type in the type class name.
How to Reproduce
say I have the following in the module "my_library.module1"
The output I get when building the docs is this.
and "Unit" is not a clickable link.
However if I have the following in the module "my_library.module1"
I get this for an output
and "my_library.module2.Unit" is a clickable link that brings up the documentation for the Unit class
Expected behavior
to be able to do the following
and have the output be
and "Unit" be a clickable link that leads to the class that is specified in :type:
Your project
https://github.com/kdschlosser/python-utils/tree/unit_conversion
Screenshots
No response
OS
Windows
Python version
3.8
Sphinx version
4.2
Sphinx extensions
sphinx.ext.autodoc
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: