async def extract_path_async(self, path: Path) -> ExtractionResult:
        """Extract text and metadata from a file using Pandoc.

        Args:
            path: The path to the file to process.

        Raises:
            ParsingError: If the file data could not be extracted.

        Returns:
            ExtractionResult with the extracted text and metadata.
        """
        await self._validate_pandoc_version()
        self._get_pandoc_type_from_mime_type(self.mime_type)

        try:
            metadata_task = self._handle_extract_metadata(path)
            content_task = self._handle_extract_file(path)
            results = await run_taskgroup(metadata_task, content_task)
            metadata, content = cast("tuple[Metadata, str]", results)

            return ExtractionResult(
                content=normalize_spaces(content), metadata=metadata, mime_type=MARKDOWN_MIME_TYPE, chunks=[]
            )
        except ExceptionGroup as eg:
            raise ParsingError("Failed to process file", context={"file": str(path), "errors": eg.exceptions}) from eg
Extract text and metadata from a file using Pandoc.

        Args:
            path: The path to the file to process.

        Raises:
            ParsingError: If the file data could not be extracted.

        Returns:
            ExtractionResult with the extracted text and metadata.
        
kreuzberg/_extractors/_pandoc.py