Re: viewrendered.py Question

2013-11-25 Thread Edward K. Ream
On Fri, Nov 22, 2013 at 11:16 AM, Jacob Peck gatesph...@gmail.com wrote:

  On 11/22/2013 12:14 PM, Edward K. Ream wrote:

  vr displays reStructuredText automatically.  That's how Leo's help
 commands work.

 But it does *not* expand section references, @others, etc., which is what
 the original message alludes to :)


Oh, so *that's* what the original question was asking ;-)

It's reasonable to want.  In particular, it would solve some problems
involving markup defined in a parent node and used in child nodes.  vr
doesn't see the parent markup when rendering the child.

However, I have no plans for any such thing at present.  Just a tad busy
with other things.

EKR

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-25 Thread Edward K. Ream
On Fri, Nov 22, 2013 at 6:24 PM, Chris George technat...@gmail.com wrote:

 So it works. I open a new window for the vr pane and set it to float above
 all other windows. The work flow then becomes:

 1. Change content, move nodes around.
 2. Move to appropriate place in the @rst tree and run rst3 command in the
 mini-buffer.
 3. Navigate to the @auto node and refresh from disk.
 4. Run vr-update to see the new output in context.

 Realtime would be better IMHO. But I am glad that I can do it at all.


You can get pretty much real time by doing this in a script.

Such scripts can be fantastically helpful.

For example, here is the contents of @button make-sphinx in LeoDocs.leo::

@language python
import os
trace = True
g.cls()
c.setComplexCommand('make-sphinx')
if c.isChanged():
c.save()
aList = c.rstCommands.rst3()
if aList:
path = g.os_path_finalize_join(g.app.loadDir,'..','doc','html')
os.chdir(path)
if len(aList)  1: g.execute_shell_commands('make clean',trace=trace)
g.execute_shell_commands('make html',trace=trace)
fn = aList[0].h.strip() if len(aList) == 1 else 'leo_toc.html'
fn =
g.os_path_finalize_join(path,'_build','html',g.os_path_basename(fn))
if g.os_path_exists(fn):
# Don't wait for this command to exit!
g.execute_shell_commands(['%s' % (fn)],trace=trace)

BTW, c.setComplexCommand('make-sphinx') allows me to type Ctrl-P
(repeat-complex-command) to execute this script again.

make-sphinx uses external processes.  From your description, you may not
have to do that.  In any case, 20 minutes spent writing such a script will
transform your workflow.  It did for me.

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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-22 Thread Jacob Peck

On 11/22/2013 11:58 AM, Chris George wrote:
I was wondering if it is currently possible to have the viewrendered 
pane display a view of what would be the output of an @rst node.


I use an @rst node as the top of a document. I would like to be able 
to lock the viewrendered pane to this node, but have it display the 
rendered rst as if I had run the rst3 command, but in real time. This 
would allow me to have a rendered view of the entire document, not 
just individual nodes. This would be very helpful during the final 
stages of document assembly before sending a render off to the 
finished format.


Chris
--
I've been thinking about this too... perhaps viewrendered needs a '@bool 
viewrendered-expand-references' setting?


--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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-22 Thread Jacob Peck

On 11/22/2013 12:14 PM, Edward K. Ream wrote:
On Fri, Nov 22, 2013 at 10:58 AM, Chris George technat...@gmail.com 
mailto:technat...@gmail.com wrote:


I was wondering if it is currently possible to have the
viewrendered pane display a view of what would be the output of an
@rst node.


vr displays reStructuredText automatically.  That's how Leo's help 
commands work.


Edward

But it does *not* expand section references, @others, etc., which is 
what the original message alludes to :)


--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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-22 Thread Chris George
I created an @auto node to read the interim rst file. This works, but still 
requires me to run rst3 and navigate to the @auto node.

I do not seem to be able to access lock-unlock-rendering-pane, one of the 
commands from viewrendered.py. In fact, none of the commands from this 
plugin appear to work in the minibuffer for me. If I could lock the pane to 
the @auto node, then it would be simply the chore of me figuring out how to 
create a script/button to automate this.

Chris  

On Friday, November 22, 2013 9:16:01 AM UTC-8, Jacob Peck wrote:

  On 11/22/2013 12:14 PM, Edward K. Ream wrote:
  
  On Fri, Nov 22, 2013 at 10:58 AM, Chris George 
 techn...@gmail.comjavascript:
  wrote:
  
 I was wondering if it is currently possible to have the viewrendered pane 
 display a view of what would be the output of an @rst node.


 vr displays reStructuredText automatically.  That's how Leo's help 
 commands work.

  Edward
   
  But it does *not* expand section references, @others, etc., which is what 
 the original message alludes to :)

 --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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-22 Thread Jacob Peck

On 11/22/2013 4:03 PM, Chris George wrote:
I created an @auto node to read the interim rst file. This works, but 
still requires me to run rst3 and navigate to the @auto node.


I do not seem to be able to access lock-unlock-rendering-pane, one of 
the commands from viewrendered.py. In fact, none of the commands from 
this plugin appear to work in the minibuffer for me. If I could lock 
the pane to the @auto node, then it would be simply the chore of me 
figuring out how to create a script/button to automate this.



I think those commands have been renamed 'vr-lock' and 'vr-unlock'.

Not sure when that happened, but it was before my time with Leo...

--Jake


Chris

On Friday, November 22, 2013 9:16:01 AM UTC-8, Jacob Peck wrote:

On 11/22/2013 12:14 PM, Edward K. Ream wrote:

On Fri, Nov 22, 2013 at 10:58 AM, Chris George
techn...@gmail.com javascript: wrote:

I was wondering if it is currently possible to have the
viewrendered pane display a view of what would be the output
of an @rst node.


vr displays reStructuredText automatically. That's how Leo's help
commands work.

Edward


But it does *not* expand section references, @others, etc., which
is what the original message alludes to :)

--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 leo-editor+unsubscr...@googlegroups.com.

To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


--
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-22 Thread Chris George
That works as far as it goes.

vr-lock locks the current view of the rendering pane. In order to update 
the view I must unlock it and relock it, which means I must navigate to the 
@auto node which negates the purpose. Having it live is the goal.


Chris

