async def convert(
        self, local_path: str, **kwargs: Any
    ) -> Union[None, AsyncDocumentConverterResult]:
        """Convert a text file to markdown.

        Args:
            local_path: Path to the text file
            **kwargs: Additional arguments passed to converters

        Returns:
            AsyncDocumentConverterResult containing the markdown text
        """
        extension = kwargs.get("file_extension", "")
        if extension.lower() not in [".txt", ".csv", ".json", ".xml"]:
            return None

        md_content = ""
        title = None

        try:
            # For CSV files, convert to markdown table
            if extension.lower() == ".csv":
                try:
                    md_content = await self._convert_csv_to_markdown(local_path)
                except Exception as e:
                    logger.error(f"Error converting CSV to markdown table: {str(e)}")
                    # Fallback to raw content
                    with open(local_path, "r", encoding="utf-8") as file:
                        md_content = file.read()

            # For JSON files, pretty print
            elif extension.lower() == ".json":
                try:
                    with open(local_path, "r", encoding="utf-8") as file:
                        content = file.read()
                    md_content = await self._convert_json_to_markdown(content)
                except Exception as e:
                    logger.error(f"Error formatting JSON: {str(e)}")
                    # Fallback to raw content
                    with open(local_path, "r", encoding="utf-8") as file:
                        content = file.read()
                    md_content = "```\n" + content + "\n```"

            # For XML files, pretty print
            elif extension.lower() == ".xml":
                try:
                    with open(local_path, "r", encoding="utf-8") as file:
                        content = file.read()
                    md_content = await self._convert_xml_to_markdown(content)
                except Exception as e:
                    logger.error(f"Error formatting XML: {str(e)}")
                    # Fallback to raw content
                    with open(local_path, "r", encoding="utf-8") as file:
                        content = file.read()
                    md_content = "```\n" + content + "\n```"

            # For plain text, just use the content
            else:
                with open(local_path, "r", encoding="utf-8") as file:
                    md_content = file.read()

        except Exception as e:
            logger.error(f"Error reading text file: {str(e)}")
            return None

        return AsyncDocumentConverterResult(title=title, text_content=md_content.strip())
Convert a text file to markdown.

        Args:
            local_path: Path to the text file
            **kwargs: Additional arguments passed to converters

        Returns:
            AsyncDocumentConverterResult containing the markdown text
        
backend/airweave/platform/file_handling/async_markitdown.py