Hierarchical Styling
[RU]

Hierarchical Styling

Separating content from formatting has long since become a common rule of decency in all kinds of publishing systems, from electronic books to Web design. It seems quite logical that content providers supply any piece of information using automation tools suited for their occupation, without much bothering about the logic of distribution; this information is then accumulated in an appropriate electronic store, and as soon as there is something to present, professional designers work on the publication details, arranging everything in the best way possible to attract the widest audience.

Obviously, this logic assumes a quite definite economic organization based on the universal division of labor. Indeed, in such an economy, professional design often looks an order of magnitude nicer than any amateur formatting. And, of course, any formatting considerations should not influence, say, the very formulation of a legal statement, or a mathematical theorem. However, in reality, it is not as simple as that.

When composing a text, electronic or not, the author (implicitly or deliberately) assumes a special way of reading. In accordance with that view, the author tries to organize the text to emphasize its organization, simplify navigation and search, and focus the reader's attention on the key sentences. It is well known that a short paragraph is much easier to read, a simply structured sentence is usually clearer, and one-column layout is simpler to navigate. If the original text layout is changed at publication, this will most probably result in a different perception. For instance, fewer paragraphs are certainly better to pack more text in a limited volume; however, merging paragraphs on the editor's demand will destroy the inner logic of the text, since each paragraph conveys a relatively closed system of thoughts (in this sense, it can be considered as an analog of a block in programming).

To make things worse, there are texts where formatting is an essential part of content. Thus, most legal texts include multilevel enumeration; if the style of enumeration is changed, this will invalidate the document. Similarly, the formatting of a poem is often utterly important to convey its intonation and sense. A slightest change in the layout, punctuation or wording would kill the original. Even the apparently innocent replacement of the long m-dash with the shorter n-dash (that many editors tend to make without a slightest hesitation) can result in a different perception flow, and a spoiled impression. Yes, any formatting is flexible, to a certain degree, but the width of the zone of admissible variations is very individual, and even variations within the zone are not neutral; they are perceived as the different hues of the same basic intonation conveying the underlying motives. []

However, in the multimedia world of today, there is an objective need of unification, allowing the same document to be presented in all kinds of environment, with an appropriate adjustment of the original format. Since different media cannot be entirely compatible, any transfer from one environment to another will inevitably introduce formal changes beyond the author's intention. There is no such thing as a perfect translation. Still, people speak in many tongues, and computers output data to different peripherals; one way or another, we have to live with it. We replace original paintings with their reproductions and photographs, live voice with digital records, and handwriting with keyboard input. Such transformations are quite like literary translation, assuming a hierarchy of resemblance, the different representations of the same. The quality of translation cannot be numerically evaluated; it depends on not only the skill and taste of interpreter, but also the purpose and motive. Yes, one can always tell a good translation from a poor one; but this has nothing to do with exactitude. The art of publishing is the art of considerate interpretation.

Now, let us descend from the artistic heights to computer technologies. Is it possible to have some control over the presentation issues without distracting the author too much from the content? Can we draw the line between formatting and content in a flexible way adjustable to the specific requirements of the text?

Modern publishing software (including text, graphic, audio and video processors) equips the author with numerous formatting tools, either chosen from a preset configuration, or added as third-party extensions. With just a little training, everybody can learn to produce a tolerable layout, at least as the basis for further transformations. There is an industry of conversion filters designed to transform the document to multiple formats preserving its look wherever possible. One could believe that the rapid technological progress will solve the problem soon, if not yet. There is hope; but there are also serious doubts.

HTML authoring is probably the most common example. The potential customers are told that, with high-end software, they would be able to build a Web site from scratch without knowing a bit about HTML, CSS, JavaScript and other swear words... But did you ever compare a Web page produced by, say, the MS Office HTML converter (FrontPage) with the same page manually formatted in HTML? The latter is several times smaller, much more readable, and usually interpretable by a much wider range of browsers. I have nothing personal against Microsoft; all the others are no better. The general trend is to put as much formatting as possible in style sheets and script, saturating the text with references to the degree of absolute incomprehensibility. This is the price one has to pay for uniformity and power.

