docspec_core/lib.rs
1//! Core event types and traits for the `DocSpec` streaming document conversion library.
2//!
3//! `DocSpec` converts documents through a streaming event pipeline. This crate defines
4//! the [`Event`] enum, supporting types, error types, and the [`EventSource`],
5//! [`EventSink`], and [`AssetProvider`] traits that decouple readers from writers.
6//!
7//! # Quick Start
8//!
9//! Implement [`EventSource`] to produce events and [`EventSink`] to consume them.
10//! Events represent document structure (headings, paragraphs, tables, text runs).
11//! Readers and writers are fully decoupled through the event protocol.
12//!
13//! # Event Types
14//!
15//! The [`Event`] enum covers all document structures supported by `DocSpec`. See
16//! the [`event`] module for the full event reference, well-formedness rules, and
17//! per-variant semantics.
18
19extern crate alloc;
20
21mod depth;
22mod error;
23pub mod event;
24mod pipeline;
25mod stack;
26mod traits;
27mod types;
28
29pub use depth::Depth;
30pub use error::{Error, Position, Result};
31pub use event::{Event, TextStyleKind};
32pub use pipeline::pipe;
33pub use stack::{block_kind_for_end, block_kind_for_start, BlockKind, StackTrackingSink};
34pub use traits::{AssetProvider, EventSink, EventSource};
35pub use types::{
36 Author, Color, DocumentMeta, ImageSource, ListStyleType, TableHeaderScope, TextAlignment,
37};