On Thursday, May 25, 2017 at 6:21:30 AM UTC-4, Edward K. Ream wrote: > > On Wed, May 24, 2017 at 2:53 PM, Eric S. Johansson <[email protected] > <javascript:>> wrote: > > > There are two types of structure. One is the structure of code in > hierarchy and organization of entities, another is the hierarchy expressed > in Leo. But in writing there is the structure of the narrative, the plot > line of characters. > > There > > have been lengthy, > ongoing discussions about > the > difficulties of using, say, the rst3 command, to document code. > N > either clones nor bookmarks suffice to "access" code, comments or any > other "narrative item" > embedded > > a Leo outline. > > The general solution is a custom script that "pick > s > out" the desired data, > > creating either > an @rst tree or, say, an @auto-md tree. What > > gets > "pick > ed > out" from an outline requires some kind of additional markup that you > (your script) supplies. >
The last paragraph is close to what I'm looking for. For example, from my sajax module for brython, I would want to see something like" def request(self, Ajax_URL, Ajax_mode ="GET", arg_dict=None): - Ajax_URL = string containing URL used for the GET or POST request - Ajax_mode = request type. Supported modes are GET and POST - arg_dict = is a dictionary containing arguments to be passed to the server. Arguments will be formatted according to the mode The request method of class sajax triggers request via the URL and mode given. The two supported modes are GET and POST. Any data passed from the browser to the server is held in arg_dict. The contents of arg_dict are formatted into a URL encoded string appended to the URL for GET requests and properly formatted and embedded in the body of a POST request. ---- While it's entirely possible for this documentation to be embedded in code, I would rather see it directed to a separate document for human consumption. I "should" be able to link to the definition of the method so that I don't have to cut and paste the information and run the risk of getting out of sync. In Leo terminology, it is a clone although not of an entire node. As an after thought, it would be nice to be able to include things like drawings in the documentation which is another reason why should be separate from the code. > > > > What I'm looking for is [links to definitions]. > > Yes, that would be useful, in specific places. > I will try to identify and record such places as issues > > > For me the the way I would want information about Leo plug-ins is this: > > How do I access the contents of the node? > > How do I change the contents of a node? > > How do I store context dependent information for later use? > > These are all basic operations on p. p.h is the headline, p.b is the body > text. p.u is the user attributes (uA). > > > > > How do I invoke my code on an event such as doing something before or > after saving? > > Define event handlers, as described > <http://leoeditor.com/writingPlugins.html#handling-events> > here <http://leoeditor.com/writingPlugins.html#handling-events>, in the > <http://leoeditor.com/writingPlugins.html> > writing plugins chapter <http://leoeditor.com/writingPlugins.html>. > > > How do I tell Leo to save the results of my code interpreting the > contents of the node rather than the contents of a node > > I don't understand this question. > For example, let's say I have user attribute set like uA["color"]="red" uA["car"]="ford" uA["wheel"]="round" and the body was: On my $color $car, I have $wheel wheels When I save, the body and user attributes would be preserved somewhere but the file, as specified by some @xxx command would contain: On my red car, I have round wheels In other words, I have a template I have values, and I want to save result of processing the template. Now there may be other computational efforts I may use to create the final output but it is basically what I have described. I have seen a plug-in that looks similar to this but I haven't explored all of his capabilities yet. I wasn't fond of the markup indicator "left brace space bar left brace" then "right brace space bar right brace" This is should be useful in programming by speech. Defining a template and then filling in the blanks is more effective than straight dictation of code especially if I use the template more than once. Let's save for another discussion is the idea of templates being cloned with individual uA sections. > > >> > > Select the lines, then do Tab or Shift-Tab. > > > > > I hope you understand why that's not really a good solution for speech > recognition. :-) ... > > Actually, I don't understand. > I could create a speech macro that would emit a tab or shift tab when I say indent or out dent region. Done that before works okay but what if I want to parameterize and say indent this block or out dent five lines. Then the problem becomes a little more difficult to implement with simple keystrokes. With an API like interface, I could run a selection routine counting by lines or by features in the code and and then run the indentation command. The one thing I don't ever want to do is "speak the keyboard" where you say individual letters or command keys to make something happen. It's a horrible thing to do to your voice > > > > > Leave Mark > > > > jump to end of block > > > > indent region > > > > Or, a better form would be: > > > > Indent block > > > > > I'll explain what I mean by block in a different note. > > Leo already can do almost all of this. For specific tweaks you could > define @commands. > > > > > But with speech, I can say "leave Mark" and then move the mouse to > someplace else and speak a command that operates on a region. > > You can probably do this in Leo. > > > > > I also added a second enhancement request for having a series of commands > "<jump|push> to <beginning | start | finish | end> of line". > > How do you think Leo implements Ctrl-Home and Ctrl-End? These bindings > aren't built into Leo! Instead, there are commands that are bound to > Ctrl-Home, Ctrl-End and many other sequences. > > Here's how to find them. Do a regex search for ctrl.home in > leoSettings.leo You will find: > > beginning-of-buffer = Ctrl-Home > > This is in a node called (not very helpfully) Changes. The parent is > @keys EKR bindings. Look in > these > nodes: > > @shortcuts Arrow keys and the <return> key > @shortcuts Changes > @shortcuts Cursor Moves > > You will see that Leo already has > ** > *all *the standard Emacs commands related to cursor movement, with the > possible exception of the Emacs mark command. But don't be so sure about > that. Leo knows the about selections, and the direction of selections > (point and mark). > > Okay I will do more reading and get back to you with questions > > > > If the guideline is a page or two long, it helps a lot. Voluminous > documentation just doesn't work. > > Leo has several summaries. Start with the cheat sheet. > > > Are you familiar with the learning technique of explaining what you > learned to a novice? > > I explain things to Rebecca :-) > That could work. :-) > > I apologize for it being so long because I really didn't have time to > write a short one. > > Lack of time is a feeble excuse. > Yes it is but it is also reference to a well-known (mis)quote and a self-deprecating joke all in one. http://quoteinvestigator.com/2012/04/28/shorter-letter/ -- 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.
