On Fri, May 1, 2009 at 1:29 PM, Edward K. Ream <edream...@gmail.com> wrote:

>
> Rev 1775 contains a start on the grand rst round-tripping project.
> This "start" serves mostly to show the problems that remain.


After a short break, it seems that most of the problems can be resolved
fairly easily.  In this "reply" I'd like to lay out the big picture.  This
should clarify matters.  We can fix details later.

1. Leo's write commands should "understand" @rst trees.  Writing a .leo file
will write all dirty @rst trees, just as it writes all dirty @thin trees,
etc.  This should be a very nice feature.

This implies that the rst3 plugin should become part of Leo's core.  That's
easy to do.  This is important because we can then use all aspects of the
rst3 plugin in our round-tripping design.

2. The rst importer should remove explicit underlining.  It must do this to
be compatible with the rst3 plugin, and we want this anyway.

3. The rst3 plugin *already* gives us the way to "remember" underlining,
namely the underline_characters setting.  Assuming that importing an rST
file creates an @rst tree, we need only put::

    @ @rst-settings
    underline_characters = list-of-underlining-characters

in the top-level @rst node.  I'm not sure whether this kind of setting would
get written back to the file, but we can always hack some solution if need
be.

It is easy to compute list-of-underlining-characters.  The importer appends
the underlining character for the newly-discovered section if that
underlining character does not already exist in the list.

4. We can imagine anomalous situations in which indentation in the original
file does not correspond to the underlining characters.  Perhaps, as Ville
implies, we can simply ignore extra indentation in the original file.  In
any case, this can not be a show stopper.

In short, making the rst3 plugin available to Leo's write code is likely to
solve just about all remaining problems with round-tripping.

Edward

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to leo-editor@googlegroups.com
To unsubscribe from this group, send email to 
leo-editor+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to