sphinx-autodoc2
sphinx-autodoc2 copied to clipboard
Within a module, we can shorten a.b.c.d... for readability
Tested it works, we just need to test the target is in the current module.
def render_method(self, item: ItemData) -> t.Iterable[str]:
"""Create the content for a method."""
short_name = item["full_name"].split(".")[-1]
show_annotations = self.show_annotations(item)
sig = f"{short_name}({self.format_args(item['args'], show_annotations, ignore_self='self')})"
if show_annotations and item.get("return_annotation"):
_ = f" -> {self.format_annotation(item['return_annotation'])}"
_ = _.replace('PySpice.Unit.Unit.', '')
sig += _