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