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