On Sunday, September 30, 2018 at 4:44:45 PM UTC-5, frakel12 wrote:

​> is there a way to find out the name of the current intermediate file Leo 
is producing when invoking a @button script with 
c.k.simulateCommand('rst3') from any sub-node of an @rst node.

The rst3 command may produce multiple results, so there is no unique answer.

> In other words, how can I figure out the name of 'mydocument.tex' when 
compiling the node '@rst mydocument.tex' ??

I presume you are talking about the full path to mydocument.tex, but I'm 
not sure I understand your question.

Let's look at the code.  The top-level code is rst.rst3 command & helpers, 
in leoRst.py.  To find all @rst nodes, rst.processTopTree uses:

roots = g.findRootsWithPredicate(self.c, p, predicate=predicate)

For each root node in the roots list, rst.processTopTree calls:

self.root = p.copy()
self.processTree(p, ext=None, toString=False, justOneFile=justOneFile)

So, within the rst code itself, self.root is the root @rst node.  The 
calculation of the output path occurs deep in the called code.  You could 
try to find and use that code, but that won't be pretty.

Instead, your script could use g.findRootsWithPredicate (with a simpler 
predicate) to compute it's own list of @rst nodes, and call rst.processTree 
for each root.  That way you would be sure what @rst node is being 
processed, which in turn makes the path calculations easier.

HTH.

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