Im not familiar with directives myself, didnt get to study them -yet- haha... I must take a look at new tutorials =)
So my answer would be yes, you can, for instance, make a script write down as a first line of your custom @auto nodes something like: X_X_X_MY_CUSTOM_AUTO_NODES_X_X_X So for the @auto nodes that have that line as first line, when you save the outline, you can make the outline find those, attach the level-dependant- script we talked about and save it as a new file. That would be quick and solve your problem. Also, if you want the headers not to be constantly added upon the previous one, you can add some ID to them such as: X_X_Header_Code: #@#@HeaderGoesHere That way the script can check if the header already exists and overwrite in case it changed level or name. This is very very ugly and brute force code but solves the problem quickly. There are for sure better solutions from people who understands directives hehe. On Sunday, October 13, 2013 9:10:41 PM UTC+2, wgw wrote: > > Yes, that does seem like the solution, but is it possible to write that > solution and then "attach" it to a new, user-defined directive, such as > @autohead, which could then be used in place of @auto? > > In short, can the user create a new file output directives (to go along > with @file, @auto, @nosent, etc) ? > > I just find it odd that we lose the headings in the @auto output. > > Thanks! > > Bill > > Le dimanche 13 octobre 2013 11:58:36 UTC-7, Fidel N a écrit : >> >> Hey: >> If I understand correctly, what you need is the position property called >> level. >> >> So depending on the number you get in c.p.level() >> You get different string such as: >> >> for i in range(c.p.level()): >> string.append(r"#@") >> string.append(c.p.h) >> >> Then you add that string to the output file and add its body, then keep >> going to the next node. >> >> On Sunday, October 13, 2013 8:52:57 PM UTC+2, wgw wrote: >>> >>> Is there are way to put the outline structure in a user-defined comment >>> format? I want to generate a stripped down version of @file, where the >>> only thing that would be indicated in the #@ comments would be the headings >>> and their level. That comment string could be user-defined, so you might >>> want "#####<legal numbering>" or other. >>> >>> This would of course lose the directives and so on, but retain the >>> headings and their hierarchy. A file that is something between the @auto >>> and the @file format. (Right now, I just reformat the @file and strip >>> anything that isn't a node.) >>> >>> For example, if the leo headings are: >>> >>> a >>> .b >>> .c >>> ..d >>> e >>> >>> then the output file would indicate the outline structure by a proper >>> stacking of #@ : >>> >>> #@ a >>> code and comments >>> #@#@ b >>> code and comments >>> #@#@ c >>> code and comments >>> #@#@#@ d >>> code and comments >>> #@ e >>> code and comments >>> >>> >>> Is there any easy way to achieve that output format? >>> >>> Thanks! >>> >> -- 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.
