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 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+...@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+...@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. > > > -- > 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.