David Szent-Györgyi: Please send an example .leo file

109 views
Skip to first unread message

Edward K. Ream

unread,
Mar 4, 2021, 6:34:11 AM3/4/21
to leo-editor
Hi David,

It will be worth my time to suggest alternatives to @root. Please send me an example of how you use @root.  Thanks.

Edward

David Szent-Györgyi

unread,
Mar 4, 2021, 5:25:21 PM3/4/21
to leo-editor
I apologize for the delay in digging this up.

I've shared a Dropbox link with your edreamleo <at> gmail <dot> com email address. 

The link is to a shared folder that at present contains a Zip archive with a couple of  Leo files and WSF files - enough to open the Leo file. As the Leo file shows, I use the @root directive for each WSF file! 

Anything I can do to explain or correct problems, let me know. 

Edward K. Ream

unread,
Mar 5, 2021, 6:51:44 AM3/5/21
to leo-editor
On Thu, Mar 4, 2021 at 4:25 PM David Szent-Györgyi <das...@gmail.com> wrote:
I apologize for the delay in digging this up.

No problem.

I've shared a Dropbox link with your edreamleo <at> gmail <dot> com email address. 

I've got the folder. I've created a copy under control of git so I can track my changes and compare with the originals.  I suspect it will be straightforward to convert to either @file or @clean.  I'll use @clean at first to minimize git diffs, but when the dust settles I would suggest using @file if you can.

I'll let you know how the conversion process went soon.

Edward

Edward K. Ream

unread,
Mar 6, 2021, 1:10:54 PM3/6/21
to leo-editor
On Fri, Mar 5, 2021 at 5:51 AM Edward K. Ream <edre...@gmail.com> wrote:

I've got the folder. I've created a copy under control of git so I can track my changes and compare with the originals.  I suspect it will be straightforward to convert to either @file or @clean. 

It was. Enclosed is my copy of your outline, with some, but not all, @root trees converted.

Here is what I did:

- Removed top-level nodes that didn't contain code.
- Changed the @root directive in the body text to @clean in the headline.
- Made clones of all section references defined outside of @clean nodes, and moved the clones so they are children of the nodes that reference them.
- Saved the @clean nodes, and the verified that the external files were the same as before, or nearly so.

Optional steps. I did some of these, but not all:

- Delete all @unit and @code directives.
- Change @doc to @.
- Indicate "library" (cloned) nodes by prefixing their names with, say, "Lib:".
- Use @others rather than section references of self-contained library nodes.
- Change @clean to @file after you are satisfied with the results.

Summary

Unless you have dozens of files to convert, it should be straightforward to convert from @root to @clean (or @file).

I am more convinced than ever that @root should go.

Please feel free to ask more questions.

Edward
EKR MIS support scripts.leo

Edward K. Ream

unread,
Mar 6, 2021, 4:19:54 PM3/6/21
to leo-editor
On Saturday, March 6, 2021 at 12:10:54 PM UTC-6 Edward K. Ream wrote:

Enclosed is my copy of your outline, with some, but not all, @root trees converted.

Here is what I did:

- Removed top-level nodes that didn't contain code.
- Changed the @root directive in the body text to @clean in the headline.
- Made clones of all section references defined outside of @clean nodes, and moved the clones so they are children of the nodes that reference them.
- Saved the @clean nodes, and the verified that the external files were the same as before, or nearly so.

his is a recipe for a conversion script! It should be straightforward.  Iirc, @unit delimits the area that contains the desired section definitions.

Retiring @root is a good thing, and a conversion script should be part of the retirement process. I'm on it.

Edward

Edward K. Ream

unread,
Mar 6, 2021, 4:31:59 PM3/6/21
to leo-editor
On Saturday, March 6, 2021 at 3:19:54 PM UTC-6 Edward K. Ream wrote:

> Retiring @root is a good thing, and a conversion script should be part of the retirement process.

I've just created #1832.

Edward

Edward K. Ream

unread,
Mar 8, 2021, 12:38:22 PM3/8/21
to leo-editor
On Saturday, March 6, 2021 at 3:31:59 PM UTC-6 Edward K. Ream wrote:

> Retiring @root is a good thing, and a conversion script should be part of the retirement process.

I've just created #1832.

The convert-at-root command is now complete. I tested it on David's .leo file and closed #1832.

The command ensures that all section definition nodes appear as descendants of the nodes containing the section references. The script finds each definition node by searching all @unit trees, clones the definition node and moves the clone to the proper place.

Some by-hand adjustment may be necessary. For example, in David's .leo file an @root node was also a section definition node(!!). In this special case the command does not change the headline: doing so would destroy the section definition. The fix should be obvious, but imo it would be pointless for the command to attempt it.

I will soon move leoTangle.py to the attic. I see no conceivable circumstance in which @root and @unit could ever be more useful than @clean.

Edward
Reply all
Reply to author
Forward
0 new messages