mod.rs 593 B

123456789101112131415161718192021222324252627
  1. use lib_ot::{core::DeltaBuilder, rich_text::RichTextDelta};
  2. #[inline]
  3. pub fn initial_quill_delta() -> RichTextDelta {
  4. DeltaBuilder::new().insert("\n").build()
  5. }
  6. #[inline]
  7. pub fn initial_quill_delta_string() -> String {
  8. initial_quill_delta().json_str()
  9. }
  10. #[inline]
  11. pub fn initial_read_me() -> RichTextDelta {
  12. let json = include_str!("READ_ME.json");
  13. RichTextDelta::from_json(json).unwrap()
  14. }
  15. #[cfg(test)]
  16. mod tests {
  17. use crate::client_document::default::initial_read_me;
  18. #[test]
  19. fn load_read_me() {
  20. println!("{}", initial_read_me().json_str());
  21. }
  22. }