Documentation of my class members is ignored. Is there a way to configure to use provided docstrings, if present?
For example:
class CommonModel(models.Model):
"""
Abstract :py:class:`~django.db.models.Model` with common fields for all "real" Models
"""
#: globally unique id (UUID4)
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
#: date when this model instance becomes "active"
effective_start_date = models.DateField(default=None, blank=True, null=True)
#: date when this model instance becomes inactive
effective_end_date = models.DateField(default=None, blank=True, null=True)
#: who last modified this instance
last_mod_user_name = models.CharField(default=None, null=True, max_length=80)
#: when they modified it.
last_mod_date = models.DateField(auto_now=True)
class Meta:
#: this is an abstract model
abstract = True
When rendered with this package, it looks like this:
Parameters: * id (UUIDField) – Id
* effective_start_date (DateField) -- Effective start date
* effective_end_date (DateField) -- Effective end date
* last_mod_user_name (CharField) -- Last mod user name
* last_mod_date (DateField) -- Last mod date
id
Model field: id
effective_start_date
Model field: effective start date
...
without the package, like this (without the Parameters block and with the comments):
id
globally unique id (UUID4)
effective_start_date
date when this model instance becomes “active”
...
I've tried both with #: comments before and docstrings after each member.
I've also tried setting help_text which changes the Parameters display but not the members.
I have these autodoc settings in conf.py:
Documentation of my class members is ignored. Is there a way to configure to use provided docstrings, if present?
For example:
When rendered with this package, it looks like this:
without the package, like this (without the Parameters block and with the comments):
I've tried both with
#:
comments before and docstrings after each member.I've also tried setting
help_text
which changes the Parameters display but not the members. I have these autodoc settings in conf.py:and I run apidoc like this:
sphinx-apidoc -e -T -M -f -o apidoc ../myapp
And, unfortunately, if I don't use this package and don't document every member, I get this for each undocumented member:
So I really want to use this but want my docstrings to be used if present!