On Sat, Dec 9, 2023 at 8:02 AM HaveF HaveF <[email protected]> wrote:

I'm eager to expand my knowledge of Leo. While reading code is a viable
> learning method, I find the scope of Leo overwhelming. Could you recommend
> an approach or path to learning more about Leo that is *manageable and
> not too steep*?
>

Thanks for this excellent question.

Leo is all about outlines, and the point of outlines is to choose the level
of detail appropriate for your task.

Imo, LeoPyRef.leo is the *only* reasonable starting point for study. Forget
the documentation. It describes the code's *results*.

In the remarks below, don't try to memorize anything!  Just read to get a
rough picture. *Don't overwhelm yourself!*

In LeoPyRef.leo, the top-level *Code* node contains all of Leo's code.

The first child of the Code node is *About this file*. It's a good idea to
read it and its three children.

Next, *locate* Leo's files. Read the docstrings if you like, but the file
names will (after a while) tell you what you need to know.

You already know about *c*, *g*, and *p*. Find the corresponding modules in
the *Core *node:

*leoGlobals.py* defines g.

*leoApp.py* defines *g.app <http://g.app>*, the *LeoApp *class. This class
contains global data.

*leoNodes.py* defines the *Position *class (p) and *VNode *class (p.v).

*leoCommands.py* defines *parts* of the *Commands *class (c).

The *Commands *node contains all files in the *leo.commands* package.

This package *injects* methods into c using *@cmd* and *@g.command* decorators.
There is no need to understand how they work :-)

The *Gui Base Classes* node defines the base classes for all guis.

The *Qt gui *node contains files that implement Leo's Qt gui. Beginners
need not understand this code.

*Summary*

The children of the Code node contain all of Leo's sources.

Each of Leo's files is an @file node whose children are the file's classes.

Don't try to remember much. Focus only on the code that is relevant to you.

Next, pick a Leo project that matters to you and find the code that does
something similar.

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2UTWw8Y3M6wmiuYUQcgc3n16w4Sx7RGhLGoCi6_a7zcw%40mail.gmail.com.

Reply via email to