On Friday, November 22, 2013 1:09:59 PM UTC-8, Jacob Peck wrote:

  On 11/22/2013 4:03 PM, Chris George wrote:
  
 I created an @auto node to read the interim rst file. This works, but 
 still requires me to run rst3 and navigate to the @auto node. 

  I do not seem to be able to access lock-unlock-rendering-pane, one of 
 the commands from viewrendered.py. In fact, none of the commands from 
 this plugin appear to work in the minibuffer for me. If I could lock the 
 pane to the @auto node, then it would be simply the chore of me figuring 
 out how to create a script/button to automate this.

   I think those commands have been renamed 'vr-lock' and 'vr-unlock'.

 Not sure when that happened, but it was before my time with Leo...

 --Jake

  Chris  

 On Friday, November 22, 2013 9:16:01 AM UTC-8, Jacob Peck wrote: 

  On 11/22/2013 12:14 PM, Edward K. Ream wrote:
  
  On Fri, Nov 22, 2013 at 10:58 AM, Chris George techn...@gmail.comwrote:
  
 I was wondering if it is currently possible to have the viewrendered 
 pane display a view of what would be the output of an @rst node.


 vr displays reStructuredText automatically.  That's how Leo's help 
 commands work.

  Edward
   
  But it does *not* expand section references, @others, etc., which is 
 what the original message alludes to :)

 --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 leo-editor+...@googlegroups.com javascript:.
 To post to this group, send email to leo-e...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/leo-editor.
 For more options, visit https://groups.google.com/groups/opt_out.


  

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-22 Thread Chris George
So it works. I open a new window for the vr pane and set it to float above 
all other windows. The work flow then becomes:

1. Change content, move nodes around.
2. Move to appropriate place in the @rst tree and run rst3 command in the 
mini-buffer.
3. Navigate to the @auto node and refresh from disk.
4. Run vr-update to see the new output in context.

Realtime would be better IMHO. But I am glad that I can do it at all.

Chris

On Friday, November 22, 2013 1:40:53 PM UTC-8, Chris George wrote:

 That works as far as it goes.

 vr-lock locks the current view of the rendering pane. In order to update 
 the view I must unlock it and relock it, which means I must navigate to the 
 @auto node which negates the purpose. Having it live is the goal.


 Chris

 On Friday, November 22, 2013 1:09:59 PM UTC-8, Jacob Peck wrote:

  On 11/22/2013 4:03 PM, Chris George wrote:
  
 I created an @auto node to read the interim rst file. This works, but 
 still requires me to run rst3 and navigate to the @auto node. 

  I do not seem to be able to access lock-unlock-rendering-pane, one of 
 the commands from viewrendered.py. In fact, none of the commands from 
 this plugin appear to work in the minibuffer for me. If I could lock the 
 pane to the @auto node, then it would be simply the chore of me figuring 
 out how to create a script/button to automate this.

   I think those commands have been renamed 'vr-lock' and 'vr-unlock'.

 Not sure when that happened, but it was before my time with Leo...

 --Jake

  Chris  

 On Friday, November 22, 2013 9:16:01 AM UTC-8, Jacob Peck wrote: 

  On 11/22/2013 12:14 PM, Edward K. Ream wrote:
  
  On Fri, Nov 22, 2013 at 10:58 AM, Chris George techn...@gmail.comwrote:
  
 I was wondering if it is currently possible to have the viewrendered 
 pane display a view of what would be the output of an @rst node.


 vr displays reStructuredText automatically.  That's how Leo's help 
 commands work.

  Edward
   
  But it does *not* expand section references, @others, etc., which is 
 what the original message alludes to :)

 --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 leo-editor+...@googlegroups.com.
 To post to this group, send email to leo-e...@googlegroups.com.
 Visit this group at http://groups.google.com/group/leo-editor.
 For more options, visit https://groups.google.com/groups/opt_out.


  

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-22 Thread gatesphere
I wrote a quick @button script for you, to help you out.  Put this in an 
'@button update-vr' node somewhere in your outline:



@language python

''' usage:
1. modify nodename below to exactly match the
   headline of the node you wish vr to render (your @auto node)
2. modify rstnodename below to exactly match the
headline of your @rst node
3. Alt-X vr
4. Alt-X vr-lock
5. Click this button 'update-vr' any time to
   re-render the target node
'''

nodename = '@auto myfile.rst'
rstnodename = '@rst myfile.html'
current_v = p.v
c.selectPosition(g.findNodeAnywhere(c,rstnodename))
c.executeMinibufferCommand('rst3')
c.readAtAutoNodes()
c.selectPosition(g.findNodeAnywhere(c,nodename))
c.executeMinibufferCommand('vr-update')
c.selectPosition(c.vnode2Position(current_v))


Be sure to change nodename to match the headline of the @auto node you 
created.  This should combine steps 2, 3, and 4 into a single click, 
with no navigation, and drop you down back on the node you were editing 
prior to clicking the button.


Beware: this has the side-effect of reloading *all* @auto nodes in the 
current outline.  Shouldn't be a huge deal, but just be aware.  Take 
backups before you try this.


Hope this helps!
--Jake

On 11/22/2013 7:24 PM, Chris George wrote:
So it works. I open a new window for the vr pane and set it to float 
above all other windows. The work flow then becomes:


1. Change content, move nodes around.
2. Move to appropriate place in the @rst tree and run rst3 command in 
the mini-buffer.

3. Navigate to the @auto node and refresh from disk.
4. Run vr-update to see the new output in context.

Realtime would be better IMHO. But I am glad that I can do it at all.

Chris

On Friday, November 22, 2013 1:40:53 PM UTC-8, Chris George wrote:

That works as far as it goes.

vr-lock locks the current view of the rendering pane. In order to
update the view I must unlock it and relock it, which means I must
navigate to the @auto node which negates the purpose. Having it
live is the goal.


Chris

On Friday, November 22, 2013 1:09:59 PM UTC-8, Jacob Peck wrote:

On 11/22/2013 4:03 PM, Chris George wrote:

I created an @auto node to read the interim rst file. This
works, but still requires me to run rst3 and navigate to the
@auto node.

I do not seem to be able to access
lock-unlock-rendering-pane, one of the commands from
viewrendered.py. In fact, none of the commands from this
plugin appear to work in the minibuffer for me. If I could
lock the pane to the @auto node, then it would be simply the
chore of me figuring out how to create a script/button to
automate this.


I think those commands have been renamed 'vr-lock' and
'vr-unlock'.

Not sure when that happened, but it was before my time with Leo...

--Jake


Chris

On Friday, November 22, 2013 9:16:01 AM UTC-8, Jacob Peck wrote:

On 11/22/2013 12:14 PM, Edward K. Ream wrote:

On Fri, Nov 22, 2013 at 10:58 AM, Chris George
techn...@gmail.com wrote:

I was wondering if it is currently possible to have
the viewrendered pane display a view of what would
be the output of an @rst node.


vr displays reStructuredText automatically.  That's how
Leo's help commands work.

Edward


But it does *not* expand section references, @others,
etc., which is what the original message alludes to :)

--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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-22 Thread Chris George
Thank-you so much. I will let you know how it works out. It is great to see 
a practical example of scripting Leo. I'll save it as a snippet right now 
and modify it and run it on a copy of my data.

Chris

