use docs_native_crdt::Editor; use serde_json::json; fn main() { let mut editor = Editor::new("window-smoke", 17); for index in 0..60 { editor.command(&json!({"op":"insert_element", "at":index, "type":"paragraph"})).unwrap(); let block = editor.projection()["children"][index]["id"].as_str().unwrap().to_owned(); editor.command(&json!({"op":"insert_text", "node":block, "at":0, "text":format!("Paragraph {}. {}", index + 1, "Synthetic text with enough words to wrap onto several lines in a document window. ".repeat(3))})).unwrap(); } std::fs::write(std::env::args().nth(1).expect("output path"), editor.snapshot()).unwrap(); }