I have a class that inherits from ctypes.Structure defined with the _fields_
attribute.
I have the sphinx autodoc running on a whole folder of modules, with
AUTODOC_DEFAULT_OPTIONS containing "undoc-members".
As far as I have read, "undoc-members" generates documentation for classes
where docstrings have not been provided. This is majorly useful for the
project i am working on. But I need to make an exception in one case.
For the class that inherits ctypes.Structure, I want to override the
autodocumentation of the attributes in the class, and i want the docstring
provided in the class to apply in the documentation generated. But I am
unable to do this. undoc-members also documents members which have
docstrings provided in my present example of the class inherited from
ctypes.Structure.
What I already tried:
.. automodule:: root.analyzers.rs232.Analyzer1
:members:
:undoc-members:
:show-inheritance:
.. autoclass:: Analyzer1.DebugSetup.SetupFields
:no-undoc-members:
.. automodule:: root.analyzers.rs232.Analyzer1
:members:
:undoc-members:
:show-inheritance:
:exclude-members: DebugSetup.SetupFields
None of these work. The concern here is, i want to retain :undoc-members:
for most of the classes in the module except for some (2 in my case) of
them.
I am not familiar with event handling with sphinx autodoc. From what i have
read, the only solution seems to be to write an event handler for when the
object of interest (class in this case) is parsed, and then we can override
the default options during the parsing or processing of the docstring for
the given class.
So my expectation is that I need to override the default documentation of
the class (that inherits from ctypes.Structure) and for the engine to take
the documentation i have provided in the docstring for the class.
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sphinx-users/fb197f7a-a75e-4a77-981b-2307559efd4f%40googlegroups.com.