On Friday, November 22, 2013 7:34:49 PM UTC-8, Jacob Peck wrote:

  I wrote a quick @button script for you, to help you out.  Put this in an 
 '@button update-vr' node somewhere in your outline:

 
 @language python

 ''' usage:
 1. modify nodename below to exactly match the 
headline of the node you wish vr to render (your @auto node)
 2. modify rstnodename below to exactly match the
 headline of your @rst node
 3. Alt-X vr
 4. Alt-X vr-lock
 5. Click this button 'update-vr' any time to 
re-render the target node
 '''

 nodename = '@auto myfile.rst'
 rstnodename = '@rst myfile.html'
 current_v = p.v
 c.selectPosition(g.findNodeAnywhere(c,rstnodename))
 c.executeMinibufferCommand('rst3')
 c.readAtAutoNodes()
 c.selectPosition(g.findNodeAnywhere(c,nodename))
 c.executeMinibufferCommand('vr-update')
 c.selectPosition(c.vnode2Position(current_v))
 

 Be sure to change nodename to match the headline of the @auto node you 
 created.  This should combine steps 2, 3, and 4 into a single click, with 
 no navigation, and drop you down back on the node you were editing prior to 
 clicking the button.

 Beware: this has the side-effect of reloading *all* @auto nodes in the 
 current outline.  Shouldn't be a huge deal, but just be aware.  Take 
 backups before you try this.

 Hope this helps!
 --Jake

 On 11/22/2013 7:24 PM, Chris George wrote:
  
 So it works. I open a new window for the vr pane and set it to float above 
 all other windows. The work flow then becomes: 

  1. Change content, move nodes around.
 2. Move to appropriate place in the @rst tree and run rst3 command in the 
 mini-buffer.
 3. Navigate to the @auto node and refresh from disk.
 4. Run vr-update to see the new output in context.

  Realtime would be better IMHO. But I am glad that I can do it at all.

  Chris

 On Friday, November 22, 2013 1:40:53 PM UTC-8, Chris George wrote: 

 That works as far as it goes. 

  vr-lock locks the current view of the rendering pane. In order to 
 update the view I must unlock it and relock it, which means I must navigate 
 to the @auto node which negates the purpose. Having it live is the goal.

  
  Chris

 On Friday, November 22, 2013 1:09:59 PM UTC-8, Jacob Peck wrote: 

  On 11/22/2013 4:03 PM, Chris George wrote:
  
 I created an @auto node to read the interim rst file. This works, but 
 still requires me to run rst3 and navigate to the @auto node. 

  I do not seem to be able to access lock-unlock-rendering-pane, one of 
 the commands from viewrendered.py. In fact, none of the commands from 
 this plugin appear to work in the minibuffer for me. If I could lock the 
 pane to the @auto node, then it would be simply the chore of me figuring 
 out how to create a script/button to automate this.

   I think those commands have been renamed 'vr-lock' and 'vr-unlock'.

 Not sure when that happened, but it was before my time with Leo...

 --Jake

  Chris  

 On Friday, November 22, 2013 9:16:01 AM UTC-8, Jacob Peck wrote: 

  On 11/22/2013 12:14 PM, Edward K. Ream wrote:
  
  On Fri, Nov 22, 2013 at 10:58 AM, Chris George techn...@gmail.comwrote:
  
 I was wondering if it is currently possible to have the viewrendered 
 pane display a view of what would be the output of an @rst node.


 vr displays reStructuredText automatically.  That's how Leo's help 
 commands work.

  Edward
   
  But it does *not* expand section references, @others, etc., which is 
 what the original message alludes to :)

 --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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-22 Thread Chris George
Thank-you Jacob.

That is so helpful. And perfect timing. I am playing with final layouts for 
an assignment that is due Sunday. This will speed the process. Now to whip 
out Qt Inspector and find out what the name of that floating vr pane is so 
I can style the font. It must be a solid 16pt.

Chris

On Friday, November 22, 2013 8:03:14 PM UTC-8, Chris George wrote:

 Thank-you so much. I will let you know how it works out. It is great to 
 see a practical example of scripting Leo. I'll save it as a snippet right 
 now and modify it and run it on a copy of my data.

 Chris

 On Friday, November 22, 2013 7:34:49 PM UTC-8, Jacob Peck wrote:

  I wrote a quick @button script for you, to help you out.  Put this in 
 an '@button update-vr' node somewhere in your outline:

 
 @language python

 ''' usage:
 1. modify nodename below to exactly match the 
headline of the node you wish vr to render (your @auto node)
 2. modify rstnodename below to exactly match the
 headline of your @rst node
 3. Alt-X vr
 4. Alt-X vr-lock
 5. Click this button 'update-vr' any time to 
re-render the target node
 '''

 nodename = '@auto myfile.rst'
 rstnodename = '@rst myfile.html'
 current_v = p.v
 c.selectPosition(g.findNodeAnywhere(c,rstnodename))
 c.executeMinibufferCommand('rst3')
 c.readAtAutoNodes()
 c.selectPosition(g.findNodeAnywhere(c,nodename))
 c.executeMinibufferCommand('vr-update')
 c.selectPosition(c.vnode2Position(current_v))
 

 Be sure to change nodename to match the headline of the @auto node you 
 created.  This should combine steps 2, 3, and 4 into a single click, with 
 no navigation, and drop you down back on the node you were editing prior to 
 clicking the button.

 Beware: this has the side-effect of reloading *all* @auto nodes in the 
 current outline.  Shouldn't be a huge deal, but just be aware.  Take 
 backups before you try this.

 Hope this helps!
 --Jake

 On 11/22/2013 7:24 PM, Chris George wrote:
  
 So it works. I open a new window for the vr pane and set it to float 
 above all other windows. The work flow then becomes: 

  1. Change content, move nodes around.
 2. Move to appropriate place in the @rst tree and run rst3 command in the 
 mini-buffer.
 3. Navigate to the @auto node and refresh from disk.
 4. Run vr-update to see the new output in context.

  Realtime would be better IMHO. But I am glad that I can do it at all.

  Chris

 On Friday, November 22, 2013 1:40:53 PM UTC-8, Chris George wrote: 

 That works as far as it goes. 

  vr-lock locks the current view of the rendering pane. In order to 
 update the view I must unlock it and relock it, which means I must navigate 
 to the @auto node which negates the purpose. Having it live is the goal.

  
  Chris

 On Friday, November 22, 2013 1:09:59 PM UTC-8, Jacob Peck wrote: 

  On 11/22/2013 4:03 PM, Chris George wrote:
  
 I created an @auto node to read the interim rst file. This works, but 
 still requires me to run rst3 and navigate to the @auto node. 

  I do not seem to be able to access lock-unlock-rendering-pane, one of 
 the commands from viewrendered.py. In fact, none of the commands from 
 this plugin appear to work in the minibuffer for me. If I could lock the 
 pane to the @auto node, then it would be simply the chore of me figuring 
 out how to create a script/button to automate this.

   I think those commands have been renamed 'vr-lock' and 'vr-unlock'.

 Not sure when that happened, but it was before my time with Leo...

 --Jake

  Chris  

 On Friday, November 22, 2013 9:16:01 AM UTC-8, Jacob Peck wrote: 

  On 11/22/2013 12:14 PM, Edward K. Ream wrote:
  
  On Fri, Nov 22, 2013 at 10:58 AM, Chris George techn...@gmail.comwrote:
  
 I was wondering if it is currently possible to have the viewrendered 
 pane display a view of what would be the output of an @rst node.


 vr displays reStructuredText automatically.  That's how Leo's help 
 commands work.

  Edward
   
  But it does *not* expand section references, @others, etc., which is 
 what the original message alludes to :)

 --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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Re: viewrendered.py Question

