Skip to main content

docling_core/
lib.rs

1//! Core data model for docling.rs.
2//!
3//! This crate is the Rust counterpart of the `docling-core` Python package: it
4//! owns the unified [`DoclingDocument`] representation that every backend
5//! produces and every serializer consumes. Keeping it dependency-light and
6//! separate from the conversion logic mirrors the Python split between
7//! `docling-core` (the schema) and `docling` (the converters).
8//!
9//! Phase 0 models a simplified, linear node tree that is enough to round-trip
10//! through Markdown. The faithful, `$ref`-based schema that matches
11//! docling-core's JSON wire format lands in Phase 1 (see `docs/MIGRATION.md`).
12
13pub mod assets;
14pub mod base64;
15pub mod chunker;
16pub mod confidence;
17mod doclang;
18mod doclang_tree;
19pub mod doctags;
20mod document;
21mod encryption;
22pub mod env;
23mod html;
24pub mod hyperlink;
25pub mod jpeg;
26mod json;
27mod labels;
28mod latex;
29pub mod limits;
30mod markdown;
31mod mathml;
32pub mod memory;
33pub mod metadata;
34pub mod pandoc;
35pub mod pdf_repair;
36mod pixel_digest;
37pub mod redact;
38mod revisions;
39pub mod tree;
40mod vtt;
41
42pub use confidence::{ConfidenceReport, OcrCellConfidence, PageConfidence, QualityGrade};
43pub use doclang::inline_runs_from_markdown;
44pub use document::{
45    for_each_picture_in, for_each_picture_in_mut, inline_paragraph_node, CaptionParent,
46    ContentLayer, ContentLayers, DoclingDocument, FieldItem, GraphCell, GraphLink,
47    HtmlExportOptions, InlineRun, ListItemDclx, MarkdownExportOptions, Node, Notice, NoticeKind,
48    PictureClass, PictureDescription, PictureImage, Script, Table, TableCell, TableStructure,
49};
50pub use encryption::EncryptionError;
51#[doc(hidden)]
52pub use html::to_html_with_picture_refs;
53pub use json::code_language_label;
54pub use labels::DocItemLabel;
55pub use latex::escape_latex;
56pub use limits::LimitExceeded;
57pub use markdown::{code_fence, code_span, longest_backtick_run, ImageMode, MarkdownStreamer};
58pub use metadata::{DocumentMetadata, GpsPosition, MetadataOutput};
59pub use pdf_repair::PdfRepair;
60pub use redact::{
61    CustomPattern, ImageRedaction, PiiDetector, PiiKind, RedactionOptions, RedactionReport,
62    Replacement,
63};
64pub use revisions::{Revision, RevisionKind, TrackChanges};
65pub use vtt::VttExportOptions;