dominictarr / scuttlebutt

peer-to-peer replicatable data structure
Other
1.32k stars 66 forks source link

Example data structure for rich text editing #44

Open mitar opened 9 years ago

mitar commented 9 years ago

Hm, how hard would it be to use scuttlebutt for rich text editing? For example, Quill provides nice deltas for changes. Or even support for multiple cursors. How would it be to create a model which would support rich text editing?

dominictarr commented 9 years ago

@mitar you probably want something that multiple people can edit in parallel. This is a little bit more comlpicated that what quill appears to provide, but using a structure like https://github.com/dominictarr/r-edit which uses https://github.com/dominictarr/r-array makes editing pretty easy. You could also use a model based on patches.

dominictarr commented 9 years ago

see also https://github.com/pfraze/eco

mitar commented 9 years ago

So quill is just an editor, but it is easy to integrate with it. The question is what would be a data structure/model in the background which would allow such rich-text editing.

dominictarr commented 9 years ago

ah, so you mean like a string except formatting and fonts are preserved?

mitar commented 9 years ago

Yes.

dominictarr commented 9 years ago

okay so if you can serialize quill's state into json you should be good, but I think that is a question you should ask quill, not secure-scuttlebutt

mitar commented 9 years ago

So I use https://github.com/vigour-io/gossip-object as a base model for JSON?

dominictarr commented 9 years ago

sure, but the important thing is what sort of json structure does quill give you? for rich text, it's quite likely to be a treeish structure... or maybe a listish structure. listish will be easier, but you have to figure that out.