-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
docling-documentenhancementNew feature or requestNew feature or requestgood first issueIssues and pull requests for new contributorsIssues and pull requests for new contributors
Description
Problem
When using ImageRefMode.REFERENCED, users must manually:
- Iterate through all picture elements
- Save each image to disk
- Update the URI for each element
- Then call export_to_markdown()
Proposed Solution
Add optional image_dir and image_path_prefix parameters to export methods:
markdown = doc.export_to_markdown(
image_mode=ImageRefMode.REFERENCED,
image_dir=Path("./output/images"),
image_path_prefix="images/" # relative path in markdown output
)When image_dir is provided:
- Automatically save images to that directory
- Generate sequential filenames (e.g. image_001.png)
- Use image_path_prefix in the markdown output
Affected Methods
- DoclingDocument.export_to_markdown()
- PictureItem.export_to_markdown()
- Potentially HTML export methods too
Would this be an interesting feature to have? Happy to submit a PR.
(PS: Keep up the great work!!)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docling-documentenhancementNew feature or requestNew feature or requestgood first issueIssues and pull requests for new contributorsIssues and pull requests for new contributors