accept xml instead of plain Python text?

Edward K. Ream edreamleo at charter.net
Mon Apr 12 20:53:56 EDT 2004


> 1. What advantage would you get?

Lately there has been discussion in Leo's forums about various different
ways of having Leo represent structure in source files.  At present Leo uses
so-called "sentinel" lines, comment lines of the form #@<data>.  An xml
format would make embedding structure very easy.  OTOH, xml is less readable
than sentinels, and some of Leo's users (or their managers) dislike
sentinels, so arguably xml is a step backwards.

As an alternative, there have been some proposals to separate structure from
content in two separate files.  The idea is to script cvs so that the two
files (the content and the structure) are always committed and updated in
synch.  All this is blue-sky musing at present.

> 2. How exactly should the XML look like?

A good question.  One thing I didn't say in my original post was that I
envision one would have all sorts of problems deciding on what pythonMl (or
leoPyMl) would be.  The situation is a similar to the discussions about
document formats.  I suppose one could propose an extensible format: the
Python compiler would ignore the extensions...

> The simplest approach I can think of is...

This might sometimes be useful because one could add "annotation" attributes
to the <python> element.  Like <python "font=">  (or use a style sheet).
However, Leo would probably need more complicated markup, and naturally that
isn't a general approach.

In short, I agree with you, Martin; my first and second responses to this
idea are "reserved".  Thanks for taking the time to reply :-)

Edward
--------------------------------------------------------------------
Edward K. Ream   email:  edreamleo at charter.net
Leo: Literate Editor with Outlines
Leo: http://webpages.charter.net/edreamleo/front.html
--------------------------------------------------------------------





More information about the Python-list mailing list