On Tue, Feb 20, 2018 at 8:15 PM, Zoom.Quiet <[email protected]> wrote:

>
>
>> - Opening a .leo file (in atom) will init *python state data* in the
>> python kernel. *Python code* in the kernel will load the .leo file and
>> create a representation (a tree of vnodes, or an sqlite db) of the outline 
>> *in
>> the kernel namespace*. The python code will pass a representation (as
>> json or cson) of the entire outline back to Leo's js plugin code.  This
>> will only happen once, when opening the outline.
>>
>
> means all Leo's commands/plugins will process by python self, not change?
>

​That is the idea.​

​ The js code in atom would call a python wrapper in the kernel.  This
wrapper would be similar to the Leo bridge.  It would get Leo's entire code
base using python imports.


>
>> - Leos' javascript code (in atom) will update the screen when inserting,
>> deleting, moving, changing and cloning nodes.  So the js code acts pretty
>> much like gui code. The js code must (probably) also update the python
>> representation in the kernel namespace for the outline.
>>
>
> Wow, means Atom only make GUI part,
> others actions all by python , same now, not change?
>

​Yes, that's the idea.  However, it's probably not so simple.  For example,
the mod_scripting plugin presently handles @button nodes.  The js code
would have to do some of the work. And there would be other complications.
​


> - The execute-script command (in atom) will send the to-be-executed script
>> to the kernel.  The kernel, using the state data for the outline, will run
>> the script and return the value of the script, and any side effects of the
>> script, again as json/cson.  Using this returned value, the gui code will
>> insert, delete, move, change and cloned nodes on the screen.
>>
>>
> means, Leo all kinds of commands/plugins will bind RESTful API,
> Atom answer user's action,
> sent/accept core API srv.
> Leo base API srv. action, process .leo/export files/...etc.
>

​Yes, in general, but many complications might appear.
​


> *Summary*
>>
>> Leo's plugin (javascript) acts like Leo's gui code. The plugin will also
>> handle some (most?) of Leo's commands.  Commands requiring extensive python
>> code will be passed to the python kernel (per-outline namespace).  Results
>> passed back to Leo's js plugin code then update the screen and Leo's js
>> data structures.
>>
>
> but, this plugin will very large , and the profit only:
> 0: new GUI
> 1: maybe new user from Atom user group
> not others?
>

​There are many advantages to atom besides a new gui.  These come from
node.js modules.​


CoffeeScript nature problem is:
> if some error, the debug report just for generated js not coffeescript,
> means, we can not know which line is error.
>
> so for efficiency,
> write nature JS, will debug quickly;
>
> but for Pythonisat, write JS will feeling sooooooooo ugly.
>

​*If* I do this project I would use coffeescript2.​


​Edward​

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to