This chapter discusses the plugins contained in leoPlugins.leo. These plugins are part of Leo's official distribution. Chapter 13: Writing Plugins tells how to write plugins.
The scripting plugin (mod_scripting.py) deserves special mention. This plugin lets you create script buttons in a matter of seconds. See Creating script buttons. Script buttons are extraordinarily useful. Try them, you'll be instantly hooked.
Contents
You enable or disable plugins using @enabled-plugins nodes in leoSettings files (leoSettings.leo, myLeoSettings.leo or the .leo file being loaded). See Specifying settings for full details of settings files.
The body text of the @enabled-plugins node contains a list of enabled plugins. Notes:
If the plugin has already been loaded, Leo silently ignores the request to re-enable the plugin. Leo never attempts to disable a plugin while processing enabled plugin strings. Thus, plugins enabled in an @enabled-plugins node in leoSettings.leo will be enabled regardless of the contents of any other @enabled-plugins node.
@enabled-plugins node, or the contents of the first pluginsManager.txt file encountered.
Rebinds up/down arrow keys.
Handles images in body text. Based on work by Gil Shwartz. Brent Burley provided many important insights. See: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52264
Create a context menu when right-clicking in the body pane.
Autocompletion and calltips plugin.
This plugin scans the complete outline at startup. You many enable or disable features in autocompleter.ini. This file contains two options under the [ autocompleter ] section:
useauto usecalltips
Setting either to 1 will turn on the feature. 0 means off. If there is a section called [ newlanguages ] it will read each option as a new language for autocompleter to recognize, and compile its value as a regex pattern for the autocompleter system to recognize as a calltip. This has relevance for the .ato system described below. Languages that currently have patterns:
python, java, c++, c, perl
Autocompleter looks in the plugin directory for a directory called autocompleter. If it doesn't find one it will attempt to create this directory. This directory should contain what are called .ato files ( pronounced auto ). Autocompleter will scan each .ato file that has a first part that matches a languages name. For example: python.ato autocompleter recognizes python, and will scan this file. The contents are read with the same mechanism that reads the information in the nodes, so calltip and autocompleter information is added to autocompleter's runtime database. If a new language has been added in the autocompleter.ini file then an .ato file that starts with the new languages name will be recognized and read in. Note, this language needs to be recognizable to Leo. Used correctly an .ato file is a mechanism by which a user can carry autocompletion and calltip information between .leo files/sessions.
Handle coloring for markup in doc parts and Python triple-double-quoted strings.
Important:
The currently supported markups are:
''text'' # write text in italics __text__ # write text in bold ~~<color>:text~~ # write text in the color specified by <color> (e.g. blue, grey, etc) {picture file=<filename>} # load the picture indicated by <filename> http://url # URL support: double clicking on the url will open it in the default browser. https://url # URL support: double clicking on the url will open it in the default browser.
Note 1: italics and bold markups can be nested, e.g.,:
''__text__'' # write text in italics and bold
Just remember to terminate the tags in the order they were opened.
Note 2: URLs must be terminated by a space.
By default, once the text has been markup up, the actual tags (e.g. __ for bold) are not displayed anymore. You can choose to display them selecting "Show Invisibles" from the Edit menu.
Send output from the Execute Script command to the end of the body pane.
Supports new Leo directives.
This plugin manages BibTeX files with Leo. Create a bibliographic database by putting @bibtex filename in a headline. Entries are added as nodes, with @entrytype key as the headline, and the contents of the entry in body text. The plugin will automatically insert a template for the entry in the body pane when a new entry is created (hooked to pressing enter when typing the headline text). The templates are defined in dictionary templates in the <<globals>> section, by default containing all required fields for every entry.
The file is written by double-clicking the node. Thus the following outline:
-@bibtex biblio.bib +@book key author = {A. Uthor}, year = 1999
will be written in the file 'biblio.bib' as:
@book{key, author = {A. Uthor}, year= 1999}
Strings are defined in @string nodes and they can contain multiple entries. All @string nodes are written at the start of the file. Thus the following outline:
-@bibtext biblio.bib +@string j1 = {Journal} +@article AUj1 author = {A. Uthor}, journal = j1 +@string j2 = {Journal2} j3 = {Journal3}
Will be written as:
@string{j1 = {Journal1}} @string{j2 = {Journal2}} @string{j3 = {Journal3}} @article{AUj1, author = {A. Uthor}, journal = j1}
No error checking is made on the syntax. The entries can be organized under nodes--if the headline doesn't start with '@', the headline and body text are ignored, but the child nodes are parsed as usual. BibTeX files can be imported by creating an empty node with @bibtex filename in the headline. Double-clicking it will read the file filename and parse it into a @bibtex tree. No syntax checking is made, filename is expected to be a valid BibTeX file.
This plugin is enhances the EditAttributes.py plugin. It puts a command in Outline called ConceptualSort. This will prompt you for a concept to sort by. This gives the user some more flexibility in how they want to arrange their nodes. Nodes without the attribute in question go to the bottom of the sort. The user can:
Select which attribute he wants to sort on by clicking on the Attribute box.
Select the type of sort he wants by clicking on the radio buttons:
Normal.
Reversed. Like normal but the results are reversed.
Used defined. For advanced users. The text box is where a user can type in their own python code to sort the nodes-attributes. There is no need for a def. That gets appended to the beginning of the code. It prototype looks like:
def( a, b, att ):
where a and b are nodes and att is dictionary of the nodes and the respective value of the selected attribute. There is no need to indent on the first level since indentation is added at compile time.
This plugin adds date nodes (nodes with dates as their headlines) to the current outline. Date nodes may be added one at a time, a month's-worth at a time, or a year's-worth at a time. The format of the headlines is configurable in the ini file.
Leo plugin that permits the definition of actions for double-clicking on file nodes. Double-clicking in a @file node writes out the file if changes have been made since the last save, and then runs a script on it, which is retrieved from the outline. Scripts are located in a node whose headline is FileActions. This node can be anywhere in the outline. If there is more than one such node, the first one in outline order is used. The children of that node are expected to contain a file pattern in the headline and the script to be executed in the body. The file name is matched against the patterns (which are Unix-style shell patterns), and the first matching node is selected. If the filename is a path, only the last item is matched. Execution of the scripts is similar to the Execute Script command in Leo. The main difference is that the namespace in which the scripts are run contains two elements:
File actions are implemented for @file nodes and all its variants (@file-nosent, @thin, etc.). There is also a new node type @file-ref for referring to files purely for the purpose of file actions, Leo does not do anything with or to such files.
A Leo Plugin that adds Group commands functionality. Restrictions currently apply to using Leo with a Tk front end. There are several commands in this plugin:
This plugin adds a menu item under the File->Import menu to import Cisco configuration files. The plugin will:
All created sections are alphabetically ordered.
A plugin to store Leo trees in anydbm files. Note: there isn't such a thing as an anydbm file: it's whatever the anydbm module uses. Under Outline, there is an option called Library. This will open a dialog with a list of the trees that you have saved. You can insert trees stored in the library, remove them and add trees to the library. Be aware of unicode, any characters outside of the ascii set gets turned into a ?. I found this problem in storing some trees from Edward's Leo outline. Id like it to be able to store unicode, but that may require a more specific db background, than anydbm. Also note, that your library files may not be OS independent. If your python distribution does not have the backing db on another machine, it will not be able to open your library. This should help people develop templates that they want to reuse between Leo projects. For example, Id like a template of many Java interfaces to be easily accessible.
Creates new nodes containing parameterized section references.
Autosave the Leo document every so often. The time between saves is given in seconds in autosave.ini.
This plugin allows Leo to read a complete directory's outline into a Leo's Outline. Directories are converted into headlines and files names are listed into the bodies.
Timestamp all save operations to show when they occur.
Modify the way exported outlines are displayed.
This plug-in takes any text is stored in the clipboard and creates new headlines for each line of text. The paste routine checks to make sure the line of text is not greater than 50 characters in length. If it is, the routine truncates the headline to 50 characters and pastes the entire line into the body text of that node.
If the plug-in is functioning properly, a "Paste as Headlines" option should appear in the Edit menu directly under the existing Paste option.
A plugin that helps customize pretty printing. It creates a do-nothing subclass of the default pretty printer. To customize, simply override in this file the methods of the base prettyPrinter class in leoCommands.py. You would typically want to override putNormalToken or its allies. Templates for these methods have been provided. You may, however, override any methods you like. You could even define your own class entirely, provided you implement the prettyPrintNode method.
A plugin to schedule commands for later execution. It's provides the ability to issue commands at a future time and to write messages that will be displayed at a later time. To record commands You goto Schedule and choose begin recording. Then you jump to the nodes and select the commands you want issued on them. This process is ended with the end recording option. A dialog pops up. You can then click on the individual commands and set the time for execution. To set the execution time for all, enter a value and hit set_all. All times must be in the form hh:mm. For example I want to issue a save command for 5:00 PM. I would do so by using the value 17:00. The Schedule Message is simple. There is a Text box to enter the message and a Entry to place the time. View Queue will summon a view of The Queue. This dialog will show the commands that have been enqueued. There is also the option to Cancel out any scheduled commands/messages.
This plugin puts the View Table command in the Outline menu. This command checks the current node using the csv (comma separated values) mods Sniffer. It tries to determine the format that is in the nodes data. If you had excel data in it, it should be able to determine its excel data. It then creates a dialog with the data presented as in a table for the user to see it. Requires Pmw and the tktable widget at http://sourceforge.net/projects/tktable.
This plugin lets you add customizable templates to an outline. Templates are like any other node except that the plugin replaces %s in the body text by values that you specify when using template. Templates may have section references; this plugin uses Leo's @nosent write machinery to create one string out of possibly many nodes. This plugin requires the simplified atFile write code that is new in 4.2.1.
This plugin creates two buttons in Leo's icon area:
If a template does not have a '%s' in it, then the templates plugin just adds the text as a node. Templates once marked are stored across sessions. Do not put a template in a thin file, as your template mark will be erased between sessions.
This plugin displays a message box with information about the body text of the current node such as number of: characters, words, lines, and paragraphs. It adds a "Word Count..." option to the bottom of the Edit menu that will activate the message box.
The Word Count... menu has a shortcut key of 'W'.
gtkDialogs replaces Tk's file dialogs with Gtk file chooser dialogs.
The plugin is aimed mainly at Linux users with pyGtk installed on their systems, but it should work on on any system that support Gtk2 and pyGtk.
A plugin to test import problems.
Dump Python globals at startup.
Enable debugging and tracing for Python's garbage collector.
Trace changes to Leo's objects at idle time.
Trace keystrokes in the outline and body panes.
Trace the most common hooks, but not key, drag or idle hooks.
Replaces Commands.openWithTempFilePath so Leo opens temporary files with a filename that begins with the headline text, and located in a username_Leo subdirectory of the temporary directory. The LeoTemp prefix is omitted. This makes it easier to see which temporary file is related to which outline node.
Creates an 'extensions' menu with commands to open either an xterm on Linux or a cmd windows/explorer window on win32 in the directory of the current @file node. This allows quick navigation to facilitate testing and navigating large systems with complex directories.
This plugin creates menu items in the File:Open With menu.
@openwith nodes in @settings trees create menu items. The openWith plugin must be active for these settings to have any effect.
The headline of an @openwith node has the form:
@openwith name = shortcut
name is name of the menu item. shortcut specifies the shortcut used to invoke the menu item. shortcut may be None.
The body text @openwith nodes should contain a single line contain a tuple of the form:
command,arg,ext
For example:
'subprocess.Popen',['pythonw','C:/Python24/Lib/idlelib/idle.pyw'],'.py'
When the user selects this menu item Leo executes command(arg+path) where path is the full path to the temp file. The ext argument specifies the extension of the temp file.
Notes:
command is a string. Valid values are:
'subprocess.Popen' 'os.system' 'os.startfile' 'os.spawnl' 'os.spawnv' 'exec'
arg is either a single string or a list of strings.
ext is a string or None. If None, Leo computes a file extension base on what @language directive is in effect.
If the .leo file being loaded contains @openwith nodes, the File:Open With menu contains only the items created by those nodes. Similarly, @openwith nodes in myLeoSettings.leo override entries in leoSettings.leo.
If no @openwith nodes are found anywhere the openWith plugin uses hard-coded tables in the plugin itself.
This plugin will use Python's new subprocess module if it is present. This module comes standard with Python 2.4. For Linux systems, Leo will use subprocess.py in Leo's extensions folder if necessary.
For Windows systems you can install Python's subprocess module in Python 2.2 or 2.3 as follows:
Download and execute one of the following installers, depending on your version of Python:
subprocess-0.1-20041012.win32-py2.3.exe subprocess-0.1-20041012.win32-py2.2.exe
This installer installs the subprocess sources and also _subprocess.pyd in Python's site-packages folder.
temacs is a binding module for the Tkinter Text widget. usetemacs is a Leo plugin that patches the temacs modules Emacs emulation into the standard Leo Tkinter Text editor.
A plugin that communicates with VIM:
Use commands in the Plugins:Word Export:Export menu to formats and export the selected outline to a Word document, starting Word if necessary.
This plugin allows you to edit nodes in emacs/xemacs. Depending on your preference, selecting or double-clicking a node will pass the body text of that node to emacs. You may edit the node in the emacs buffer and changes will appear in Leo.
Opens any empty file as a minimal .leo file.
Warning: the OPML plugin is not fully functional at present. Use with caution.
The OPML plugin creates two new commands that read and write Leo outlines in OPML format. The read-opml-file command creates a Leo outline from an .opml file. The write-opml-file command writes the present Leo outline to an .opml file.
Various settings control what gets written to .opml files, and in what format. As usual, you specify settings for the OPML plugin using leoSettings.leo. The settings for the OPML are found in the node:
@settings-->Plugins-->opml plugin
Here are the settings that control the format of .opml files. The default values are shown.
@bool opml_read_derived_files = True
If True, Leo reads derived files when reading .opml files.
@string opml_namespace = leo:com:leo-opml-version-1
The namespace urn for the xmlns attribute of <opml> elements. This value typically is not used, but it should refer to Leo in some way.
@bool opml_use_outline_elements = True
If True, Leo writes body text to <:body> elements nested in <outline> elements. Otherwise, Leo writes body text to :body attributes of <outline> elements.
Note: Leo-specific attributes and elements are clearly distinguished from 'standard' opml elements: they are preceded by a colon, which marks them as members of the default namespace specified specified by this option. Thus, all OPML text generated by this plugin should conform to the OPML 2.0 standard.
@string opml_version = 2.0
The opml version string written to the <OPML> element. Use 2.0 unless there is a specific reason to use 1.0.
@bool opml_write_body_text = True
If True, Leo writes body text to the OPML file.
@bool opml_write_derived_files = True
If True, Leo writes derived files when writing .opml files.
@bool opml_write_leo_details = True
If True, Leo writes the native attributes of Leo's <v> elements as attributes of the opml <outline> elements. The native attributes of <v> elements are a, descendentTnodeUnknownAttributes, expanded, marks, t, and tnodeList.
@bool opml_write_leo_globals_attributes = True
If True, Leo writes body_outline_ratio` and global_window_position attributes to the <head> element of the .opml file.
@bool opml_write_uAs = True
If True, Leo writes unknown attributes (uA's) in <:uA> sub-elements of <outline> elements.
Adds #line directives in perl and perlpod programs. Currently supports only perl and perlpod.
Multipath enables the ability to write a file to multiple locations. It acts as a post-write mechanism, a file must be written to the file system for it to work. At this point it is not a replacement for @path or an absolute path, it works in tandem with them. To use, place @multipath at the start of a line in the root node or an ancestor of the node. The format is (On Unix systems):
@multipath /machine/unit/:/machine/robot/:/machine/
It will place a copy of the written file in each of these directories.
There is an additional directive that simplifies common paths, it is called @multiprefix. By typing @multiprefix with a path following it, before a @multipath directive you set the beginning of the paths in the @multipath directive. For example:
@multiprefix /leo #@multipath /plugins
or:
@multiprefix /leo/ @multipath plugins: fungus : drain
copies a file to /leo/plugins /leo/fungus /leo/drain.
The @multiprefix stays in effect for the entire tree until reset with another @multiprefix directive. @multipath is cumulative, in that for each @multipath in an ancestor a copy of the file is created. These directives must at the beginning of the line and by themselves.
Preprocess @file-nosent nodes: make sure each subnode ends with exactly one newline, replace all tabs with spaces, and add a newline before class and functions in the derived file.
This plugin takes an outline stored in LEO and outputs it as a numbered list to an RTF file. The RTF file can be loaded into Microsoft Word and formatted as a proper outline.
If this plug-in loads properly, you should have an "Outline to Microsoft RTF" option added to your File > Export... menu in Leo.
Settings such as outputting just the headlines (vs. headlines & body text) and whether to include or ignore the contents of @file nodes are stored in the rtf_export.ini file in your Leoplugins folder.
The default export path is also stored in the INI file. By default, it's set to c:so you may need to modify it depending on your system.
This plugin takes an outline stored in LEO and converts it to html which is then either saved in a file or shown in a browser.
The outline can be represented as a bullet list, a numbered list or using html <h?> type headings. Optionally, the body text may be included in the output.
If desired, only the current node will be included in the output rather than the entire outline.
An xhtml header may be included in the output, in which case the generated html will be valid XHTML 1.0 Strict.
The plugin is fully scriptable as all its functionality is available through a Leo_to_HTML object which can be imported and used in scripts.
Several commands and menu items are provided to give easy access to the plugins various features and options may be set via leo_to_html.ini file and the plugins properties dialog.
This plugin reads and writes Leo outlines in .opml (http://en.wikipedia.org/wiki/OPML) format.
The OPML plugin creates two new commands that read and write Leo outlines in OPML format. The read-opml-file command creates a Leo outline from an .opml file. The write-opml-file command writes the present Leo outline to an .opml file.
Various settings control what gets written to .opml files, and in what format. As usual, you specify settings for the OPML plugin using leoSettings.leo. The settings for the OPML are found in the node: @settings-->Plugins-->opml plugin
Here are the settings that control the format of .opml files. The default values are shown.
@string opml_namespace = leo:com:leo-opml-version-1
The namespace urn for the xmlns attribute of <opml> elements. This value typically is not used, but it should refer to Leo in some way.
@bool opml_use_outline_elements = True
If True, Leo writes body text to <:body> elements nested in <outline> elements. Otherwise, Leo writes body text to :body attributes of <outline> elements.
@string opml_version = 2.0
The opml version string written to the <OPML> element. Use 2.0 unless there is a specific reason to use 1.0.
@bool opml_write_body_text = True
Leo writes body text to the OPML file only if this is True.
@bool opml_write_leo_details = True
If True, Leo writes the native attributes of Leo's <v> elements as attributes of the opml <outline> elements. The native attributes of <v> elements are a, descendentTnodeUnknownAttributes, expanded, marks, t, and tnodeList.
@bool opml_write_leo_globals_attributes = True
If True, Leo writes body_outline_ratio` and global_window_position attributes to the <head> element of the .opml file.
This plugin allows wxPython to be used as leo's gui instead of TK.
It is a prototype under development and so does not have all the features of Tk leo nor are there many plugins compatible with it yet.
It is mainly being developed for Linux at the moment, but attempts are being made to keep it working on Windows as well.
Work on this project has now halted in favor of a gtkLeo plugin.
This plugin puts two buttons in the icon area. The 'Save Hoist' button hoists the presently selected node and creates a button which can later rehoist the same node. The 'Dehoist' button performs one level of dehoisting.
This plugin replaces the old chapters plugin.
Automatically add nodes for common tasks.
Add Hoist/De-Hoist buttons to the toolbar.
Adds a quick search to Leo's toolbar, along with a "GO" button to do quick searches right from the main Leo window. All the current search options are retained except that "search body text" is explicitly set - mainly because this is by far the most common use case. Pressing <CR> while editing the text automatically does a search. Repeated searches can be done by clicking the "GO" button. The combo box also stores a list of previous searches, which can be selected to quickly repeat a search. When activating a previous search the original search mode is used.
Creates a 'Shortcut' button in the icon area. Pressing the Shortcut button creates another button which when pressed will select the presently selected node at the time the button was created.
This plugin supports Uniform Node Locators (UNL's). UNL's specify nodes within Leo files. UNL's are not limited to nodes within the present Leo file; you can use them to create cross-Leo-file links. This plugin consists of two parts:
UNL's referring to nodes within the present outline have the form:
headline1-->headline2-->...-->headlineN
where headline1 is the headline of a top-level node, and each successive headline is the headline of a child node. UNL's of the form:
file:<path>#headline1-->...-->headlineN
refer to a node specified in <path> For example, double clicking the following headline will take you to Chapter 8 of Leo's Users Guide:
@url file:c:/prog/leoCvs/leo/doc/leoDocs.leo#Users Guide-->Chapter 8: Customizing Leo
For example, suppose you want to email someone with comments about a Leo file. Create a comments.leo file containing @url UNL nodes. That is, headlines are @url followed by a UNL. The body text contains your comments about the nodes in the _other_ Leo file! Send the comments.leo to your friend, who can use the comments.leo file to quickly navigate to the various nodes you are talking about. As another example, you can copy UNL's into emails. The recipient can navigate to the nodes 'by hand' by following the arrows in the UNL.
Notes:
LeoN is Leo over the Network. LeoN is Collaborative Leo. This is an important project for Leo's long-term development. See leo/doc/LeoN for important research papers that form the basis of this project.
Synchronizes @folder nodes with folders. If a node is named @folder path_to_folder, the content (filenames) of the folder and the children of that node will be sync. Whenever a new file is put there, a new node will appear on top of the children list (with mark). So that I can put my description (i.e., annotation) as the content of that node. In this way, I can find any files much easier from leo. Moreover, I add another feature to allow you to group files(in leo) into children of another group. This will help when there are many files in that folder. You can logically group it in leo (or even clone it to many groups), while keep every files in a flat/single directory on your computer.
Executes commands in nodes whose body text starts with @produce. To use, put in the body text of a node:
@produce javac -verbose Test.java
To execute, you goto Outline and look at Produce. Choose Execute All Produce or Execute Tree Produce. The Tree does the current Tree, All does the whole Outline. Executing will fire javac, or whatever your using. @produce functions as a directive. After executing, a log file/node is created at the top of the Outline. Any output, even error messages, should be there. It executes in a hierarchal manner. Nodes that come before that contain @produce go first. I'm hoping that this orthogonal to @run nodes and anything like that. Its not intended as a replacement for make or Ant, but as a simple substitute when that machinery is overkill. Warning: trying to execute a non-existent command will hang Leo.
A plugin that supports @clip, @view and @strip nodes.
This plugin also accumulates the effect of all @path nodes.
The AutoTrees plugin is a helper plugin designed to make it very easy to write "handler" plugins to manage dynamic content in Leo outlines. AutoTrees provides:
AutoTrees doesn't do anything that you cannot do in other ways, but it does provide a consistent way of adding dynamic content. This means that individual plugin writers don't have to rewrite all the same kinds of code each time and also makes it easier to maintain Leo, since it standardizes the way that certain classes of plugin interact with the Leo core. Why use this? I'm a plugin writer and I want to write a plugin to display dynamic content, i.e., content not directly contained in the .leo or derived files, e.g.,
You can do this as a standard plugin, but as an AutoTrees handler you,
This plugin allows the user to import binary data and store it in Leo as a base64 string. This plugin adds Import base64 and Export base64 commands to the Import menu and adds the 'View base64' command to the outline menu. The Import base64 command creates a new node with the headline:
@base64 <filename>
The body of this node will kill the colorizer, add some info on the original file and create a section reference to the payload node, which contains the data. The Export base64 command asks for a location to place the file. The plugin checks that the structure of the base64 node is what it expected, basically what an import operation creates. If Ok, it will write the file to the selected directory. The View base64 command brings up a Pmw Dialog that displays the data as a PhotoImage. This currently only supports formats recognized by the PhotoImage class. This would be the .gif format. This functionality may be enhanced in the future by PIL to support more image types. Depending on the size of the image, you may have to scroll around to see it. For example, a leo clone icon will require scrolling to find. Id like to change this in the future.
A Leo plugin that adds quick utility commands through a pop-up menu. To summon Menu, type control-space. To unsummon, Right Click.
1. Movement. If a node has ancestors,siblings or children a menu option will appear offering the user the ability to jump to the node from the current node. This is an improvement over moving one node at a time with the keyboard commands.
2. Inserting text. These menus offer the current language keywords, the directives the body recognizes and any @file type headline directives. It offers the new user easy access to the different directives and ways to write a file.
3. Moving Nodes(experimental). You can quickly move a node to its parent's parent or after a sibling, if they exist.
This plugin allows you to associate information with nodes. This information is organized around "labels", which is are just strings and freely chosen by the user. The plugin allows you to create such a label quickly for each marked node, and to mark all nodes which have a certain label. Labels can be converted to subnodes, and vice versa. This facility allows you to add additional information for each label. You can create clones for each node which has a label. These clones are created as children of the current node. This last facility can be used to create clones for each node which has been found or changed by the standard search/replace dialog:
Finally, if you read a derived file, and the content of a node changes, the previous content is available under the label "before change:"
A plugin to create and update @read-only nodes. I wanted to have the ability to import files in "read-only" mode, that is, in a mode where files could only be read by leo (not tangled), and also kept in sync with the content on the drive. The reason for this is for example that I have external programs that generate resource files. I want these files to be part of a leo outline, but I don't want leo to tangle or in any way modify them. At the same time, I want them to be up-to-date in the leo outline. This plugin has the following characteristics:
The syntax to access files in @read-only via ftp/http is the following:
@read-only http://www.ietf.org/rfc/rfc0791.txt @read-only ftp://ftp.someserver.org/filepath
If FTP authentication (username/password) is required, it can be specified as follows:
@read-only ftp://username:password@ftp.someserver.org/filepath
Runs a program and interface Leo through its input/output/error streams. Double clicking the icon box whose headlines are @run 'cmd args' will execute the command. There are several other features, including @arg and @input nodes.
The run_nodes.py plugin introduce two new nodes that transform leo into a terminal. It was mostly intended to run compilers and debuggers while having the possibility to send messages to the program.
Double clicking on the icon of an node whose headline is:
@run <command> <args>
will launch <command> with the given arguments. It will also mark the node. # Terminates the argument list. @run # <comment> is also valid.
This plugin supports slideshows in Leo outlines.
It defines four new commands:
Slides shows consist of a root @slideshow node with descendant @slide nodes. @slide nodes may be organized via non-@slide nodes that do not appear in the slideshow.
All these commands ignore @ignore trees.
Launches (starts) a file given by a headline when double-clicking the icon. Ignores headlines starting with an '@'. Uses the @folder path if the headline is under an @folder headline. Otherwise the path is relative to the Leo file.
A plugin to create script buttons and @button, @plugin and @script nodes. This plugin puts two buttons in the icon area: a button called run Script and a button called script Button. The run Script button is simply another way of doing the Execute Script command: it executes the selected text of the presently selected node, or the entire text if no text is selected. The 'script Button' button creates another button in the icon area every time you push it. The name of the button is the headline of the presently selected node. Hitting this _new_ button executes the button's script.
For example, to run a script on any part of an outline do the following:
That's all. You can delete a script button by right-clicking on it. This plugin optionally scans for @button nodes, @plugin nodes and @script nodes whenever a .leo file is opened.
Such nodes may be security risks. This plugin scans for such nodes only if the corresponding atButtonNodes, atPluginNodes, and atScriptNodes constants are set to True in this plugin.
A minimal http plugin for LEO, based on AsyncHttpServer.py. Use this plugin is as follows:
Start Leo with the plugin enabled. You will see a purple message that says something like:
http serving enabled on port 8080, version 0.91
Start a web browser, and enter the following url: http://localhost:8080/ You will see a a "top" level page containing one link for every open .leo file. Start clicking :-)
You can use the browser's refresh button to update the top-level view in the browser after you have opened or closed files.
To enable this plugin put this into your file:
@settings @bool http_active = True @int port = 8080 @string rst_http_attributename = 'rst_http_attribute'
The shadow plugin allows you to use Leo with files which contain no Leo comments, and still have information flow in both directions: from the file into Leo, and from Leo into the file.
To use this plugin:
Install the shadow script button found in leoPy.leo in the node:
Code-->Buttons and settings-->@@button shadow
That is, copy and paste this @button node to your Leo outline, and change @@button to @button.
Position the cursor somewhere in your tree.
Clicking the shadow button will create a shadow file for all @thin nodes in the selected outline.
After this initial setup, changes in Leo will be reflected both in the file in the Leo subfolder, and the file without sentinels. Conversely, changes in the file without sentinels will flow back to the file in the leo subfolder, and show up in Leo. Text insertions within a node will show up as expected. Text insertion at the end of the node will show up and the end of the node. Note that the plugin never structures input; this has to be done manually within Leo.
You can set settings for this plugin in leoSettings.leo at:
@settings-->Plugins-->shadow plugin.
aspell.pyx: Leo's new spell checking plugin that uses aspell.exe. It is much faster than the old mod_spelling plugin, but requires Python 2.3 or above and a recent version of Aspell. When properly installed and enabled, this plugin adds a Check Spelling command to Leo's Edit menu. This command brings up a spell checking dialog. You can set options by changing entries in spellpyx.ini in Leo's plugins menu. One of these settings is the name of the dictionary, spellpyx.txt by default. Warning: do not create spellpyx.txt with an @asis tree in leoPlugins.leo: only the plugin code should typically change spellpyx.txt. You can edit spellpyx.txt yourself in an external editor: just make sure that Leo isn't running when you do this. You can bring up the spell checker without enabling the spellpyx plugin by using an @button Check Spelling... script button. LeoDocs.leo contains such a script button.
Leo2AsciiDoc is a small Python program which has been built to be used as a plugin module for the Leo outlining editor. For more information see: http://www.marshallresearch.com/michael-dawson/os/leo.html I am still using Leo version 4.1 (rc3, build 1.62), as I've been unable to keep up with the speed of Edward's Leo development. He has made such significant changes to Leo since 4.1 that I doubt that Leo2AsciiDoc will work with any version later than 4.1. I do intend to rewrite Leo2AsciiDoc for the new Leo, but there is no schedule set.
Leo2AscDoc enables the contents of plain text Leo outlines to be published to HTML or PDF via the AsciiDoc program and the DocBook set of publishing tools. Plain text from the Leo outline can be transformed into a final result that has typeset body text, in which bulleted and numbered lists, variable lists, page numbers, URLs, index terms,and bold and italic text are automatically recognized. typeset Headings a Table of Contents an Index containing any items marked by the user, and any Python classes or functions. To produce HTML and PDF, you'll need to have the AsciiDoc program installed (a trivial task) and a DocBook tool chain installed, which is not a trivial task. And, of course, Python and Leo. In sum, this little program is an easy install for people who are already using Leo and DocBook. As noted later, Leo2AsciiDoc has only been tested on Linux
The rst3 plugin creates output files from Leo outlines containing rST (reStructuredText) markup. rst3 options control most aspects of this plugin's operations. You can set options in @settings trees, in headlines and in body text. There are too many options to describe here. See: http://webpages.charter.net/edreamleo/rstplugin3.html for full documentation. To use this plugin effectively, Python's docutils module must be installed. The rst3 plugin will use the SilverCity syntax coloring package if it installed.
The rst3 plugin adds the Write Restructured Text command to Leo's Edit menu. This command searches the selected outline looking for rst root nodes whose headline have the form:
@rst <filename>
The plugin then creates the named file in various ways depending which rst3 options are in effect. By default, the rst3 plugin creates rST headings automatically from outlines, so the higher-level nodes in the outline correspond to higher-level sections in the output. Creating rST headings automatically eliminates one of the most tedious chores associated with rST markup. This plugin sends .htm, .html or .tex files to the docutils module for further processing. Docutils generates HTML files or LaTeX files depending on the file's extension. HTML files generated by docutils refer to three .css (cascading style sheet) files that should exist in the same directory as the generated HTML file. You can control the formatting of the HTML file by altering these .css files.
For full details on this plugin, see http://webpages.charter.net/edreamleo/rstplugin3.html
A new method has been added to the rst3 plugin to make it more easily to drive the plugin from scripts:
def writeNodeToString (self,p=None,ext=None)
writeNodeToString scans p's tree (p defaults to presently selected node) looking for @rst nodes. When the first @rst node is found, writeNodeToString processes the node as usual, with the following changes:
Scripts can easily use writeNodeToString to convert @rst trees into various kinds of output. For example, here is the body of @button rst->html in LeoDocs.leo:
import leoPlugins rst3 = leoPlugins.getPluginModule('rst3') if rst3: controller = rst3.controllers.get(c) if controller: p,s = controller.writeNodeToString(ext='.html') print '*' * 40,p print s
Notes:
Adds XSLT-Node Command submenu item to the Outline menu. This menu contains the following items:
Requires 4Suite 1.0a3 or better, downloadable from http://4Suite.org.
Cleo allows you to annotate or colour leo outlines based on priority, code archetype, node types or some arbitrary criteria. The annotations and colour coding can play a similar role like that of syntax highlighting. Right-click on the icon area to popup its menu to play with it.
A plugin to leave footprints! This colors the Leo nodes so that the ones you have visited most and most recently will stand out.
A plugin that lets the user to associate text with a specific node. Summon it by pressing button-2 or button-3 on an icon Box in the outline. This will create an attribute editor where the user can add, remove and edit attributes. Since attributes use the underlying tnode, clones will share the attributes of one another.
Maximizes all new windows.
The nodebar plugin adds buttons at the bottom of the tree canvas. The buttons correspond to commands found in the Outline commands. It is intended to speed up a new users ability to use the outline. Experienced users may find value in being able to quickly execute commands they do not use very often.
Send all output to the log pane.
Turns the log into a tabbed component. Other plugins may add tabs. To get a new tab in TabbedLog:
import TabbedLog pane = TabbedLog.getPane(name,c)
A plugin for searching unknownAttributes (uA's).
A plugin that enables the user to scroll down with a left mouse click and hold, and to scroll up with a right mouse click and hold. Scrolling continues until the user releases the mouse. Originally designed as a workaround for various bugs in Tkinter scrolling, this may actually be superior to wheel scrolling, in that there is little work a user has to do to scroll except to press a button.
This plugin uses Python's urllib module to download files and import them into Leo. It requires the TabbedLog plugin.