The proper way to establish communication is to use ZeroMQ to interact with IPython directly from LyX. I read the jupyter docs, it is something we could try to do. I can communicate with the LyX main buffer now by letting the main Browser to as ccess LyX.h, and thus have access to call dispatch, and do the injection of variables. It does seem a bit naive compared to the zeroMQ approach. But I would argue that it might be sufficient for light uses. OTOH, if webengine is used, we should utilize its full potential and design the communication framework properly.
To answer some of other question: yes, this widget is dockable in either 4 positions. It also could be dragged out as a single page view. I need to try see how hard it is to embed the zeroMQ communication layer. It can be done for sure, the question is if it is worth the effort or do we have some better alternatives. Sent from my iPhone > On Jul 6, 2019, at 9:12 AM, Joel Kulesza <jkule...@gmail.com> wrote: > >> On Tue, Jul 2, 2019 at 11:03 AM Jason Sun <ds...@cornell.edu> wrote: > >> I have built an example prototype widget that tries to combine LyX and >> Jupyter Notebook together. >> >> Is it implemented via QtWebEngine. Basically, by embedding a mini webpage >> browser inside LyX. >> >> A screenshot is here: >> https://github.com/jupyter/notebook/issues/1604#issuecomment-507746234 >> >> A bidirectional communication between LyX and Jupyter Notebook could be >> implemented via this browser. With the help of jupyter lab, we can get cross >> platform terminal for free. >> >> Would this be something worth further pursuing down the road? >> >> Using Web, a lot could be implemented. Especially, Qt 5.13 introduces Web >> Assembly. With the help of that, LyX could have it OverLeaf counter part >> with stronger abilities! > > Jason, > > Thanks for your thoughts and work on this. Sorry I've been quiet to this > point, but I hoped to ask a few questions as I think about how I'd use your > work. > > I'm a rather avid LyX user, and routinely use Jupyter notebooks. However, > I'm still not entirely clear how these two will be integrated. I see the > screenshot you provided on GitHub; however, it still seems like the LyX > document and notebook are quite separate. It's not clear to me what is > gained by putting them both within one window. Can you please help me > understand how you foresee a user interacting with these two? > > Some more pointed questions based on the interface you provided in the > screenshot: > I assume the browser component can be moved to be bottom half rather than > right half. Is that correct? I usually run LyX on half my monitor, so I'd > be reluctant to end up only running it in 1/4 (and Jupyter in the other 1/4). > Do you have a way to integrate Jupyter I/O with the LyX document? For > example, as a Python variable gets updated in an evaluation it will then get > captured the next time the LyX-produced PDF is compiled/viewed. > Will your .ipynb be included in the File -> Export -> LyX Archive? > Thanks again, > Joel >