2013-11-22 Thread gatesphere
I assume it worked then?  I don't use rst, so I couldn't really test 
it.  Just went on a hunch ;)


If so, glad to help :)

--Jake

On 11/22/2013 11:11 PM, Chris George wrote:

Thank-you Jacob.

That is so helpful. And perfect timing. I am playing with final 
layouts for an assignment that is due Sunday. This will speed the 
process. Now to whip out Qt Inspector and find out what the name of 
that floating vr pane is so I can style the font. It must be a solid 16pt.


Chris

On Friday, November 22, 2013 8:03:14 PM UTC-8, Chris George wrote:

Thank-you so much. I will let you know how it works out. It is
great to see a practical example of scripting Leo. I'll save it as
a snippet right now and modify it and run it on a copy of my data.

Chris

On Friday, November 22, 2013 7:34:49 PM UTC-8, Jacob Peck wrote:

I wrote a quick @button script for you, to help you out.  Put
this in an '@button update-vr' node somewhere in your outline:


@language python

''' usage:
1. modify nodename below to exactly match the
   headline of the node you wish vr to render (your @auto
node)
2. modify rstnodename below to exactly match the
headline of your @rst node
3. Alt-X vr
4. Alt-X vr-lock
5. Click this button 'update-vr' any time to
   re-render the target node
'''

nodename = '@auto myfile.rst'
rstnodename = '@rst myfile.html'
current_v = p.v
c.selectPosition(g.findNodeAnywhere(c,rstnodename))
c.executeMinibufferCommand('rst3')
c.readAtAutoNodes()
c.selectPosition(g.findNodeAnywhere(c,nodename))
c.executeMinibufferCommand('vr-update')
c.selectPosition(c.vnode2Position(current_v))


Be sure to change nodename to match the headline of the @auto
node you created.  This should combine steps 2, 3, and 4 into
a single click, with no navigation, and drop you down back on
the node you were editing prior to clicking the button.

Beware: this has the side-effect of reloading *all* @auto
nodes in the current outline. Shouldn't be a huge deal, but
just be aware.  Take backups before you try this.

Hope this helps!
--Jake

On 11/22/2013 7:24 PM, Chris George wrote:

So it works. I open a new window for the vr pane and set it
to float above all other windows. The work flow then becomes:

1. Change content, move nodes around.
2. Move to appropriate place in the @rst tree and run rst3
command in the mini-buffer.
3. Navigate to the @auto node and refresh from disk.
4. Run vr-update to see the new output in context.

Realtime would be better IMHO. But I am glad that I can do it
at all.

Chris

On Friday, November 22, 2013 1:40:53 PM UTC-8, Chris George
wrote:

That works as far as it goes.

vr-lock locks the current view of the rendering pane. In
order to update the view I must unlock it and relock it,
which means I must navigate to the @auto node which
negates the purpose. Having it live is the goal.


Chris

On Friday, November 22, 2013 1:09:59 PM UTC-8, Jacob Peck
wrote:

On 11/22/2013 4:03 PM, Chris George wrote:

I created an @auto node to read the interim rst
file. This works, but still requires me to run rst3
and navigate to the @auto node.

I do not seem to be able to access
lock-unlock-rendering-pane, one of the commands from
viewrendered.py. In fact, none of the commands from
this plugin appear to work in the minibuffer for me.
If I could lock the pane to the @auto node, then it
would be simply the chore of me figuring out how to
create a script/button to automate this.


I think those commands have been renamed 'vr-lock'
and 'vr-unlock'.

Not sure when that happened, but it was before my
time with Leo...

--Jake


Chris

On Friday, November 22, 2013 9:16:01 AM UTC-8, Jacob
Peck wrote:

On 11/22/2013 12:14 PM, Edward K. Ream wrote:

On Fri, Nov 22, 2013 at 10:58 AM, Chris George
techn...@gmail.com wrote:

I was wondering if it is currently possible
to have the viewrendered pane display a
view of what would be the output of an @rst
node.


vr displays reStructuredText automatically.
That's how Leo's help commands 

Re: viewrendered.py Question

2013-11-22 Thread Chris George
Here is what it gives me on running the script. I followed the sequence 
exactly. I was looking at your script and I don't see the Refresh From 
Disk step. Is that part of c.readAtAutoNodes() ?


rendering pane locked

exception preprocessing script

Traceback (most recent call last):

  File /home/chris/Working/leo/leo-editor/leo/core/leoAtFile.py, line 3551, 
in writeFromString
at.writeOpenFile(root,nosentinels=not 
useSentinels,toString=True,fromString=s)

  File /home/chris/Working/leo/leo-editor/leo/core/leoAtFile.py, line 3674, 
in writeOpenFile
at.putOpenNodeSentinel(root)

  File /home/chris/Working/leo/leo-editor/leo/plugins/lineNumbers.py, line 
51, in putLineNumberDirective
oldOpenNodeSentinel(self,v,inAtAll,inAtOthers,middle)

TypeError: putOpenNodeSentinel() takes at most 4 arguments (5 given)

no script selected




