Re: Should Leo support a standard template tool?

2012-05-27 Thread Edward K. Ream
On May 26, 5:03 am, "Edward K. Ream" wrote: > One can imagine a whole bunch of buttons, or better, @command nodes, > each of which creates a unique file.  Each @command node would specify > > A.  The "source" outline. > B.  The template data and (optionally) the name of the file to be written.

Re: Should Leo support a standard template tool?

2012-05-26 Thread Edward K. Ream
On Fri, May 25, 2012 at 2:44 PM, Edward K. Ream wrote: > supporting templates is almost too easy. One can imagine a whole bunch of buttons, or better, @command nodes, each of which creates a unique file. Each @command node would specify A. The "source" outline. B. The template data and (opti

Re: Should Leo support a standard template tool?

2012-05-25 Thread Ville M. Vainio
Also look at jinja_test.leo in contrib branch; it renders a template to variable "mytest" (with @= mytest, and @cl jinja, declared in "prelude" node), and assigns the value of variable to node @r mytest. You can "execute" the outline by alt-x vs-update. It probably helps to read the docstring of

Re: Should Leo support a standard template tool?

2012-05-25 Thread Edward K. Ream
On Fri, May 25, 2012 at 2:44 PM, tfer wrote: > One of the schemes I'm contemplating would involve using non-printing plane > 15 and 16 unicode codepoints as embeddable smart "tab-stops".  Such would > interact with saving and reading, but probably all able to be taken care of > by hooks rather tha

Re: Should Leo support a standard template tool?

2012-05-25 Thread tfer
One of the schemes I'm contemplating would involve using non-printing plane 15 and 16 unicode codepoints as embeddable smart "tab-stops". Such would interact with saving and reading, but probably all able to be taken care of by hooks rather than hacking the read/write code. Such templates woul

Re: Should Leo support a standard template tool?

2012-05-25 Thread Edward K. Ream
On Fri, May 25, 2012 at 1:36 PM, Kent Tenney wrote: > I think I suggested just this ... AWKWARD ... Don't panic. A templating script (or plugin) can do just about anything as long as it doesn't monkey-patch leoFileCommands.py or leoAtFile.py. But that's never going to be necessary. Indeed, su

Re: Should Leo support a standard template tool?

2012-05-25 Thread Kent Tenney
On Fri, May 25, 2012 at 8:12 AM, Edward K. Ream wrote: > About a year ago at the Ashland sprint Kent (iirc) made the following > suggestion: solid, simple implementation of one of the standard > template engines providing intuitive template nodes, variable > definitions, and rendering options. > >

Re: Should Leo support a standard template tool?

2012-05-25 Thread Kent Tenney
I've been using jinja2 lately, because it's favored by Salt. http://saltstack.org There is so much wisdom behind the Salt team that I look to them for best practice recommendations. I've been wanting to slip in a plug for Salt, there you go. Of course there are many very good template systems out

RE: Should Leo support a standard template tool?

2012-05-25 Thread Ville Vainio
Take a look at jinjarender for an example how it could behave. Basically it's @nosent like one directional rendering. Valuespace plugin is used as input source Sent from my Windows Phone From: Edward K. Ream Sent: 5/25/2012 4:12 PM To: leo-editor Subject: Should Leo support a standard template too