diff --git a/sphinx_autosummary_accessors/documenters.py b/sphinx_autosummary_accessors/documenters.py index 5b61270..84e12f7 100644 --- a/sphinx_autosummary_accessors/documenters.py +++ b/sphinx_autosummary_accessors/documenters.py @@ -2,23 +2,6 @@ from sphinx.ext.autodoc.importer import import_module -class AccessorDocumenter(MethodDocumenter): - """ - Specialized Documenter subclass for accessors. - """ - - objtype = "accessor" - directivetype = "method" - - # lower than MethodDocumenter so this is not chosen for normal methods - priority = 0.6 - - def format_signature(self): - # this method gives an error/warning for the accessors, therefore - # overriding it (accessor has no arguments) - return "" - - class AccessorLevelDocumenter(Documenter): """ Specialized Documenter subclass for objects on accessor level (methods, @@ -79,6 +62,23 @@ def resolve_name(self, modname, parents, path, base): return modname, parents + [base] +class AccessorDocumenter(AccessorLevelDocumenter, MethodDocumenter): + """ + Specialized Documenter subclass for accessors. + """ + + objtype = "accessor" + directivetype = "method" + + # lower than MethodDocumenter so this is not chosen for normal methods + priority = 0.6 + + def format_signature(self): + # this method gives an error/warning for the accessors, therefore + # overriding it (accessor has no arguments) + return "" + + class AccessorAttributeDocumenter(AccessorLevelDocumenter, AttributeDocumenter): objtype = "accessorattribute" directivetype = "attribute"