For many years I was pursued by this itch - trying to find a “perfect” text editor for collaboration. But not just any text editor that supports collaboration, oh no, my task is to find (well, at least look for) open text editors with real-time group work (i.e. not only plain text, but also structured content). Thus, the focus of this article is on the rather niche category of open source tools and the technologies on which they work. If your interests are broader, you can refer to this constantly updated list of editors . So. I jumped off a cliff many times and dived into a virtually endless sea of real-time collaboration programs. Flying down, this invigorating dive to the bottom of the pool, I already know very well. It usually begins with some initial excitement and surprise ( leap ) of new low-level technologies and research, followed by a feeling of congestion and a desire to emerge ( hey, it's pretty deep here ) and explore the application part, and then the period when my thoughts are best described with the phrase: “Am I really that stupid for this?” (Quite likely) because usually the documentation, the demo and the code are not exactly the same or make sense, the collaboration component on the server does not start and there are borderline situations tion, when more than two users are administered the same word, and on it all ... ends (surfaced gasping).
After this, it is difficult to raise the topic again, the next stage is a kind of winter of thinking, in a dream, waiting for the harsh weather, when I usually allow the half-ready code to work for months ... or years. Until we meet again, conflict-free replicated data type! ')
Fig.1. Jump
The fact is that in 2017 I was so excited about the prospects of one algorithm (a kind of CRDT ) described in a research article that I spent several days and implemented it in JavaScript , only to find out that there is a borderline in the scientific article itself, for which no solution is given (well ... but maybe all the same?). At that time I turned to the author, but did not receive a response, and found that this particular border situation was considered in a similar algorithm by another team, but hell, because of these subtleties in the implementation, I could probably transfer it to Lisp ... SO STOP! What's going on here? Of course, I do not want to introduce a new algorithm from research work and fix its problems! What am I doing, how did I get here? Let's rewind back!
What I (and probably you, too, dear reader) really need is a plug-and-play editor, a finished product . Which solves the problem of real-time collaboration. Which allows several connected users thousands of miles from each other to edit a structured document by pressing keys on keyboards and see each other’s changes on their screens. That's all. However, editors are difficult ... and I could not find such a tool.
Still.
The year 2019 came (the itch returned with force ), and this time not only the magic editor appeared, but in fact even two applicants for the implementation of the long-awaited specification. Initially, I wanted to fly with you over the field and list almost all the text editors to work together, but this does not seem to add much value . Instead, let's focus on two editors who can become "the very one."
But there are two editors, and you need to make a choice - it would be a good idea to consider which one is really better. I propose a deep scientific classification system with the following categories (using kiwi as a standard unit of good):
Open license: adds 1 kiwi (this is also an exception criterion)
Image support: adds 1 Kiwi
Table support: adds 1 Kiwi
List support: add 1 qiwi
Math Support: Adds 1 Kiwi
Support real-time collaboration : adds 1 Kiwi
Available server components : 1 Kiwi
Remote cursor and selection support: 1 Kiwi (i.e. you can see the cursors of other users)
Work offline : 1 Kiwi (it's quite difficult to define)
Production Experience : 1 Kiwi
Mobile Support: 1 Kiwi
With such a scoring system, the editor can get a maximum of 11 kiwi units of good. Let's get started!
CKEditor 5
Figure 2. Interface CKEditor 5 (one of the possible options), source
Let's start with CKEditor 5, the latest version of a large line of quality editors . He is beautiful. I know, I know that this is not a criterion, and in reality it does not matter (and we may not even agree), but I just had to say about its beauty. So, this editor takes a lot of QI: it is licensed under the GPL ( some discussion of limitations here ), (+1), supports images, tables, lists (+3), mathematics is supported by a plugin (+1) and it also supports collaboration in real time with remote cursor and highlighting (+2). The creators of CKEditor have written an amazingly detailed blog post about how they developed it using operational transformations.
However, I could not find the necessary implementation of the server for real-time collaboration, and all the documentation indicates the mandatory need for their cloud service and (paid) component even in GPL-compatible projects.
The level of offline support is difficult to determine , but it seems that it is not quite complete (for example, the editor can withstand briefly interrupted connection, but not several days of working offline). Probably half a kiwi? The same goes for mobile support, there is also work on full support (+0.5). And the last moment, CKEditor, of course, is used in production, but I could not find a list of products based on it (+0.5).
A good editor, but the lack of an open source open source collaboration server is really depressing.
Full rating: 8.5 / 11
Atlaskit editor
Fig.3. Atlaskit Editor by Atlassian
About a year ago, Atlassian launched the open source Atlaskit Design system, and many goodies came with it, including a full- featured ready-to-use editor based on ProseMirror . I already feel that this may be the editor we were looking for! It is released under the Apache 2.0 license, according to many, a very permissive open source license (+1 Kiwi). It not only supports images, tables and lists, but it supports them exceptionally well (+3 kiwi)! The implementation of the tables, which most editors really miss, is perfectly done here:
Fig.4. Managing tables in the Atlaskit Editor
Unfortunately, mathematics is not supported, but the editor itself is based on ProseMirror, so it should not be a problem to add an existing solution to it (+0.5). It definitely supports real-time collaboration with remote cursors and highlights (+2), this is one of the best examples of UI support I’ve ever seen (for example, remote cursors are dimmed if they overlap with your own, and other great implementation details ). In addition, from my testing, support for working offline seems very strong (+1) - probably due to the “core competency” approach that ProseMirror uses for collaboration . Wow, we already got to 7,5 kiwis, and many more points! Forward!
Unfortunately, this is where we face a bit of harsh reality. As in CKEditor, there is no real-time collaboration server implementation available. Lazy people. Major bummer. I wonder if this can be fixed? ..
In any case, if you continue to go down the criteria, then everything else is worthy of kiwi: it is absolutely used in production (millions of users), and it has mobile support (+2). Just when I was going to announce the winner (a total of 9.5 kiwis) and publish this post, something else appeared. It turns out the logos and icons used in the editor, and many other Atlaskit components are licensed under the very restrictive license ADG , which says that you cannot use them outside of the Atlassian universe. However, the same icons are widely used and tightly integrated into the editor. A major bummer number two, and I take away the kiwi. We are back to 8.5, and if you are counting, you see that the result is now the same. And it is final.
Now, if something to do with these icons ...
After all the recent advances in online text editors, I thought it would be very sad to stay with two great editors with amazing features that you still can't use in open source projects - either because of licensing issues, lack of available building blocks, or both.
Therefore, I first developed the server part (based on PostgreSQL, the PubSweet framework and a mix of REST / WebSockets), the code is available here . It is quite simple, but it does its job and provides document persistence and communication channel in real time. Surprisingly, thanks to the huge ProseMirror community, I was able to figure out how everything should work without having an exact interface specification (+1 Kiwi).
And then I replaced the icons used by the editor with icons from the Feather set . In particular, I had to replace three packages. Since the ADG license, among other things, prohibits any derivative work, these packages needed to be redone from scratch. Probably, because of this, some functions were lost, mainly in terms of accessibility for people with disabilities, but a good open base has been created for further development. For example, in some cases there are no better alternatives for icons , so if you want to contribute to this project, here’s your first problem (+1 Kiwi)!
All this means that now we are only half Kiwi from the perfect result (but we can probably do the math). What I did not believe in when I began this journey was completed. It also means that we have a clear winner in this battle, and ultimately the Atlaskit Editor has won thanks to the diverse, open and useful community of ProseMirror . Read the project documentation for instructions on where to start. I believe that if you are starting a new project and are considering the possibility of cooperation in real time, this is a great place to start, even with all the reservations .
Fig.5. Demonstration of real-time editing capabilities in the Atlaskit Editor
Final (corrected) result: 10.5 / 11
Honorable Mention
There are two editors that I would like to mention, although they don’t have a real-time collaboration solution right now, but both are built on top of libraries that support this functionality. Perhaps both are in the plans.
Fig.6. Wax Editor (ProseMirror based word processor)
The first is Wax (named after the ancient wax tablets) from the Coko Foundation. This word processor was first made on the Substance library ( repository ), and now rebuilt under ProseMirror ( repository ). It is exclusively packed with functionality. These are not exactly the functions for which we give kiwi, but nevertheless these are excellent functions. Wax was originally built for the layout of books , it supports notes (numbered annotations, common in books), history of changes, search and replace, ornaments and others. Maybe for it give oranges ? In this case, Wax will receive 4 kiwis (open license, images, lists, use in production) and a couple of oranges, possibly four. . This is a lot of fruit!
Texture
Fig.7. Texture, Substance Based Editor
Finally, we have a Texture , a very specific, professional (but open source) editor for creating scientific content in JATS format (XML standard for journal articles). If we are practicing fruit counting here, our fingers will almost certainly run out: open license, tables, images, deep support for mathematics, links and cross-references, lists, support for metadata, the list goes on! I repeat, both Wax and Texture are great editors , and the only thing that keeps them from the maximum amount of kiwi is the lack of real-time co-editing features that this article is about.
Conclusion
If you create a system in which real-time co-editing is the key component, you have chosen the right time. The landscape matured last year, and now there are almost plug-and-play open solutions. Perhaps, with your help, in exactly one year we will have a whole range of open source projects. And perhaps, only perhaps, we will also use tools built on top of these open layers, without even knowing it.