On Tue, 01 Oct 2013 10:14:26 -0400 Jacob Peck <[email protected]> wrote:
> On 10/1/2013 9:50 AM, Edward K. Ream wrote: > > To execute, say, a java program from a Leo outline > Out of curiosity, are there any leo-to-other-languages bridges out there? > > Better yet, is there a RESTful API that Leo can expose to get at the > nodes/commanders/globals? I can see this being a huge boon. plugin mod_http.py is a beginning. I use it for sending bookmarks from the browser to leo, with a "javascript bookmark" on the toolbar in the browser. But it also allows browsing of the outlines in the Leo instance it's running in. Cheers -Terry > Leo would run a small local webserver on a local port (for this example, > we'll go with :9999). It would return JSON replies to queries. For > example, you could get a list of commanders with a request like: > > http://localhost:9999/g/app/commanders > > Returning something like: > > { > "1": { > "id": "1", > "file":"/some/file/.leo" > } > } > > Then to get a list of all positions: > > http://localhost:9999/c/1/all_positions > > API calls that need arguments could be passed with keywords: > > http://localhost:9999/c/1/p/nthChild?n=4 > > Etc. > > This could enable non-python languages to interact with Leo outlines in > a fairly hassle-free manner... nearly every language has simple bindings > to make http requests and parse json. > > Well, hassle-free after someone writes the wrapper to the important bits > of the API. > > > Sorry to get off topic. It just struck me as potentially awesome. > > -->Jake > -- 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/groups/opt_out.