But what if I do not want all that complexity in my Web pages? Admit that all I need is to produce a formatted text that would look approximately the same in all kinds of browsers, possibly ignoring any style definitions, under a variety of operating systems, with a limited font set installed. Further, I want just a little flexibility, to be able to add a couple of "advanced" features wherever I cannot do without them. Thus, I want those who do not like frames to have my pages without frames, and leave frames for those who are annoyed by persistent scrolling out of navigation. I want to be able to insert pictures and possibly some other objects without violating the basic text structure and overall readability. To summarize, I want my documents to be simple and adaptable to any environment, without too much self-restriction. Is that too much?

It seems like the answer is "yes". Backward compatibility is no longer among the concerns of software and hardware developers. New browsers do not understand old protocols; to achieve compatibility you have to produce different HTML for each target browser, and you can never be sure that your pages won't become a complete mess after the next "improvement" of the Internet protocols and browsers. Today, the users are forced to install the newest versions of software, which often requires a newer operating system, which cannot work with outdated equipment, and so on, without end. Even if I scanned my texts and displayed them as mere pictures, the evolution of graphic formats would eventually make them unreadable.

Well, there are script libraries and middleware that automatically resolve the compatibility issues, to some extent. Of course, they contain a lot of junk I'll never need, but, with fast optical Internet at every home, one will no longer care for the file size. Anyway, for a Web page packed with graphics, sound and video, an extra megabyte of pure text is a minor correction to the total download. On the other hand, the Web gets obsessed by dynamic content generation, and an honest static page is becoming absolutely out of place. Today, even the plain text pages are dynamically composed on the fly, just to maintain uniform styling. Modern HTML contains very little HTML, it is mostly script. This makes design cumbrous and clumsy, eats up the local resources and connection bandwidth, leads to incidental hang-ups due to the conflicts with other active processes. But, again, all that is to go away with the next generation technologies, and we always want to be a bit ahead of the time... But when the next generation technologies come indeed, they are already obsolete, as the new level of required complexity is above their capacities. This like Russian construction projects: they build something all the time, but one can never get anything built.

So far, I have not seen a single publishing (or Web authoring) system that would automate even the common presentation tasks to any satisfactory degree, nothing to tell about any special look. Somehow, my needs are always at daggers drawn with the implemented standards. Yes, the world does not need to listen to any old moron; but as long as it holds me here, I am free to talk to myself.

Ideally, the author would only need to give hints as to which part of formatting is essential, and leave the rest to the publishing system. The publishing system would have all kinds of filters to produce quality output for any media on the fly. Incidental tags (yes, I do like those good old <i>'s and <b>'s and think that their abandonment would be a disaster!) and private styles are an obviously indication of essential formatting. For instance, if I put a phrase in bold or italic, it must remain bold or italic in print, and I don't care if anybody considers that style of styling as deprecated. Why should I agree with somebody's idiotic opinion that HTML tables are any worse for formatting than a chaos of styled <div>'s of which you can never tell how it will really look like? If I use multiple spaces to create offsets, the space width must be adjusted to keep the layout intact. In fact, I need different kinds of spaces and hyphens to control line breaks and alignment, and I badly need a simple markup for consistently placing the images (the part especially difficult in HTML, however stylish). Of course, if I choose to define my own styles, this choice must be respected; this assumes the possibility of built-in fonts and custom style handlers.

This is not exactly like separating formatting from content. The problem is to adapt the level of separation to the user needs. In general, the formatting features are to be hierarchically organized within a single document, from very basic and obligatory to optional fine-tuning. The interpreter of the text (a conversion program or a human designer) will attempt to start with the complete styling, moving up one level if lower-level conversion fails. In this way, the author will have more control over the variety of translations, as long as the original content is to be preserved.

The idea of a hierarchical formatting is implicitly present in most text processors, to one degree or another. For instance, this was the basic idea behind TeX; however, the existing implementations do not pay any attention to that aspect of design, and just like in HTML authoring, we are haunted by the incompatibility of different versions, brands or templates. All attempts to develop a unified document model are bound to fail unless we abandon the very thought of a universal tree-like structure in favor of dynamic (or content oriented) structuring. This reminds the logic of the popular compression algorithms that use the statistical and structural properties of the document to reduce the file size. Similarly, the document model is normally to be derived from the document's content rather than from general considerations based on somebody's limited experience and personal preferences, and hence incompatible with the needs of other groups. Any flexibility assumes a shift from special rules to general principles, allowing for all kinds of rules, configurable on demand. Such a hierarchical refoldability is a must for any effective publishing solution.


[Computers] [Science] [Unism]