qrenderer.exclude_parameters

exclude_parameters(spec)

Exclude the parameters of functions/class in the documentation

When a function has a deprecated parameter, 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]]

Object path and the parameter(s) to exclude. The object path is as shown on the API page and not the canonical path.

Examples

Assuming we are documenting package and we want to modify these signatures where some parameters are deprecated:

ClassA(p1, p2)          # deprecated: p1
ClassB(p1, p2, p3, p4)  # deprecated: p1, p2
nice_function(a, b, c)  # deprecated: c

We would use

from qrenderer import exclude_parameters

exclude_parameters({
    "package.ClassA": "p1",
    "package.ClassB": ("p1", "p2")
    "package.nice_function": "c"
})

and the documentation would have:

ClassA(p2)
ClassB(p3, p4)
nice_function(a, b)

Notes

When you exclude the parameter of a dataclass, it will show up in the attributes unless you use exclude_attributes to remove it from there as well.