On Mon, Feb 3, 2014 at 11:57 AM, Fidel N <[email protected]> wrote:
> > What I was trying to ask hehe... is about possibility to make nodes such > as the following: > > > header: @url My_Url_Name > body: http://www.websitename.com > > > header: @path My_Favourite_Folder > body: path/to/that/folder > > And same with @image, and rest of Leo current directives. > Yes, you can do that. aList = g.splitLines(p.b) returns a each line of the body text, so naturally a script or command (created via @command or @button) can do simple "parsing". > The reason is that I would like to be able to be on a node, and have all > visible, its tittle, its directive, and be able to control+click it (Use > its directive properties), yet being able to have it inside a complex > bigger script, without interfering with it, but accepting children which > will interfere with the script... > Then use comments for your data: # header: @url My_Url_Name # body: http://www.websitename.com # header: @path My_Favourite_Folder # body: path/to/that/folder Hehehe I realize I just want it all from Leo... but such thing would be > really dynamic and adaptable to any situation! > It's easy. For example, unit tests typically search for nodes that *aren't* part of the script: myData = g.findNodeAnywhere(c,'@myData') or myData = g.findNodeInTree(c,p,'@myData') > If a node with @url, @image, etc, contains its first line beign a path: > Make leo ignore that first line and use it as what it is, the path being > pointed to. > Ignoring a node that would otherwise be part of a script should also be easy, although I haven't tried it: Just put '@' as the first character of the node. This makes the entire node a comment (an @doc section.) when part of the script, but p.b will be unchanged. But this seems unnecessary. I recommend doing what all the unit tests do: use g.findNodeAnywhere/InTree to find non-script data. 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 http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/groups/opt_out.
