Hi all,

New plugin up on Launchpad.  Here's the docstring:

----
Provides a GUI in the Log pane (tab name 'Nodewatch') that lists node headlines. The nodes that show up in this GUI are scriptable on a per-outline basis, with @nodewatch
nodes.

By Jacob M. Peck

@nodewatch Nodes
================

This plugin leverages Leo's scripting abilities to create programmable lists of nodes to act as jumplists via a GUI panel in the Log pane. These lists are definable on a per-outline basis by using @nodewatch nodes.

A @nodewatch node must be a child of a @settings node for this plugin to use it. This is a safety feature, and will not be changed.

A @nodewatch node is a Leo script that interacts with the 'c.theNodewatchController' object, namely calling the 'add' method on it, providing it with a category name (string) and a list of vnodes (list). An example minimal @nodewatch node is as follows (first line is headline, rest is body)::

    @nodewatch Nodewatch Demo
      @language python
      categoryname = 'All @file nodes'
      nodes = []
      for vnode in c.all_unique_nodes():
          if vnode.h.startswith('@file'):
              nodes.append(vnode)
      c.theNodewatchController.add(categoryname,nodes)

If that node is a child of a @settings node, it will be run every time the 'Refresh' button in the GUI is clicked.

GUI Operation
=============

The Nodewatch GUI is fairly straightforward, consisting of 3 parts:

1. The dropdown box
2. The Refresh button
3. The item list

The dropdown box is filled with items named with the appropriate categoryname strings given to c.theNodewatchController.add(). It controls the item list below.

The item list is a list of node headlines -- those returned by the @nodewatch node whose categoryname matches the currently selected item in the dropdown box. Clicking on an item in this list will select the node in the outline.

The Refresh button reads and executes all valid @nodewatch nodes in the current outline, and updates the rest of the GUI appropriately. The 'nodewatch-update' minibuffer command is an alias for this. This is the only time the scripts are executed, so you might wish to get in the habit of clicking this button when you open the Nodewatch GUI.

Important Note
==============

This plugin allows scripts to be executed, and therefore is a security risk. Unless the '@bool nodewatch_autoexecute_scripts' setting is True, all scripts are only run via user intervention. You are advised to carefully examine any @settings->@nodewatch nodes in the outline before clicking 'Refresh', running 'nodewatch-update', or setting '@bool nodewatch_autoexecute_scripts = True'.

Additionally, this plugin does NO checks to make sure that @nodewatch scripts aren't destructive. Caveat User.

Configuration Settings
======================

This plugin is configured with the following @settings:

@bool nodewatch_autoexecute_scripts
-----------------------------------
Defaults to False. If set to True, all @settings->@nodewatch nodes in the current outline are executed when the outline loads.

Commands
========

This plugin defines only one command.

nodewatch-update
----------------
Run all @settings->@nodewatch nodes in the outline, and update the nodewatch GUI (same as clicking the refresh button in the nodewatch GUI).
----

It's really difficult to explain with text, so I recommend you give it a go yourself. Think of it as a script-able version of Ville's quicksearch.py (Nav tab).

-->Jake

--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to