I am currently working on a reference documentation that was initially documented manually with .. class::
All classes in the modules where documented this way.
However, it was necessary recently to allow some automation to the documentation, such as show-inheritance
of each class, but the problem now is how to combine the current manual documentation with autodoc.
I have tried to just simply replace .. class::
with .. autoclass::
but this resulted in a output where the description and parameters descriptions that were manually typed into the documentation (as against being generated from docstrings) to not be rendered in the output. Can anyone advise on what to do to solve this?
So here is more details:
Take a look at this:
.. autoclass:: wagtail.blocks.CharBlock
:show-inheritance:
.. class:: CharBlock
A single-line text input. The following keyword arguments are accepted in addition to the standard ones:
:param required: If true (the default), the field cannot be left blank.
:param max_length: The maximum allowed length of the field.
:param min_length: The minimum allowed length of the field.
:param help_text: Help text to display alongside the field.
:param validators: A list of validation functions for the field (see `Django Validators <https://docs.djangoproject.com/en/stable/ref/validators/>`__).
:param form_classname: A value to add to the form field's ``class`` attribute when rendered on the page editing form.
The output: enter image description here
The issue is I have to repeat the class name, which would be rather confusing for the user of the documentation. autoclass
would not render the parameters, hence the need for class
. I need autoclass
to be able to show the inheritance of the class(Bases). So I don't know if there is a directive that can perform the functions of class
without me having to mention the class name, or is there any way I can force class not to take in any arguments?
I hope this clearer. Thanks