sphinx-autodoc2 icon indicating copy to clipboard operation
sphinx-autodoc2 copied to clipboard

Within a module, we can shorten a.b.c.d... for readability

Open FabriceSalvaire opened this issue 1 year ago • 0 comments

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 += _

FabriceSalvaire avatar Jan 27 '24 20:01 FabriceSalvaire