Etherpad plugin: adapt or rewrite?

75 views
Skip to first unread message

YakovL

unread,
Apr 13, 2016, 9:51:58 AM4/13/16
to hive.js
Hello again,

I've got another question, it is somewhat idle but may be worth asking. I've developed an Etherpad plugin that uses LaTeX + codecogs* + MathQuill** for some project; that was a fork of mathjax plugin and I haven't acutally made a plugin that is publicly available (yet), installation is done via unstalling mathjax plugin and substituting codes in the plugin folder. So for the sake of Open Source I may dig a bit and create an actual Etherpad plugin; I may try to adapt it as a hive.js plugin. I wonder how much of the codes should be rewritten or simply adapted, and which is worthy and how much efforts will require -- create Etherpad plugin, hive.js plugin, both.. or none? I can share the source so that you can estimate this things; unfortunately, it doesn't seem that I'll get some help in the Etherpad forums***.

Best regards,
Yakov.

* a LaTeX to image service
** a lib for WYSIWYGish way of formulae writing
*** unfortunately, John answers in a way that I don't understand a thing (https://groups.google.com/forum/#!topic/etherpad-lite-dev/3Rx6VfyLbe8) and that brings much more questions than answers

Marcel Klehr

unread,
Apr 13, 2016, 11:43:20 AM4/13/16
to hiv...@googlegroups.com
Hey Yakov,

I haven't used the mathjax plugin. What's the user experience, i.e. how do you insert/edit formulas? I imagine MathQuill would be a very smooth UX, though.
I understand your frustration. It is not easy to debug let alone produce code in etherpad. And John obviously has very little time to deal with support.
Now about your question: mathquill can probably be integrated in hive.js. The way to do this is actually to write (or find) a mathquill plugin for ckeditor, the rich text editor used in hive. This could either be achieved inline like e.g. tables or (less sexy) with a modal inside of which sits a mathquill box. With the former you probably need to write some non-trivial code that handles other people inserting mathquill sections into the document. The hive rich text package uses dom-ot <https://github.com/marcelklehr/dom-ot to sync the raw DOM, so there's some magic involved that needs to be treated with care. I'm not sure if dom-ot+ckeditor is the way to go, though. ProseMirror might be a better solution. This depends of course on how wel your adventure with integrating mathquill goes -- if we find it doesn't work out with dom-ot+ckeditor we can think about replacing that combo with ProseMirror (or adding that as an alternative). ckeditor + a modal that contains a mathquill box should always be possible, though.

There are multiple ways you could integrate mathquill in etherpad as well as there are multiple ways to integrate it in hive. I daresay that such two plugins would share very little code aside from mathquill.

I hope this helps you in your decision on how to go forward. If you decide to look into creating a hive/ckeditor plugin, I'd be happy to assist you.

Cheers,
Marcel
--
You received this message because you are subscribed to the Google Groups "hive.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hivejs+un...@googlegroups.com.
To post to this group, send email to hiv...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hivejs/1cc8f3f4-a87b-46cb-8893-1510c18ca12d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

j.a.l...@gmail.com

unread,
Apr 25, 2016, 11:40:55 AM4/25/16
to hive.js
Hello again,


I haven't used the mathjax plugin. What's the user experience, i.e. how do you insert/edit formulas?

Well, it was very simple: if you want to insert a formula, you click the button and the menu slides down. It contains 3 fields: MathQuill, LaTeX and CodeCogs. You use either MathQuill or LaTeX to input while CodeCogs shows the image preivew. Once you apply by either clicking the button or hitting enter, the formula is inserted (in form of CodeCogs image). To edit, you need to click the image in the text (so, I haven't made it MathQuill-only, and that would somewhat limit users as MathQuill doesn't do all the stuff well), and the editor is opened again.
 
I imagine MathQuill would be a very smooth UX, though.
I understand your frustration. It is not easy to debug let alone produce code in etherpad. And John obviously has very little time to deal with support.
Now about your question: mathquill can probably be integrated in hive.js. The way to do this is actually to write (or find) a mathquill plugin for ckeditor, the rich text editor used in hive.

So, this is it, right? http://ckeditor.com/addon/mathedit
I'll probably test this when I succeed with installing Hive.js; but may be this is cool to show in a demo "pad" anyway (by the way, it there a synonym of "pad" for hive.js?)

Marcel Klehr

unread,
May 7, 2016, 8:12:35 AM5/7/16
to hiv...@googlegroups.com
Hey,

so, I've since integrated Quill, a rich text editor instead of prose mirror, for now. It might be feasible to create a mathquill plugin for Quill with a better UX than click-on-image-to-edit-source. The mathedit plugin for ckeditor should work fine, though. But, of course, you're still stuck on setting up hive, I take it, so that's for later :)
Btw, Hive.js has documents where etherpad has pads ;)

Cheers,
Marcel
Reply all
Reply to author
Forward
0 new messages