On Mon, Feb 3, 2014 at 6:07 AM, Fidel N <[email protected]> wrote:
​> ​
I would like to use @image, @path, @url, etc in the following way:

​[snip]
​> ​
So, the idea is to have the possibility to include nodes with directives
seamlessly into your scripts, without breaking them, and being able to
still use all Leo functionalities. And being able to name them =)

​I'm not sure I understand all aspects of your question, but​ here are some
tips:

1. If you make something an "official" directive, Leo's scripting machinery
will turn it into comments for you automatically.

2. You can create your own directives simply by adding their name (without
the leading '@') to g.globalDirectiveList.

3. Once you do that, your script can call g.get_directives_dict_list to
find your directives.  This calls g.get_directives_dict as a helper.
Depending on circumstances, one or the other may be more convenient. Search
Leo's sources for examples and adapt to your situation.

4. After finding instances of your directives, your script will have to do
something with it ;-)

I recommend having all directive-related data be contained in directives:
this ensures that scripts will automatically ignore the data.  So, for your
example, you could use a "helper" directive, say @my-directive-data
directive containing (let's say) a path, that your @my-directive directive
would then use in some way.  Clear?

HTH.  Please feel free to ask more questions.

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.

Reply via email to