Eric Sosman said:
It seems to me that the heading doesn't belong in the same
List as the remaining entries: It has special significance and
gets special handling. "I'm at position zero, so..." doesn't
stand out as a robust signifier of the heading's specialness,
The previous version of that mark-up language indeed had this:
< &text heading = [This is an example heading]
[This is the first paragraph of the body.]
[This is the last paragraph of the body.] >
But I wanted to reduced notational clutter.
(The »&text« element type was not shown in my previous
post in order to simplify things a bit.)
and you might want to consider whether to manifest it in other
ways. For example, suppose you decide to introduce the notion
of sub-headings: You'll now need three treatments, but "I'm at
zero" can only divide one of them from the other two. Or maybe
you'd like to generate an index of all the section headings: In
a List of nothing but headings, "I'm at zero" is not special.
A subheading could be written as follows
< &text < &text [This is the main heading]
[This is the sub heading] >
[This is the first paragraph of the body.]
[This is the last paragraph of the body.] >
Above, the heading of the outer text (the first two lines)
is structured as a text itself.
But there ought to be something more significant than "I'm
at position zero" to trigger the special handling. Just sayin'.
The new text notation is based on the observation that a
text often expresses a binary relation between two subtexts.
A heading and its body is just one example. Another example
would be the relation between a word and its translation in
a bilingual dictionary. Since this appears so often, I decided
to make the interpretation of the first entry as one part
of this binary relation the default.
A list of dictionary entries in the old mark-up style would
look like:
< &text heading = [English-Italian dictionary]
< &translation from=[As I understand it] to=[Per come ho capito] >
< &translation from=[Also known as] to=[Conosciuto anche come] >>
The new mark-up style omits »heading«, »from« and »to«:
< &text [English-Italian dictionary]
< &translation [As I understand it] [Per come ho capito] >
< &translation [Also known as] [Conosciuto anche come] >>
A possible future extension could use »list« to write the
type of all subelements once in an element without the need
to repeat it for every subelement:
< &text list=translation
[English-Italian dictionary]
< [As I understand it] [Per come ho capito] >
< [Also known as] [Conosciuto anche come] >>
Now, in the first line, the type »text« implies that the
first entry (appearing in the second line) is a heading and
»list=translation« that the pairs are translations, while
the rest of the lines has very little notational clutter,
so it is easier to read and edit even in the source code.