1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! docling.rs: a Rust port of [docling](https://github.com/docling-project/docling).
//!
//! The public surface mirrors the Python SDK, kept deliberately small:
//!
//! ```no_run
//! use docling::{DocumentConverter, SourceDocument};
//!
//! let converter = DocumentConverter::new();
//! let result = converter
//! .convert(SourceDocument::from_file("input.md").unwrap())
//! .unwrap();
//! println!("{}", result.document.export_to_markdown());
//! ```
//!
//! For the PDF/image ML pipeline (pdfium + layout/TableFormer/OCR ONNX), reuse a
//! [`Pipeline`] across documents to amortize model loading, instead of the
//! per-call [`DocumentConverter`]. Deploying as a service: `examples/Dockerfile`
//! is a 3-stage build that bakes the binary, native libs, and exported models
//! (including the KV-cached TableFormer decoder) into a slim, Python-free runtime
//! image — see the "Deploy in a container" section of the README.
//!
//! See `docs/MIGRATION.md` for the architecture, the Python → Rust mapping, and the
//! phased plan. Phase 0 ships the converter plumbing plus Markdown and CSV
//! backends; PDF/DOCX/HTML and the ML pipeline land in later phases.
pub use ;
pub use ConversionError;
pub use InputFormat;
pub use ;
pub use SourceDocument;
pub use MarkdownStream;
// Re-export the core model so callers only need the one crate, and so
// `result.document.export_to_markdown()` works without an extra import.
pub use chunker;
pub use ;
// The reusable PDF/image pipeline (models loaded once, reused across documents),
// for callers that convert many files or want a warm, startup-excluded measurement.
pub use ;
/// Which PDF conversion this build compiled in: the full ML pipeline (`pdf`
/// feature), the pure-Rust text-layer path (`pdf-text`, the wasm32 build), or
/// neither. Compile-time facts, exported so downstream crates (whose own
/// features can't see this crate's) can branch — e.g. docling-wasm's host
/// tests, where workspace feature unification may pull `pdf` in.
pub const PDF_ML_COMPILED: bool = cfg!;
/// True when the `pdf-text` text-layer-only PDF path is compiled in.
pub const PDF_TEXT_COMPILED: bool = cfg!;
/// Stand-in for `docling_pdf::EnrichmentOptions` when the `pdf` feature is
/// off: the `DocumentConverter` builder methods keep compiling (and stay
/// inert — the formats these flags affect are rejected at convert time).