I’m just reading about ProseMirror for last day. May very well be missing the obvious. Depressing (in a good way mostly, thanks for making it open source) all the cool stuff… I work on my own editors and I’m just not this smart I think
Anyway, I’m interested in creating multiple views of the same underlying document model. For example one editor would view the entire document, while another would be focused into a particular section of that document.
In CodeMirror you can do this by creating a linked document. I’m wondering if ProseMirror has a similar concept? I’ve looked around but can’t seem to find it.
If this isn’t already possible can anyone speculate how hard it would be to implement? At a high level I imagine it might be implemented by:
Create and editor with a document
Choose a range of nodes from the document that you want to view as sub-document.
Create new sub-document with those nodes as children and also record the start offset of those nodes from the original document.
When steps happen in sub-document adjust them by that start offset and also apply them to original document.
Watch for steps in original document and adjust it’s start offset position as needed. And for any steps that effect sub-document content, map and apply those steps.
Links, thoughts, suggestions are all appreciated.