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;
18pub mod doctags;
19mod document;
20mod encryption;
21pub mod env;
22mod html;
23pub mod jpeg;
24mod json;
25mod labels;
26mod latex;
27mod markdown;
28mod mathml;
29pub mod metadata;
30pub mod pandoc;
31mod pixel_digest;
32pub mod redact;
33pub mod tree;
34mod vtt;
35
36pub use confidence::{ConfidenceReport, PageConfidence, QualityGrade};
37pub use doclang::inline_runs_from_markdown;
38pub use document::{
39    inline_paragraph_node, CaptionParent, ContentLayer, ContentLayers, DoclingDocument, FieldItem,
40    GraphCell, GraphLink, HtmlExportOptions, InlineRun, ListItemDclx, MarkdownExportOptions, Node,
41    PictureClass, PictureDescription, PictureImage, Script, Table, TableCell, TableStructure,
42};
43pub use encryption::EncryptionError;
44pub use json::code_language_label;
45pub use labels::DocItemLabel;
46pub use markdown::{ImageMode, MarkdownStreamer};
47pub use metadata::{DocumentMetadata, GpsPosition, MetadataOutput};
48pub use redact::{
49    CustomPattern, ImageRedaction, PiiDetector, PiiKind, RedactionOptions, RedactionReport,
50    Replacement,
51};
52pub use vtt::VttExportOptions;