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