On Friday, November 22, 2013 8:22:58 PM UTC-8, Jacob Peck wrote:

  I assume it worked then?  I don't use rst, so I couldn't really test 
 it.  Just went on a hunch ;)

 If so, glad to help :)

 --Jake

 On 11/22/2013 11:11 PM, Chris George wrote:
  
 Thank-you Jacob. 

  That is so helpful. And perfect timing. I am playing with final layouts 
 for an assignment that is due Sunday. This will speed the process. Now to 
 whip out Qt Inspector and find out what the name of that floating vr pane 
 is so I can style the font. It must be a solid 16pt.

  Chris

 On Friday, November 22, 2013 8:03:14 PM UTC-8, Chris George wrote: 

 Thank-you so much. I will let you know how it works out. It is great to 
 see a practical example of scripting Leo. I'll save it as a snippet right 
 now and modify it and run it on a copy of my data. 

  Chris

 On Friday, November 22, 2013 7:34:49 PM UTC-8, Jacob Peck wrote: 

  I wrote a quick @button script for you, to help you out.  Put this in 
 an '@button update-vr' node somewhere in your outline:

 
 @language python

 ''' usage:
 1. modify nodename below to exactly match the 
headline of the node you wish vr to render (your @auto node)
 2. modify rstnodename below to exactly match the
 headline of your @rst node
 3. Alt-X vr
 4. Alt-X vr-lock
 5. Click this button 'update-vr' any time to 
re-render the target node
 '''

 nodename = '@auto myfile.rst'
 rstnodename = '@rst myfile.html'
 current_v = p.v
 c.selectPosition(g.findNodeAnywhere(c,rstnodename))
 c.executeMinibufferCommand('rst3')
 c.readAtAutoNodes()
 c.selectPosition(g.findNodeAnywhere(c,nodename))
 c.executeMinibufferCommand('vr-update')
 c.selectPosition(c.vnode2Position(current_v))
 

 Be sure to change nodename to match the headline of the @auto node you 
 created.  This should combine steps 2, 3, and 4 into a single click, with 
 no navigation, and drop you down back on the node you were editing prior to 
 clicking the button.

 Beware: this has the side-effect of reloading *all* @auto nodes in the 
 current outline.  Shouldn't be a huge deal, but just be aware.  Take 
 backups before you try this.

 Hope this helps!
 --Jake

 On 11/22/2013 7:24 PM, Chris George wrote:
  
 So it works. I open a new window for the vr pane and set it to float 
 above all other windows. The work flow then becomes: 

  1. Change content, move nodes around.
 2. Move to appropriate place in the @rst tree and run rst3 command in 
 the mini-buffer.
 3. Navigate to the @auto node and refresh from disk.
 4. Run vr-update to see the new output in context.

  Realtime would be better IMHO. But I am glad that I can do it at all.

  Chris

 On Friday, November 22, 2013 1:40:53 PM UTC-8, Chris George wrote: 

 That works as far as it goes. 

  vr-lock locks the current view of the rendering pane. In order to 
 update the view I must unlock it and relock it, which means I must 
 navigate 
 to the @auto node which negates the purpose. Having it live is the goal.

  
  Chris

 On Friday, November 22, 2013 1:09:59 PM UTC-8, Jacob Peck wrote: 

  On 11/22/2013 4:03 PM, Chris George wrote:
  
 I created an @auto node to read the interim rst file. This works, but 
 still requires me to run rst3 and navigate to the @auto node. 

  I do not seem to be able to access lock-unlock-rendering-pane, one 
 of the commands from viewrendered.py. In fact, none of the commands 
 from this plugin appear to work in the minibuffer for me. If I could lock 
 the pane to the @auto node, then it would be simply the chore of me 
 figuring out how to create a script/button to automate this.

   I think those commands have been renamed 'vr-lock' and 'vr-unlock'.

 Not sure when that happened, but it was before my time with Leo...

 --Jake

  Chris  

 On Friday, November 22, 2013 9:16:01 AM UTC-8, Jacob Peck wrote: 

  On 11/22/2013 12:14 PM, Edward K. Ream wrote:
  
  On Fri, Nov 22, 2013 at 10:58 AM, Chris George 
 techn...@gmail.comwrote:
  
 I was wondering if it is currently possible to have the viewrendered 
 pane display a view of what would be the output of an @rst node.


 

Re: viewrendered.py Question

2013-11-22 Thread gatesphere

On 11/22/2013 11:32 PM, Chris George wrote:
Here is what it gives me on running the script. I followed the 
sequence exactly. I was looking at your script and I don't see the 
Refresh From Disk step. Is that part of c.readAtAutoNodes() ?



rendering pane locked

exception preprocessing script

Traceback (most recent call last):

  File /home/chris/Working/leo/leo-editor/leo/core/leoAtFile.py, line 3551, 
in writeFromString
at.writeOpenFile(root,nosentinels=not 
useSentinels,toString=True,fromString=s)

  File /home/chris/Working/leo/leo-editor/leo/core/leoAtFile.py, line 3674, 
in writeOpenFile
at.putOpenNodeSentinel(root)

  File /home/chris/Working/leo/leo-editor/leo/plugins/lineNumbers.py, line 
51, in putLineNumberDirective
oldOpenNodeSentinel(self,v,inAtAll,inAtOthers,middle)

TypeError: putOpenNodeSentinel() takes at most 4 arguments (5 given)

no script selected



Hmm... that's interesting.  Let me check this out...

--Jake




On Friday, November 22, 2013 8:22:58 PM UTC-8, Jacob Peck wrote:

I assume it worked then?  I don't use rst, so I couldn't really
test it.  Just went on a hunch ;)

If so, glad to help :)

--Jake

On 11/22/2013 11:11 PM, Chris George wrote:

Thank-you Jacob.

That is so helpful. And perfect timing. I am playing with final
layouts for an assignment that is due Sunday. This will speed the
process. Now to whip out Qt Inspector and find out what the name
of that floating vr pane is so I can style the font. It must be a
solid 16pt.

Chris

On Friday, November 22, 2013 8:03:14 PM UTC-8, Chris George wrote:

Thank-you so much. I will let you know how it works out. It
is great to see a practical example of scripting Leo. I'll
save it as a snippet right now and modify it and run it on a
copy of my data.

Chris

On Friday, November 22, 2013 7:34:49 PM UTC-8, Jacob Peck wrote:

I wrote a quick @button script for you, to help you out. 
Put this in an '@button update-vr' node somewhere in your

outline:


@language python

''' usage:
1. modify nodename below to exactly match the
   headline of the node you wish vr to render (your
@auto node)
2. modify rstnodename below to exactly match the
headline of your @rst node
3. Alt-X vr
4. Alt-X vr-lock
5. Click this button 'update-vr' any time to
   re-render the target node
'''

nodename = '@auto myfile.rst'
rstnodename = '@rst myfile.html'
current_v = p.v
c.selectPosition(g.findNodeAnywhere(c,rstnodename))
c.executeMinibufferCommand('rst3')
c.readAtAutoNodes()
c.selectPosition(g.findNodeAnywhere(c,nodename))
c.executeMinibufferCommand('vr-update')
c.selectPosition(c.vnode2Position(current_v))


Be sure to change nodename to match the headline of the
@auto node you created.  This should combine steps 2, 3,
and 4 into a single click, with no navigation, and drop
you down back on the node you were editing prior to
clicking the button.

Beware: this has the side-effect of reloading *all* @auto
nodes in the current outline.  Shouldn't be a huge deal,
but just be aware.  Take backups before you try this.

Hope this helps!
--Jake

On 11/22/2013 7:24 PM, Chris George wrote:

So it works. I open a new window for the vr pane and set
it to float above all other windows. The work flow then
becomes:

1. Change content, move nodes around.
2. Move to appropriate place in the @rst tree and run
rst3 command in the mini-buffer.
3. Navigate to the @auto node and refresh from disk.
4. Run vr-update to see the new output in context.

