Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amantoux/quill-delta-rs
Implementation of Quill editor Delta format in Rust
https://github.com/amantoux/quill-delta-rs
editing operational-transformation
Last synced: 22 days ago
JSON representation
Implementation of Quill editor Delta format in Rust
- Host: GitHub
- URL: https://github.com/amantoux/quill-delta-rs
- Owner: amantoux
- License: mit
- Created: 2024-02-23T09:00:10.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-04-13T06:47:08.000Z (9 months ago)
- Last Synced: 2024-04-13T20:21:56.857Z (9 months ago)
- Topics: editing, operational-transformation
- Language: Rust
- Homepage: https://crates.io/crates/quill-delta-rs
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build](https://github.com/amantoux/quill-delta-rs/actions/workflows/build.yml/badge.svg)](https://github.com/amantoux/quill-delta-rs/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/amantoux/quill-delta-rs/graph/badge.svg?token=7SKQMTX1L0)](https://codecov.io/gh/amantoux/quill-delta-rs)Implementation of Quill editor Delta format in Rust. Refer to official
[documentation][] for more details.[documentation]: https://quilljs.com/docs/delta/
## Usage
```rust
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 mut change = Delta::new();
change
.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][tracker].
[tracker]: https://github.com/amantoux/quill-delta-rs/issues