On Sat, 26 Jul 2014 08:32:10 -0700 (PDT)
"Edward K. Ream" <edream...@gmail.com> wrote:

> By analogy with the plugin importers in leo/plugins/importers, Leo
> will soon support plugin write code in leo/plugins/writers.

This all looks very good.

readme.txt and howto.txt -> README.txt and HOWTO.txt would move them
helpfully to the start of the directory listing.

The code should probably search ~/.leo/plugins/importers and
~/.leo/plugins/writers as well, if it doesn't already.

The writers seem good, i.e. the simplest thing that could possibly
work (TM) :-)

leo/plugins/importers/basecanner.py isn't in the repo. at the moment,
which makes it hard to evaluate ;-) but I will anyway :-)

It looks like it's defining a set of variables (ivars) which define how
to import something.  In addition to that, I think there should be an
altnerative level in the API where the signature is something like:
    

def build_tree(root, filename):
    """build_tree - Import the structured data in ``filename`` to a tree
    starting in node ``root``, which will be called `@auto-??? filename`.

    Raises LeoImporterFail Exception if it fails, returns nothing.

    :Parameters:
    - `root`: vnode root of tree
    - `filename`: filename (full path)  containing structured data.  
    
    Note: some data is stored in multiple files (foo.par, foo.xll) so
    passing the path to the "core" file rather than a file object makes
    it easier for the delegate code to calculate additional paths and
    access additional data.
    """

    <|code|>


Two languages which seem like they'd be easier to handle this was are
LaTeX and ctext.  ctext is a language I just made up but I'm excited to
use :-) it's only structural element is a comment line

### Node name #######################################################

where the comment is always 75 chars long, and indentation level
is indicated by the number of # at the start, three being an
indentation level of zero.  This would be great for writing R and SQL
scripts which are essentially long lists of steps, but being able to
manage them better in Leo, and still share them with others without
weird sentinels.

LaTeX of course uses [[[sub]sub]sub]section to indicate structure.

Also, while I suspect no one but me uses it, xml_edit.py can actually
round trip data between XML and a Leo outline in a highly structured
manner, and it would be very nice to hook it up to @auto-xml instead of
having to manually use its import and export commands.

Maybe it's just lack of familiarity on my part, but "use python" seems
to be an easier way to write an importer in these cases than setting up
the base_scanner ivars.

Anyway, it think the new @auto-??? importer/writer selection approach
is going to be great for letting Leo quickly adapt to specific use
cases, perhaps leading to situations where people will be saying "the
easiest way to edit these ??? files is to install Leo and use its
@auto-??? mode".

Cheers -Terry

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to