Realtime would be better IMHO. But I am glad that I can
do it at all.

Chris

On Friday, November 22, 2013 1:40:53 PM UTC-8, Chris
George wrote:

That works as far as it goes.

vr-lock locks the current view of the rendering
pane. In order to update the view I must unlock it
and relock it, which means I must navigate to the
@auto node which negates the purpose. Having it live
is the goal.


Chris

On Friday, November 22, 2013 1:09:59 PM UTC-8, Jacob
Peck wrote:

On 11/22/2013 4:03 PM, Chris George wrote:

I created an @auto node to read the interim rst
file. This works, but still requires 

Re: viewrendered.py Question

2013-11-22 Thread gatesphere

Ah, small issues -- I missed a command and mistyped another:

Replace the code with the new version (works for me, I tested it and 
everything!):



@language python

''' usage:
1. modify nodename below to exactly match the
   headline of the node you wish vr to render (your @auto node)
2. modify rstnodename below to exactly match the
headline of your @rst node
3. Alt-X vr
4. Alt-X vr-lock
5. Click this button 'update-vr' any time to
   re-render the target node
'''

nodename = '@auto myfile.html.txt'
rstnodename = '@rst myfile.html'
current_v = p.v
c.selectPosition(g.findNodeAnywhere(c,rstnodename))
c.executeMinibufferCommand('rst3')
c.selectPosition(g.findNodeAnywhere(c,nodename))
c.readAtAutoNodes()
c.selectPosition(g.findNodeAnywhere(c,nodename))
c.executeMinibufferCommand('vr-update')
c.selectPosition(c.vnode2position(current_v))


I was also mistaken about the reloading *all* @auto files -- this will 
only reload the one you specify.


Let me know if this still doesn't work.

--Jake

On 11/22/2013 11:32 PM, Chris George wrote:
Here is what it gives me on running the script. I followed the 
sequence exactly. I was looking at your script and I don't see the 
Refresh From Disk step. Is that part of c.readAtAutoNodes() ?



rendering pane locked

exception preprocessing script

Traceback (most recent call last):

  File /home/chris/Working/leo/leo-editor/leo/core/leoAtFile.py, line 3551, 
in writeFromString
at.writeOpenFile(root,nosentinels=not 
useSentinels,toString=True,fromString=s)

  File /home/chris/Working/leo/leo-editor/leo/core/leoAtFile.py, line 3674, 
in writeOpenFile
at.putOpenNodeSentinel(root)

  File /home/chris/Working/leo/leo-editor/leo/plugins/lineNumbers.py, line 
51, in putLineNumberDirective
oldOpenNodeSentinel(self,v,inAtAll,inAtOthers,middle)

TypeError: putOpenNodeSentinel() takes at most 4 arguments (5 given)

no script selected




On Friday, November 22, 2013 8:22:58 PM UTC-8, Jacob Peck wrote:

I assume it worked then?  I don't use rst, so I couldn't really
test it.  Just went on a hunch ;)

If so, glad to help :)

--Jake

On 11/22/2013 11:11 PM, Chris George wrote:

Thank-you Jacob.

That is so helpful. And perfect timing. I am playing with final
layouts for an assignment that is due Sunday. This will speed the
process. Now to whip out Qt Inspector and find out what the name
of that floating vr pane is so I can style the font. It must be a
solid 16pt.

Chris

On Friday, November 22, 2013 8:03:14 PM UTC-8, Chris George wrote:

Thank-you so much. I will let you know how it works out. It
is great to see a practical example of scripting Leo. I'll
save it as a snippet right now and modify it and run it on a
copy of my data.

Chris

On Friday, November 22, 2013 7:34:49 PM UTC-8, Jacob Peck wrote:

I wrote a quick @button script for you, to help you out. 
Put this in an '@button update-vr' node somewhere in your

outline:


@language python

''' usage:
1. modify nodename below to exactly match the
   headline of the node you wish vr to render (your
@auto node)
2. modify rstnodename below to exactly match the
headline of your @rst node
3. Alt-X vr
4. Alt-X vr-lock
5. Click this button 'update-vr' any time to
   re-render the target node
'''

nodename = '@auto myfile.rst'
rstnodename = '@rst myfile.html'
current_v = p.v
c.selectPosition(g.findNodeAnywhere(c,rstnodename))
c.executeMinibufferCommand('rst3')
c.readAtAutoNodes()
c.selectPosition(g.findNodeAnywhere(c,nodename))
c.executeMinibufferCommand('vr-update')
c.selectPosition(c.vnode2Position(current_v))


Be sure to change nodename to match the headline of the
@auto node you created.  This should combine steps 2, 3,
and 4 into a single click, with no navigation, and drop
you down back on the node you were editing prior to
clicking the button.

Beware: this has the side-effect of reloading *all* @auto
nodes in the current outline.  Shouldn't be a huge deal,
but just be aware.  Take backups before you try this.

Hope this helps!
--Jake

On 11/22/2013 7:24 PM, Chris George wrote:

So it works. I open a new window for the vr pane and set
it to float above all other windows. The work flow then
becomes:

1. Change content, move nodes around.
2. Move to appropriate place in the @rst tree and run
rst3 command in the mini-buffer.
  

Re: viewrendered.py Question

2013-11-22 Thread Chris George
 

No @rst or @slides nodes in selected tree

done

exception executing script

AttributeError: 'NoneType' object has no attribute 'isDirty'



  line 457: #@+node:ekr.20040306214401: *5* p.Status bits

* line 458: def isDirty (self): return self.v.isDirty()

  line 459: def isExpanded  (self): return self.v.isExpanded()

  line 460: def isMarked(self): return self.v.isMarked()

