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;
19mod doclang_xml;
20pub mod doctags;
21mod document;
22mod encryption;
23pub mod env;
24mod html;
25pub mod hyperlink;
26pub mod inline;
27pub mod jpeg;
28mod json;
29mod labels;
30mod latex;
31pub mod limits;
32mod markdown;
33mod mathml;
34pub mod memory;
35pub mod metadata;
36pub mod pandoc;
37pub mod pdf_repair;
38mod pixel_digest;
39pub mod redact;
40mod revisions;
41pub mod tree;
42mod vtt;
43
44pub use confidence::{ConfidenceReport, OcrCellConfidence, PageConfidence, QualityGrade};
45pub use doclang::inline_runs_from_markdown;
46pub use doclang_xml::doclang_apply_reading_rules;
47pub use document::{
48    for_each_picture_in, for_each_picture_in_mut, inline_paragraph_node, CaptionParent,
49    ContentLayer, ContentLayers, DoclingDocument, FieldItem, GraphCell, GraphLink,
50    HtmlExportOptions, InlineRun, ListItemDclx, MarkdownExportOptions, Node, Notice, NoticeKind,
51    PictureClass, PictureDescription, PictureImage, Script, ScriptRun, ScriptRunProv, Table,
52    TableCell, TableStructure,
53};
54pub use encryption::EncryptionError;
55#[doc(hidden)]
56pub use html::to_html_with_picture_refs;
57pub use json::code_language_label;
58pub use labels::DocItemLabel;
59pub use latex::escape_latex;
60pub use limits::LimitExceeded;
61pub use markdown::{code_fence, code_span, longest_backtick_run, ImageMode, MarkdownStreamer};
62pub use metadata::{DocumentMetadata, GpsPosition, MetadataOutput};
63pub use pdf_repair::PdfRepair;
64pub use redact::{
65    CustomPattern, ImageRedaction, PiiDetector, PiiKind, RedactionOptions, RedactionReport,
66    Replacement,
67};
68pub use revisions::{Revision, RevisionKind, TrackChanges};
69pub use vtt::VttExportOptions;