Hi, Jason,

Thanks for these ideas. I'm not an R user myself, though, so it would be
helpful to me if you could explain what it is you are trying to achieve.
It's best when thinking through issues like this one to separate the
problem from the solution. What's below seems to be a mix between those.

One reason I ask about this is that LyX 2.3.3 has added the ability to
edit the LaTeX preamble or the contents of an ERT inset using some
external editor. LyX 2.4.0 will extend that to 'collapsible' insets
generally, controlled by a layout tag EditExternal. So by activating
this tag for the appropriate kind of inset, you can edit its contents in
whatever editor you define for its format. That seems, if I'm reading
you right, to give you much of what you want---and to use your editor of
choice.

Riki


On 6/20/19 10:42 AM, Jason Sun wrote:
> I thought about this long and hard. It is possible to extend Lyx's
> functionality beyond the document processer. With the help you pybind
> 11 and Qt5, I think is it possible to implement some of the IDE
> features(think RStudio) in LyX. This would be extremely helpful in
> writing scientific document. Currently, my workflow is to write code
> in VS Code/Emacs and copy and paste everything back and forth between
> LyX and code editor. 
>
> * It is not terribly cumbersome. But if we can development LyX into
> something like RStudio, it would definitely save some time.
>
> * Because LyX has support for knitr. Provided the script editor
> QtWidget and console Widget has been implemented, it won't be very
> hard to build a communication mechanism between the IDE portion and
> the LyX main buffer&main view portion. This is a little bit like
> Jupyter Console (think IPython), but with much better Latex support. 
>
> My rough idea: 
>
> * I think the GUI and UI design part it not so hard. We could just
> create another ViewSource-like class that inherit DockView but with
> editable text field. As for console portion, there are quite a few
> example QtConsole, are we could develop our own wheel. I remember in
> my undergrad OS class. the first project was to implement a
> terminal-ish stuff. As far as I am concerned it is not terribly
> difficult as long as the signals child processes are handled right. 
>
> * The major work should be in the building a python repl inside LyX. I
> think LyX has its own Python for some of the scripting procedures, but
> it is not ideal to use this one. The better solution, IMO, is to
> enable loading the Python Interpreter the user assigned. This gives a
> larger flexibility for various reasons (say, some user might want to
> use TensorFlow. This would be greatly helpful). 
>
> * with pybind11, it is not really hard to open up a python interpreter
> inside c++ applications. The developers of pybind11 gave various
> examples on how to do it. Moreover, pybind11 is a header only library,
> which makes it easy to be built into other applications.
>
>
> These are my thoughts so far. Would be nice to hear some of your ideas
> on this. 
>
>
> Jason Sun
> Cornell University 


Reply via email to