convert_doc#
- dscat.docs.convert_doc(src, dest, engine=None)[source]#
Convert
srcto markdown atdestwithengine, caching by mtime.- Parameters:
src (
pathlib.Path) – The source document.dest (
pathlib.Path) – Where to write the markdown. Adestnewer thansrcis reused as is.engine (
sqlalchemy.engine.EngineorNone, defaultNone) – Force a conversion engine. WhenNonethe engine is chosen by file type:markerfor PDFs,markitdownotherwise, andtextutilfor legacy.doc/.rtf(seeresolve_engine()).
- Returns:
dest.- Return type:
- Raises:
RuntimeError – When the engine cannot convert the document, for example because its tool is not installed or it does not support the document’s format.