On Friday, November 22, 2013 8:43:40 PM UTC-8, Jacob Peck wrote:

  Ah, small issues -- I missed a command and mistyped another:

 Replace the code with the new version (works for me, I tested it and 
 everything!):

 
 @language python

 ''' usage:
 1. modify nodename below to exactly match the
headline of the node you wish vr to render (your @auto node)
 2. modify rstnodename below to exactly match the
 headline of your @rst node
 3. Alt-X vr
 4. Alt-X vr-lock
 5. Click this button 'update-vr' any time to
re-render the target node
 '''

 nodename = '@auto myfile.html.txt'
 rstnodename = '@rst myfile.html'
 current_v = p.v
 c.selectPosition(g.findNodeAnywhere(c,rstnodename))
 c.executeMinibufferCommand('rst3')
 c.selectPosition(g.findNodeAnywhere(c,nodename))
 c.readAtAutoNodes()
 c.selectPosition(g.findNodeAnywhere(c,nodename))
 c.executeMinibufferCommand('vr-update')
 c.selectPosition(c.vnode2position(current_v))
 

 I was also mistaken about the reloading *all* @auto files -- this will 
 only reload the one you specify.

 Let me know if this still doesn't work.

 --Jake

 On 11/22/2013 11:32 PM, Chris George wrote:
  
 Here is what it gives me on running the script. I followed the sequence 
 exactly. I was looking at your script and I don't see the Refresh From 
 Disk step. Is that part of c.readAtAutoNodes() ? 

  
  rendering pane locked

 exception preprocessing script

 Traceback (most recent call last):


   File /home/chris/Working/leo/leo-editor/leo/core/leoAtFile.py, line 3551, 
 in writeFromString

 at.writeOpenFile(root,nosentinels=not 
 useSentinels,toString=True,fromString=s)


   File /home/chris/Working/leo/leo-editor/leo/core/leoAtFile.py, line 3674, 
 in writeOpenFile
 at.putOpenNodeSentinel(root)


   File /home/chris/Working/leo/leo-editor/leo/plugins/lineNumbers.py, line 
 51, in putLineNumberDirective
 oldOpenNodeSentinel(self,v,inAtAll,inAtOthers,middle)

 TypeError: putOpenNodeSentinel() takes at most 4 arguments (5 given)

 no script selected


  
  
 On Friday, November 22, 2013 8:22:58 PM UTC-8, Jacob Peck wrote: 

  I assume it worked then?  I don't use rst, so I couldn't really test 
 it.  Just went on a hunch ;)

 If so, glad to help :)

 --Jake

 On 11/22/2013 11:11 PM, Chris George wrote:
  
 Thank-you Jacob. 

  That is so helpful. And perfect timing. I am playing with final layouts 
 for an assignment that is due Sunday. This will speed the process. Now to 
 whip out Qt Inspector and find out what the name of that floating vr pane 
 is so I can style the font. It must be a solid 16pt.

  Chris

 On Friday, November 22, 2013 8:03:14 PM UTC-8, Chris George wrote: 

 Thank-you so much. I will let you know how it works out. It is great to 
 see a practical example of scripting Leo. I'll save it as a snippet right 
 now and modify it and run it on a copy of my data. 

  Chris

 On Friday, November 22, 2013 7:34:49 PM UTC-8, Jacob Peck wrote: 

  I wrote a quick @button script for you, to help you out.  Put this in 
 an '@button update-vr' node somewhere in your outline:

 
 @language python

 ''' usage:
 1. modify nodename below to exactly match the 
headline of the node you wish vr to render (your @auto node)
 2. modify rstnodename below to exactly match the
 headline of your @rst node
 3. Alt-X vr
 4. Alt-X vr-lock
 5. Click this button 'update-vr' any time to 
re-render the target node
 '''

 nodename = '@auto myfile.rst'
 rstnodename = '@rst myfile.html'
 current_v = p.v
 c.selectPosition(g.findNodeAnywhere(c,rstnodename))
 c.executeMinibufferCommand('rst3')
 c.readAtAutoNodes()
 c.selectPosition(g.findNodeAnywhere(c,nodename))
 c.executeMinibufferCommand('vr-update')
 c.selectPosition(c.vnode2Position(current_v))
 

 Be sure to change nodename to match the headline of the @auto node you 
 created.  This should combine steps 2, 3, and 4 into a single click, with 
 no navigation, and drop you down back on the node you were editing prior 
 to 
 clicking the button.

 Beware: this has the side-effect of reloading *all* @auto nodes in the 
 current outline.  Shouldn't be a huge deal, but just be aware.  Take 
 backups before you try this.

 Hope this helps!
 --Jake

 On 11/22/2013 7:24 PM, Chris George wrote:
  
 So it works. I open a new window for the vr pane and set it to float 
 above all other windows. The work flow then becomes: 

  1. Change content, move nodes around.
 2. Move to appropriate place in the @rst tree and run rst3 command 

Re: viewrendered.py Question

2013-11-22 Thread gatesphere
Did you set 'nodename' and 'rstnodename' correctly?  That error says 
that it can't find your @rst node, I think.


--Jake

On 11/22/2013 11:55 PM, Chris George wrote:


No @rst or @slides nodes in selected tree

done

exception executing script

AttributeError: 'NoneType' object has no attribute 'isDirty'



  line 457: #@+node:ekr.20040306214401: *5* p.Status bits

* line 458: def isDirty (self): return self.v.isDirty()

  line 459: def isExpanded  (self): return self.v.isExpanded()

  line 460: def isMarked(self): return self.v.isMarked()


On Friday, November 22, 2013 8:43:40 PM UTC-8, Jacob Peck wrote:

Ah, small issues -- I missed a command and mistyped another:

Replace the code with the new version (works for me, I tested it
and everything!):


@language python

''' usage:
1. modify nodename below to exactly match the
   headline of the node you wish vr to render (your @auto node)
2. modify rstnodename below to exactly match the
headline of your @rst node
3. Alt-X vr
4. Alt-X vr-lock
5. Click this button 'update-vr' any time to
   re-render the target node
'''

nodename = '@auto myfile.html.txt'
rstnodename = '@rst myfile.html'
current_v = p.v
c.selectPosition(g.findNodeAnywhere(c,rstnodename))
c.executeMinibufferCommand('rst3')
c.selectPosition(g.findNodeAnywhere(c,nodename))
c.readAtAutoNodes()
c.selectPosition(g.findNodeAnywhere(c,nodename))
c.executeMinibufferCommand('vr-update')
c.selectPosition(c.vnode2position(current_v))


I was also mistaken about the reloading *all* @auto files -- this
will only reload the one you specify.

Let me know if this still doesn't work.

--Jake

On 11/22/2013 11:32 PM, Chris George wrote:

Here is what it gives me on running the script. I followed the
sequence exactly. I was looking at your script and I don't see
the Refresh From Disk step. Is that part of c.readAtAutoNodes() ?


rendering pane locked

exception preprocessing script

Traceback (most recent call last):

  File /home/chris/Working/leo/leo-editor/leo/core/leoAtFile.py, line 
3551, in
writeFromString
at.writeOpenFile(root,nosentinels=not 
useSentinels,toString=True,fromString=s)

  File /home/chris/Working/leo/leo-editor/leo/core/leoAtFile.py, line 
3674, in
writeOpenFile
at.putOpenNodeSentinel(root)

  File /home/chris/Working/leo/leo-editor/leo/plugins/lineNumbers.py, 
line 51, in
putLineNumberDirective
oldOpenNodeSentinel(self,v,inAtAll,inAtOthers,middle)

TypeError: putOpenNodeSentinel() takes at most 4 arguments (5 given)

no script selected




On Friday, November 22, 2013 8:22:58 PM UTC-8, Jacob Peck wrote:

I assume it worked then?  I don't use rst, so I couldn't
really test it.  Just went on a hunch ;)

If so, glad to help :)

