.. rst3: filename: whatis What Is Leo? ============== The Leo editor is a software program for working with text. Leo can be a very good text editor, much like many others. But Leo can do much, much more. Leo helps you create, edit, and understand the structure and contents of collections of plain-text documents. Plain-text documents can include text editor files, source code for programs and documentation, and any other content that can be written as plain text, such as ReStructuredText, Markdown, LaTex, .dot files that represent graph diagrams, to-do lists, and so on. Structure includes both the arrangement of groups of related files, and structure that is important but rarely visualized in ordinary text files. Structure is represented as an outline or tree, and Leo is an effective outliner program. You can visualize structure in a text file by breaking it into sub-parts of your own choosing. You can collect files and nodes into more than one grouping as you wish. Leo's key concepts include a tree-like (outline) organization, nodes that contain the textual content, external files that can be contained as subtrees, and scripts that can add or change Leo's behaviors. Leo makes possible a divide-and-conquer strategy for working with your text and programs. What Can You Do With Leo? +++++++++++++++++++++++++ Leo is so adaptable that there is no end to what you can use it for. With the help of various plugins and scripts, even more special capability can be created. If you can do some Python programming, you can extend Leo's as-built capabilities. Here are some of the many uses to which Leo is being put: - A text editor. - A programming editor. - A Python IDE. - An outliner inspired by *More*, the famous outliner program. - An editor with rendered views for the structured languages ReStructuredText, Markdown, and Asciidoc. - A framework for quick code prototypes. - A debugging assistant. - Production of Mind Maps from outlines and indented lists. - A ToDo list manager. - A PIM. - A literate programming tool. - A Software Project Management assistant. - A browser bookmarks manager. - A generator of high-quality (e.g., Read-the-docs style) documentation by means of Sphinx. - Creation of notebooks somewhat in the Jupyter style that can mix code, text, graphics, and code execution. - Keeping notes and time records for consulting projects. - A repository for scripts and programs. Leo In Action +++++++++++++ Programming Editor ****************** .. figure:: images/leo-own-code.png Leo's own code base is contained in a single Leo outline. Leo is used to edit and develop its own code. Here one of Leo's plugins is being worked on. Restructured Text Editor ************************ .. figure:: images/editing-rst.png Leo can edit and render ReStructuredText, Markdown, and Asciidoc. Documentation Generator *********************** .. figure:: images/creating-sphinx.png Editing the source of this Guide. The *Build-HTML* button generates the entire Sphinx document. Bookmarks Manager ***************** .. figure:: images/bookmarks.png A custom browser bookmarks manager. Feature Prototyping ******************* .. figure:: images/prototyping.png Leo is extremely effective for prototyping new code features. Here we are developing an optional right margin guide line for Leo's editor. The image shows a Qt window opened by the code shown in the outline. The window contains a right margin guide line and printed numbers to show the position of the guide line in characters. This image also shows the code being structured in ways that most IDEs cannot. The nodes labeled *Imports* and *Declarations* are examples. They do not correspond to conventional subsections of a program - functions, classes, and methods. Being able to structure them in this way helps with understanding the essential parts of a program. Todo List Manager ***************** .. figure:: images/todo.png Using the Todo plugin to manage a "todo" list. Time Records ************ .. figure:: images/time-record-example.png Leo's outlining features can be used to record time spent on various tasks. This image shows one way to do this. Not shown here, but this Leo outline also contains a chronological log of activity notes, and important scripts for the project. The screen shot also illustrates a different color theme, one of many that are supplied with Leo. Color themes are also Leo outlines, so they can be edited and developed like any other feature. This image also shows a number of custom buttons that the user has added by means of a settings file. Scientific Notebook ******************* .. figure:: images/sci-notebook.png With the help of a Leo plugin, you can mix text, images, and executable code to create examples such as shown in this image. These renderings can be exported to the browser. Word Processor Draft ******************** .. figure:: images/wordproc.png A first draft of a word processing document. This draft was written with Markdown, and was later converted into a LibreOffice word processing document. The right-hand panel in the Leo window shows a rendered view of the Markdown text. The converted document will look much like this when opened in the word processor. The last node in the tree, the one labeled *@command pandoc-to-odt*, contains a simple Python script that runs the *pandoc* program (outside of Leo) to perform the conversion. A word processor document template can be applied during the conversion. The user has created a button in the Icon Bar that launches the conversion script. It is usually easier to write a draft document in Leo and later to finalize it in a word processor, than to write the entire document in the word processor from the beginning. Mind Map Of Code **************** .. figure:: images/mmap.png Here a section of some Python code is shown as a Mind Map. This image also shows another of Leo's color themes. About This Guide ++++++++++++++++ This document supplements Leo's "official" documentation at ``_