def transform_property(node: Node): section = node.docstring["Attributes"] members = [] for member in node.members: if "property" in member.object.kind: if section is None: section = Section("Attributes") node.docstring['Attributes'] = section name = member.object.name kind = member.object.kind type = member.object.type markdown = member.docstring.sections[0].markdown item = Item(name, markdown, type=type, kind=kind) section.items.append(item) else: members.append(member) node.members = members
def transform_property(node: Node, filters: List[str] = None): section = None members = [] for member in node.members: object = member.object if "property" in object.kind: if section is None: section = node.docstring["Attributes"] name = object.name kind = object.kind type = object.type description = member.docstring.sections[0].markdown item = Item(name, type, Inline(description), kind=kind) if filters and "sourcelink" in filters: source_link_from_section_item(item, object) section.items.append(item) else: members.append(member) node.members = members
def transform_module(node: Node, filters: Optional[List[str]] = None): transform_members(node, "class", filters) transform_members(node, "function", filters) if not filters or "all" not in filters: node.members = []
def transform_module(node: Node, filters: List[str]): transform_members(node, "class", filters) transform_members(node, "function", filters) node.members = []