def METHOD_NAME(self, node: ast.FunctionDef) -> None:
    if node.name == 'main_demo':
        docstring = ast.get_docstring(node)
        if docstring is None:
            api = getattr(ui, self.topic) if hasattr(ui, self.topic) else getattr(app, self.topic)
            docstring = api.__doc__ or api.__init__.__doc__
            for name, method in api.__dict__.items():
                if not name.startswith('_') and inspect.isfunction(method):
                    # add method name to docstring
                    docstring += name + ' '
                    docstring += method.__doc__ or ''
        lines = cleanup(docstring).splitlines()
        self.add_to_search_index(lines[0], lines[1:], main=True)
    for decorator in node.decorator_list:
        if isinstance(decorator, ast.Call):
            function = decorator.func
            if isinstance(function, ast.Name) and function.id == 'text_demo':
                title = decorator.args[0].s
                content = cleanup(decorator.args[1].s).splitlines()
                self.add_to_search_index(title, content)
            if isinstance(function, ast.Name) and function.id == 'element_demo':
                attr_name = decorator.args[0].attr
                obj_name = decorator.args[0].value.id
                if obj_name == 'app':
                    docstring: str = getattr(app, attr_name).__doc__
                    docstring = ' '.join(l.strip() for l in docstring.splitlines()).strip()
                    self.current_content.append(cleanup(docstring))
                else:
                    print(f'Unknown object: {obj_name} for element_demo', flush=True)
    self.generic_visit(node)