from pathlib import Path from textwrap import wrap from haystack.components import converters source = Path("sample.html") converter = converters.HTMLToDocument( store_full_path=False, ) result = converter.run( sources=[source], meta={ "collection": "support-portal", "source_format": "html", }, ) documents = result["documents"] document = documents[0] print(f"documents: {len(documents)}") print("content:") for line in wrap(document.content, width=48): print(line) print("source:", document.meta["file_path"]) print("collection:", document.meta["collection"]) print("format:", document.meta["source_format"])