bekoedit_markdown/lib.rs
1//! Markdown parser index, block identity, raw islands, source patch engine,
2//! and form-edit resolution for bekoedit.
3//!
4//! Implements the source-preservation core specified by:
5//! - RFC-013: Markdown Parser Index and Source Range Mapping
6//! - RFC-014: Block Identity, Revision Scope, and Projection Validity
7//! - RFC-015: SourcePatch Engine and Source-Preserving Mutation
8//! - RFC-016/017/018: Form Mode projection, Raw Markdown Islands,
9//! and semantic edit commands (Rust-side resolution)
10//!
11//! Architectural invariants (RFC-000):
12//! - The raw Markdown text is canonical; everything in this crate is a
13//! projection over it or a validated mutation of it.
14//! - All byte ranges are Rust-owned UTF-8 byte offsets. Offsets supplied
15//! by the UI layer are advisory and never authoritative.
16//! - Regions that cannot be edited safely become Raw Markdown Islands;
17//! they are never silently rewritten.
18
19pub mod block;
20pub mod fingerprint;
21pub mod form;
22pub mod index;
23pub mod island;
24pub mod patch;
25pub mod preview;
26pub mod range;
27pub mod sections;
28pub mod trivia;
29
30pub use block::{BlockKind, BlockNode, EditablePolicy, HeadingNode, ListItemNode};
31pub use fingerprint::{BlockFingerprint, BlockId};
32pub use form::{
33 FormBlock, FormBlockDisplay, FormBlockEdit, FormEditCommand, FormEditError, FormListItem,
34 FormProjection, InlineFormat,
35};
36pub use index::{MarkdownDiagnostic, MarkdownIndex};
37pub use island::{RawIsland, RawIslandEditPolicy, RawIslandType};
38pub use patch::{PatchError, PatchOrigin, PatchResult, SourcePatch};
39pub use preview::render_preview_html;
40pub use range::{ByteRange, utf16_to_utf8_offset};
41pub use sections::{
42 SectionError, SectionMoveResult, move_section_down, move_section_up, section_range,
43};
44pub use trivia::{CodeFenceStyle, LineEnding, ListMarkerStyle, SourceTrivia};
45
46#[cfg(test)]
47mod tests;