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