-
Notifications
You must be signed in to change notification settings - Fork 46
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
:attr: and :meth: links require class name #184
Comments
I wasn't aware of this feature of the Python domain! That would make things so much easier for making auto-links in docstrings akin to how MATLAB does it. Given
We could then just replace the property and method names with
|
Exactly! |
Definitely on the things to work on next. |
Ran into this one again. With auto-linking turned on I have a workaround for methods, as But for properties, I still don't have a workaround. I could use code similar to the auto-linking code to modify the docstring directly to replace @joeced, have you made any progress on this? Or do you have any thoughts? |
No progress yet. I'll try to work on it in the coming week. |
Just wanted to add a quick note here while I'm thinking about it, since I ran into this issue again. It should be possible to link to the proper method or attribute from any docstring in the class. That is, from a method docstring or property/attribute docstring, not just the class docstring itself. This should be included in the tests for this functionality when implemented. |
Given a class
MyClass
with a methodmy_method()
, it does not seem possible to create a link to the method with just the method name (e.g. using:meth:`my_method`
). Rather it requires including the class name as well to get the link (e.g.:meth:`MyClass.my_method`
), but then the class name is also displayed as the link text. Likewise for properties when using:attr:
.This does not appear to be the case with Python autodoc, based on on-line examples of what I assume is documentation generated using Sphinx autodoc. An example would be the
data_version
link in the 3rd paragraph of the Sphinx Domain API. The source says:attr:`data_version`
, but the link points tosphinx.domains.Domain.data_version
as one would expect.It would be nice if it worked this way for matlabdomain as well.
Not sure if this is a bug report or a feature request ... but hopefully it's not too hard to fix.
The text was updated successfully, but these errors were encountered: