Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions mkdocstrings_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ def generate_documentation(self, module_path: str, options: Dict[str, Any]) -> s

parser_func = parser_map.get(docstring_style, griffe.parse_google)

# For classes without a docstring, inherit from base class
if hasattr(obj, "kind") and obj.kind.value == "class":
if not obj.docstring and hasattr(obj, "resolved_bases"):
for base in obj.resolved_bases:
if base.docstring:
from griffe import Docstring
# Inherit the base class docstring
obj.docstring = Docstring(base.docstring.value, lineno=base.docstring.lineno)
break

if obj.docstring:
# Parse with the appropriate parser to get structured sections
obj.docstring.parsed = parser_func(obj.docstring)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "A simple parser for mkdocstrings signature blocks"
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"griffe2md",
"griffe2md<1.3",
"pyyaml",
"rich",
]
Expand Down
12 changes: 0 additions & 12 deletions requirements.txt

This file was deleted.