Building scripts from outlines — Leo v4.8 documentation

### Navigation

- index
- next |
- previous |
- Leo v4.8 documentation »

# Building scripts from outlines

Leo scripts can be composed of more than one node, just as external files are organized. The Execute Script command preprocesses the script before executing it, by expanding section references and @others directives

For example, I organize my complex script as follows. I create a top-level node containing just:

    '''docstring'''
    @others
    controller(c).run()

A child node will contain the following:

    class controller:
        def __init__(self,c):
            self.c = c
        @others

And the children of the top-level class node will contain all the methods of the controller class. This organization is simple, flexible and powerful.

### Navigation

- index
- next |
- previous |
- Leo v4.8 documentation »