-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
:include-all-objects: does not include instance variables. #66
Comments
I also found that |
@Viech : Did you find any solution or workaround to this problem? |
I switched to AutoAPI. 🙁 |
Just to be sure, are you referring to: autoapi (https://github.com/carlos-jenkins/autoapi) or sphinx-autoapi (https://github.com/readthedocs/sphinx-autoapi)? Does it do a good job of documenting both class and instance attributes? |
The first one. It does document instance attributes; for example it documents def __init__(self, […], info={}, […]):
[…]
self.info = info
"""Additional information provided by the solver.""" as
which is not ideal given the misleading I now remember that the selling point for AutoAPI was that it uses Jinja templates for the pages generated for each module, which makes it highly configurable, in particular when it comes to embedding the API docs in a broader documentation and in a scenario where you have both modules and subpackages and want them to be documented in a similar style. Inside the Jinja templates you would just use a regular Sphinx |
Thanks a lot @Viech for the detailed response. The use of Jinja templates certainly offers a lot of flexibility. I am tempted to try it out sometime soon. |
This is the blocking issue for me, it makes class documentation unusable. :( |
Will #169 fix this too? |
Sadly, no. Instance variables require another kind of introspection, since they don't appear in the class definition. |
This could be a solution : sphinx-doc/sphinx#9146
|
If I document instance variables as follows
then they do not show up in the attributes section (or anywhere at all) of the class documentation pages generated by
automodapi
, even with:include-all-objects:
.It would be ideal to find them in the attributes section, together with the properties and the class variables, as the user is not supposed to be able to distinguish between those three types (after all property's job is to make the user think they are dealing with variables while really they are using functions).
Note that there seems to be an undocumented
autoinstanceattribute
keyword that might be useful.(If I use the alternative approach of putting
:ivar a: Documented instance variable.
in the class' docstring then they appear as part of the class documentation in an info field list but they cannot be referenced, i.e.:py:obj:'a'
does not find its target.)The text was updated successfully, but these errors were encountered: