qrenderer.exclude_attributes

exclude_attributes(spec)

Exclude the parameters of functions/class in the documentation

When a function has a deprecated attribute, we may want to exclude it from the documentation. Use this function in your _renderer.py file to specify them.

Parameters

spec : dict[str, str | Sequence[str]]

Parent object path and the attribute(s) to exclude. The object path is as shown on the API page and not the canonical path. e.g.

Examples

Assuming we are documenting ClassA and ClassB with the deprecated attributes marked as shown below.

class ClassA:
    a: int = 1
    b: str = "rock"
    c: bool = False   # deprecated

class ClassB:
    a: int = 1
    b: str = "paper"  # deprecated

    @property
    def value(self):  # deprecated
        return 1

We would use this to exclude the attributes from the documentation.

from qrenderer import exclude_attributes

exclude_attributes({
    "package.ClassA": "c",
    "package.ClassB": ("b", "value")
})