quill-delta-rs

Crates.ioquill-delta-rs
lib.rsquill-delta-rs
version2.1.0
created_at2024-04-04 19:56:04.510446+00
updated_at2025-11-09 09:59:23.016065+00
descriptionImplementation of Quill editor Delta format in Rust
homepagehttps://github.com/amantoux/quill-delta-rs
repositoryhttps://github.com/amantoux/quill-delta-rs
max_upload_size
id1196682
size95,234
Alan Mantoux (amantoux)

documentation

README

Build codecov

Implementation of Quill editor Delta format in Rust. Refer to official documentation for more details.

Usage

use quill_delta_rs::{
    attributes::{attributes, AttributesMap},
    delta::Delta
};

fn main() {
    let mut doc = Delta::new();
    doc.insert("Hello world\n", Some(attributes!("h" => "1")));
    let change = Delta::new()
        .retain(6, None)
        .delete(6)
        .insert("Earth\n", None);
    let result = doc.compose(&change);
    println!("Original document:\n{}\n", doc);
    println!("Change:\n{}\n", change);
    println!("Updated document:\n{}\n", result);

    // Prints:
    //
    //  Original document:
    //  ins(Hello world⏎) + {h: 1}}
    //
    //
    //  Change:
    //  ret(6)
    //  ins(Earth⏎)
    //  del(6)
    //
    //
    //  Updated document:
    //  ins(Hello ) + {h: 1}}
    //  ins(Earth⏎)
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

Commit count: 13

cargo fmt