--Jake

On 11/22/2013 11:11 PM, Chris George wrote:

Thank-you Jacob.

That is so helpful. And perfect timing. I am playing with
final layouts for an assignment that is due Sunday. This
will speed the process. Now to whip out Qt Inspector and
find out what the name of that floating vr pane is so I can
style the font. It must be a solid 16pt.

Chris

On Friday, November 22, 2013 8:03:14 PM UTC-8, Chris George
wrote:

Thank-you so much. I will let you know how it works out.
It is great to see a practical example of scripting Leo.
I'll save it as a snippet right now and modify it and
run it on a copy of my data.

Chris

On Friday, November 22, 2013 7:34:49 PM UTC-8, Jacob
Peck wrote:

I wrote a quick @button script for you, to help you
out.  Put this in an '@button update-vr' node
somewhere in your outline:


@language python

''' usage:
1. modify nodename below to exactly match the
   headline of the node you wish vr to render
(your @auto node)
2. modify rstnodename below to exactly match the
headline of your @rst node
3. Alt-X vr
4. Alt-X vr-lock
5. Click this button 'update-vr' any time to
   re-render the target node
'''

nodename = '@auto myfile.rst'
rstnodename = '@rst myfile.html'
current_v = p.v
c.selectPosition(g.findNodeAnywhere(c,rstnodename))
c.executeMinibufferCommand('rst3')
c.readAtAutoNodes()
c.selectPosition(g.findNodeAnywhere(c,nodename))

Re: viewrendered.py Question

2013-11-22 Thread Chris George
Beautiful.

Works like a charm. And provides an even better example of scripting Leo.
Thank-you so much.

Of for final revisions and then bedtime.

Chris


On Fri, Nov 22, 2013 at 9:14 PM, gatesphere gatesph...@gmail.com wrote:

  Did you set 'nodename' and 'rstnodename' correctly?  That error says
 that it can't find your @rst node, I think.

 --Jake


 On 11/22/2013 11:55 PM, Chris George wrote:

  No @rst or @slides nodes in selected tree

 done

 exception executing script

 AttributeError: 'NoneType' object has no attribute 'isDirty'

 

   line 457: #@+node:ekr.20040306214401: *5* p.Status bits

 * line 458: def isDirty (self): return self.v.isDirty()

   line 459: def isExpanded  (self): return self.v.isExpanded()

   line 460: def isMarked(self): return self.v.isMarked()

 On Friday, November 22, 2013 8:43:40 PM UTC-8, Jacob Peck wrote:

  Ah, small issues -- I missed a command and mistyped another:

 Replace the code with the new version (works for me, I tested it and
 everything!):

 
 @language python

 ''' usage:
 1. modify nodename below to exactly match the
headline of the node you wish vr to render (your @auto node)
 2. modify rstnodename below to exactly match the
 headline of your @rst node
 3. Alt-X vr
 4. Alt-X vr-lock
 5. Click this button 'update-vr' any time to
re-render the target node
 '''

 nodename = '@auto myfile.html.txt'
 rstnodename = '@rst myfile.html'
 current_v = p.v
 c.selectPosition(g.findNodeAnywhere(c,rstnodename))
 c.executeMinibufferCommand('rst3')
 c.selectPosition(g.findNodeAnywhere(c,nodename))
 c.readAtAutoNodes()
 c.selectPosition(g.findNodeAnywhere(c,nodename))
 c.executeMinibufferCommand('vr-update')
 c.selectPosition(c.vnode2position(current_v))
 

 I was also mistaken about the reloading *all* @auto files -- this will
 only reload the one you specify.

 Let me know if this still doesn't work.

 --Jake

 On 11/22/2013 11:32 PM, Chris George wrote:

 Here is what it gives me on running the script. I followed the sequence
 exactly. I was looking at your script and I don't see the Refresh From
 Disk step. Is that part of c.readAtAutoNodes() ?


  rendering pane locked

 exception preprocessing script

 Traceback (most recent call last):

   File /home/chris/Working/leo/leo-editor/leo/core/
 leoAtFile.py, line 3551, in writeFromString
 at.writeOpenFile(root,nosentinels=not useSentinels,
 toString=True,fromString=s)

   File /home/chris/Working/leo/leo-editor/leo/core/
 leoAtFile.py, line 3674, in writeOpenFile
 at.putOpenNodeSentinel(root)

   File /home/chris/Working/leo/leo-editor/leo/plugins/
 lineNumbers.py, line 51, in putLineNumberDirective
 oldOpenNodeSentinel(self,v,inAtAll,inAtOthers,middle)

 TypeError: putOpenNodeSentinel() takes at most 4 arguments (5 given)

 no script selected




 On Friday, November 22, 2013 8:22:58 PM UTC-8, Jacob Peck wrote:

  I assume it worked then?  I don't use rst, so I couldn't really test
 it.  Just went on a hunch ;)

 If so, glad to help :)

 --Jake

 On 11/22/2013 11:11 PM, Chris George wrote:

 Thank-you Jacob.

  That is so helpful. And perfect timing. I am playing with final
 layouts for an assignment that is due Sunday. This will speed the process.
 Now to whip out Qt Inspector and find out what the name of that floating vr
 pane is so I can style the font. It must be a solid 16pt.

  Chris

 On Friday, November 22, 2013 8:03:14 PM UTC-8, Chris George wrote:

 Thank-you so much. I will let you know how it works out. It is great to
 see a practical example of scripting Leo. I'll save it as a snippet right
 now and modify it and run it on a copy of my data.

  Chris

 On Friday, November 22, 2013 7:34:49 PM UTC-8, Jacob Peck wrote:

  I wrote a quick @button script for you, to help you out.  Put this
 in an '@button update-vr' node somewhere in your outline:

 
 @language python

 ''' usage:
 1. modify nodename below to exactly match the
headline of the node you wish vr to render (your @auto node)
 2. modify rstnodename below to exactly match the
 headline of your @rst node
 3. Alt-X vr
 4. Alt-X vr-lock
 5. Click this button 'update-vr' any time to
re-render the target node
 '''

 nodename = '@auto myfile.rst'
 rstnodename = '@rst myfile.html'
 current_v = p.v
 c.selectPosition(g.findNodeAnywhere(c,rstnodename))
 c.executeMinibufferCommand('rst3')
 c.readAtAutoNodes()
 c.selectPosition(g.findNodeAnywhere(c,nodename))
 c.executeMinibufferCommand('vr-update')
 c.selectPosition(c.vnode2Position(current_v))
 

 Be sure to change nodename to match the headline of the @auto node you
 created.  This should combine steps 2, 3, and 4 into a single click, with
 no navigation, and drop you down back on the node you were editing prior 
 to
 clicking the button.

 Beware: this has the side-effect of reloading *all* @auto nodes in the
 current outline.  Shouldn't be a huge