diff --git a/doc/source/_templates/autosummary/class_v2.rst b/doc/source/_templates/autosummary/class_v2.rst index 7971198a557e..ae6130f930a0 100644 --- a/doc/source/_templates/autosummary/class_v2.rst +++ b/doc/source/_templates/autosummary/class_v2.rst @@ -1,9 +1,9 @@ -{{ name }} -{{ '-' * name | length }} - .. currentmodule:: {{ module }} {% if name | has_public_constructor(module) %} +{{ name }} +{{ '-' * name | length }} + .. autoclass:: {{ objname }} {% endif %} diff --git a/doc/source/conf.py b/doc/source/conf.py index c19b35886465..3821acf2c121 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -448,6 +448,7 @@ def _is_api_group(obj, group): FILTERS["filter_out_undoc_class_members"] = filter_out_undoc_class_members FILTERS["get_api_groups"] = get_api_groups FILTERS["select_api_group"] = select_api_group +FILTERS["has_public_constructor"] = has_public_constructor def add_custom_assets(