> We could store the raw data in binary files and have C programs > access the data with a standard interface.
You want the primary abstraction (layer 0, let's say) to be very similar to the existing "pure text". Any mark-up becomes a pointer to an object in a different layer which conveys additional attributes. It may be sensible to assign the layers as "classes" so that objects in a particular layer have common properties. Defining additional layers provides for new classes, together with the methods that apply to them. I'm not sure how you'd recognise mark-up markers, but it will hopefully be a single in-band escape. Or maybe there is a better way, I know Doug Gwyn makes a good case for avoding in-band signalling... But I seriously think I'm getting into this deeper than I am competent to. I'd like to point out, though, that the P9 synthetic filesystem is a preferable abstraction to a specialised library and in this particular instance, I would present a complex, marked-up document specifically as a collection of files in such a synthetic filesystem. ++L