mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-27 04:24:45 +00:00
use new interface in minimal example
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
parent
7aad3dc946
commit
051beae203
@ -146,8 +146,8 @@ from docling.document_converter import DocumentConverter
|
||||
source = "https://arxiv.org/pdf/2408.09869" # PDF path or URL
|
||||
converter = DocumentConverter()
|
||||
result = converter.convert_single(source)
|
||||
print(result.render_as_markdown_v1()) # output: "## Docling Technical Report[...]"
|
||||
print(result.render_as_doctags_v1()) # output: "<document><title><page_1><loc_20>..."
|
||||
print(result.output.export_to_markdown()) # output: "## Docling Technical Report[...]"
|
||||
print(result.output.export_to_document_tokens()) # output: "<document><title><page_1><loc_20>..."
|
||||
```
|
||||
|
||||
### Convert a batch of documents
|
||||
|
@ -2,5 +2,7 @@ from docling.document_converter import DocumentConverter
|
||||
|
||||
source = "https://arxiv.org/pdf/2408.09869" # PDF path or URL
|
||||
converter = DocumentConverter()
|
||||
doc = converter.convert_single(source)
|
||||
print(doc.render_as_markdown_v1()) # output: ## Docling Technical Report [...]"
|
||||
result = converter.convert_single(source)
|
||||
print(result.output.export_to_markdown()) # output: ## Docling Technical Report [...]"
|
||||
# if the legacy output is needed, use this version
|
||||
# print(result.render_as_markdown_v1()) # output: ## Docling Technical Report [...]"
|
||||
|
Loading…
Reference in New Issue
Block a user