46 |
to emphasize some text, you'd make a link to it saying, |
to emphasize some text, you'd make a link to it saying, |
47 |
"Emphasize this!" |
"Emphasize this!" |
48 |
|
|
49 |
This is indeed an interesting idea (I suppose Tuomas has it |
This is indeed an interesting idea. The two main runners for |
|
from Ted's Literary Machines book). The two main runners for |
|
50 |
how to implement styled text seem to be: |
how to implement styled text seem to be: |
51 |
|
|
52 |
- the Xu one: using external links; |
- the Xu one: using external links; |
55 |
The Xu way of doing this would, for example, allow us to say |
The Xu way of doing this would, for example, allow us to say |
56 |
"This should be emphasized!" in one transclusion, and have |
"This should be emphasized!" in one transclusion, and have |
57 |
the emphasis appear in another transclusion as well. |
the emphasis appear in another transclusion as well. |
58 |
|
If I have transcluded a sentence in three places, and I decide |
59 |
However, there are two major problems with this exciting idea. |
that it flows better when one word is emphasised, it would |
60 |
The first I discovered was: What if you have the same characters |
be cool if emphasizing it in one copy would automatically |
61 |
in two different contexts? This can happen even in the same |
emphasize it in the other copies. |
62 |
document: the same text can appear in a header and somewhere |
|
63 |
in the body, possibly in a reference to the header |
However, this is not how Xu handles this, for a simple reason: |
64 |
or something. It would be impossible to decide whether the |
Formatting properties must be versioned. |
65 |
characters should be linked as "header" or not. Also, if we |
It must be easy, for example, to emphasize |
|
quote some text from another document, it is common practice |
|
|
to add an own emphasis-- we wouldn't want our own emphasis |
|
|
to appear in the original document, nor would we necessarily |
|
|
want it to appear in *our* document when we give the original |
|
|
quote a second time. We might want to give the quote first, |
|
|
then analyze it, emphasizing different parts of it each time. |
|
|
|
|
|
The second major problem is versioning. Formatting properties |
|
|
must be versioned; it must be easy, for example, to emphasize |
|
66 |
a piece of a document, then go back to the old, non-emphasized |
a piece of a document, then go back to the old, non-emphasized |
67 |
version, then view the two side-by-side; it would be absolutely |
version, then view the two side-by-side; it would be absolutely |
68 |
unexpected to have the emphasis appear in the older version, |
unexpected to have the emphasis appear in the older version, |
71 |
in two different cells on the screen, for example in Ted's |
in two different cells on the screen, for example in Ted's |
72 |
real cut-and-paste system. |
real cut-and-paste system. |
73 |
|
|
74 |
If we store formatting properties as xu links, in order for |
The intent in Xanadu was to handle this by only interpreting |
75 |
the formatting to work as expected in these cases, we'd need |
the links in the same document: In Xanadu, a document would |
76 |
to specify *which* format links should apply to each instance |
contain some text and a set of links, and only the formatting |
77 |
of a piece of text. We'd have to list, "this link applies, |
links in the same document would be applied to the text. |
78 |
and this one, and this." That way, we could avoid that |
This solves the problem above, but it also makes the excitement |
79 |
applying a format to one version automatically re-formats |
go away for me: different transclusions of a sentence would |
80 |
another version which was not intended to be re-formatted. |
be in different documents, so formatting one of them would not |
81 |
|
automatically format the others. |
82 |
(I suppose the Xu project did this by simply only respecting |
|
83 |
formatting links stored in the same document; this works |
Now, this is a revealing similarity to the *order* of characters-- |
84 |
because in Xu, links are in a document context. Updated |
the vstream. If I have the same sentence in different contexts, |
85 |
versions of a document would have updated formatting links. |
sometimes I would like changes (inserting a character, swapping |
86 |
This, too, has the effects explained in the next paragraph.) |
two words) to appear in all instances, but in other cases I don't. |
87 |
|
This is exactly the same as with the |
|
However, this means the whole concept loses the property |
|
|
I really like about it: I can *not* apply emphasis in one copy |
|
|
and automatically have it appear in another copy, where |
|
|
I'd need it, too. It doesn't work because the computer cannot |
|
|
decide which copies the format should be applied to, |
|
|
and which not. |
|
|
|
|
|
Now, this is a revealing similarity to the *order* of characters-- |
|
|
the vstream. In many cases, when I have two copies of the same |
|
|
text, and I change something in one copy-- insert a character, |
|
|
swap two words-- I would like this change to appear in the other |
|
|
copy, too. However, in other cases-- especially when comparing |
|
|
different versions/possibilities, I do *not* want the other |
|
|
version to change. (In zzstructure, if I do want both versions |
|
|
to change, I represent the transclusion using a clone, not the |
|
|
xanalogical mechanism.) This is exactly the same as with the |
|
88 |
formatting properties: the computer can't decide the problem, |
formatting properties: the computer can't decide the problem, |
89 |
so even though it might be convenient if it could do it right, |
so even though it might be convenient if it could do it right, |
90 |
we don't make an attempt that could only do it wrongly. |
we don't make an attempt that could only do it wrongly. |
91 |
|
(In zzstructure, we can use clones if we want all transclusions |
92 |
|
to change when one changes.) |
93 |
|
|
94 |
|
Additionally, it is possible that we want to have the |
95 |
|
same characters twice in the same document (in Gzz: cell), with |
96 |
|
different formatting properties. For example, we might give |
97 |
|
a quote from another document verbatim, then quote it again |
98 |
|
several times while analyzing it in-depth, |
99 |
|
emphasizing different parts of it each time. |
100 |
|
In the Xu model, this simply doesn't work, since we cannot |
101 |
|
specify in the link which transclusion of the quote should |
102 |
|
be formatted how-- if we emphasize a word in one of the |
103 |
|
transclusions, it'll be formatted in all others as well. |
104 |
|
|
105 |
|
I think this is a good argument for choosing the "boring" way, |
106 |
|
above: Implementing formatting in the enfilade. |
107 |
|
|
108 |
|
|
109 |
|
Proposal |
110 |
|
======== |
111 |
|
|
112 |
I think this is a good argument for taking the "boring" way, |
Conceptually, |
|
above: Implementing formatting in the enfilade. Conceptually, |
|
113 |
an enfilade object is simply a list of spans (or, if you prefer, |
an enfilade object is simply a list of spans (or, if you prefer, |
114 |
characters); a "formatted enfilade object" will conceptually |
characters); a "formatted enfilade object" will conceptually |
115 |
be a list of spans each of which has zero or more "styles" |
be a list of spans each of which has zero or more "styles" |