mirror of
https://github.com/DS4SD/docling.git
synced 2025-12-08 20:58:11 +00:00
fix: Update tests and examples for docling-core 2.5.1 (#449)
* Update tests for docling-core 2.5.0 Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * Add export with referenced images to export_figures example Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * Fix OCR tests Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * Revert "Fix OCR tests" This reverts commit 12b575946f51950fcacece99d4d6eb682125d779. Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * Update lockfile for docling-core 2.5.1 Signed-off-by: Christoph Auer <cau@zurich.ibm.com> --------- Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
This commit is contained in:
@@ -71,10 +71,16 @@ def main():
|
||||
element.get_image(conv_res.document).save(fp, "PNG")
|
||||
|
||||
# Save markdown with embedded pictures
|
||||
content_md = conv_res.document.export_to_markdown(image_mode=ImageRefMode.EMBEDDED)
|
||||
md_filename = output_dir / f"{doc_filename}-with-images.md"
|
||||
with md_filename.open("w") as fp:
|
||||
fp.write(content_md)
|
||||
conv_res.document.save_as_markdown(md_filename, image_mode=ImageRefMode.EMBEDDED)
|
||||
|
||||
# Save markdown with externally referenced pictures
|
||||
md_filename = output_dir / f"{doc_filename}-with-image-refs.md"
|
||||
conv_res.document.save_as_markdown(md_filename, image_mode=ImageRefMode.REFERENCED)
|
||||
|
||||
# Save HTML with externally referenced pictures
|
||||
html_filename = output_dir / f"{doc_filename}-with-image-refs.html"
|
||||
conv_res.document.save_as_html(html_filename, image_mode=ImageRefMode.REFERENCED)
|
||||
|
||||
end_time = time.time() - start_time
|
||||
|
||||
|
||||
Reference in New Issue
Block a user