Leo (text editor)
| Screenshots | |
| Developer(s) | Edward K. Ream |
|---|---|
| Stable release | 4.9 final / June 21, 2011 |
| Operating system | Cross-platform |
| Type | Text editor, Outliner, IDE |
| License | Python License |
| Website | http://webpages.charter.net/edreamleo/front.html |
Leo (Leonine Editor with Outlines) is a text editor that features outlines with clones as its central tool of organization, navigation, customization and scripting.
Contents |
[edit] Language
Leo is written in Python and use the Qt Gui toolkit. (Tk was the primary toolkit until v4.7, and is now no longer supported.) It is fully scriptable using Python and can be extended with plugins. In Leo, outlines are hierarchical data structures that people use to work with and manage text files—including code.
[edit] Trees, clones and views
Leo is an outliner. Leo's outline pane shows a tree (data structure) of data nodes. Nodes contain headlines, body text, and other information. Headlines naturally serve as descriptions of the body text. For example, @file nodes are nodes whose headline starts with @file. Leo trees are in fact directed acyclic graphs; nodes may have more than one parent. Leo calls such nodes clones. Clones appear in several places in the outline pane. Views are simply nodes whose children contain clones. A single outline may contain arbitrarily many views of the nodes contained therein.
[edit] External files
@file nodes represent external files, files on the computer's file system. When saving an outline Leo automatically writes all changed @file trees back to the external files. Comments, called sentinel lines, in external files represent the outline structure. When Leo reads an outline, these comments allow Leo to recreate @file trees using only the data in the external file. @auto nodes represent external files without using sentinel comments. When reading @auto nodes, Leo uses the program structure of the external file to create the @auto tree.
[edit] Scripting
The body text of any node may contain a Leo script, a Python script executed in the context of a Leo outline. A simple API gives Leo scripts full access to all data in loaded outlines, as well as full access to Leo's own source code. The API includes Python iterators that allow scripts to traverse outlines easily. Scripts may be composed of any tree of nodes. A markup language similar to noweb tells Leo how to create scripts from (parts of) an outline. Headlines naturally control and guide scripts. Examples are:
- @test nodes create unit tests. Leo executes the body of an @test node as unit test, without the body having to create an explicit subclass of Python's UnitTest.TestCase class.
- @button nodes create user-defined commands. Leo executes the script of an @button node in the context of any other outline node.
[edit] References
[edit] External links
- Leo's homepage
- "Literate Programming and Leo". Slashdot. 2002-08-28. http://developers.slashdot.org/article.pl?sid=02/08/28/1655207.
- James Tauber (2004-05-15). "Using the Leo Outliner as a PIM". http://jtauber.com/blog/2004/05/15/using_the_leo_outliner_as_a_pim/.
- Vreda Pieterse, Derrick G. Kourie, Andrew Boake. "A case for contemporary literate programming". In ACM. ACM International Conference Proceeding Series; Vol. 75. Proceedings of the 2004 annual research conference of the South African institute of computer scientists and information technologists on IT research in developing countries. pp. 2–9. http://portal.acm.org/citation.cfm?id=1035054. (cited in references)