Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Dr J R Stockton
October 24, 2011, 5:55 pm
rate this thread
Prompted by part of, but not belong in, the thread starting with "Markup
inside TD" :
Once upon a time, effectively before Windows and GUIs were known, I used
a word processor with cross-referencing; that would be a nice feature to
have in HTML. I cannot recall its grammar; but it could gave been that
$ra<number>; would cause the printing of the next Number in sequence
'a', and, anywhere in the document, each $ca<number>; would cause the
printing of the Number printed by $ra<number> for the same <number>.
There, Number != number; and perhaps <number> was <identifier>.
One use would be to write an Ordered List with $r and to refer to its
elements with $c, so enabling the insertion of a new numbered item
without breaking existing number-links.
Another would be to generate links into a numbered list of references;
another to number equations, figures, etc.
ISTR writing a TECO macro to renumber the $r <number>s in numerical
order, altering the $c numbers accordingly; it was useful for the author
to see the <number>s in the source matching the Numbers in a printout.
The WP also had a convenient character %e. In printing, it was treated
throughout as being a normal space, until the last moment when every $e
in a line would expand by (nominally) the same amount to make the line
reach the right-hand containing margin - essentially justification of a
single line, but treating its genuine spaces the same as letters. E.g.
$e words - right-justified words
$e words $e - centred words
Number $e equation $e - numbered centred equation
Title $e number $e - for top of page Or reversed.
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk DOS 3.3 6.20 ; WinXP.
Web <http://www.merlyn.demon.co.uk/ - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <http://www.merlyn.demon.co.uk/programs/00index.htm
My DOS <http://www.merlyn.demon.co.uk/batfiles.htm - also batprogs.htm.
Word processors still have cross-referencing features, though most users
are probably unaware of them (as well as most other features).
Modern word processors have graphic user interfaces for this.
It would not be difficult to add such a feature to a markup language
like HTML. You could, for example, introduce an empty element like <ref>
with the idref attribute, using an id attribute to set the target, e.g.
<li id=foo>my special item
<p>Item no. <ref idref=foo> is...
It could be defined so that the browser is supposed to present the <ref>
element as a number that is also a link to the corresponding item.
The hard part would to make relevant people interested in this, making
WHATWG and W3C standardize it, browsers to implement it, and authors to
learn about it and find it useful. And you would still have a problem
with old browsers which would show just "Item no. is...", which is bad.
I'm afraid there's no good way to make such constructs degrade gracefully...
Things like this are usually dealt with preprocessing or in server-side
code. This means, in effect, that you are using another language,
typically with its tags interspersed with HTML tags, and some software
that processes it and yields an HTML document, before anything is sent
to the client. You might even use Microsoft Word, with its
cross-referencing features, and produce HTML from it (naturally with the
cross-references fixed to have specific numbers). The main problem would
be that after any change, you would have to go through the troublesome
process of converting the "HTML" vomited by Word into something that
works reasonably well. (It's possible, just awkward.)
And I suppose that most people who need such mode of operating can deal
with it. They might not be happy with it, but they're fairly "happy
with" it in the American sense, if you see what I mean.
It wouldn't be difficult to implement the <ref> element with client-side
Yucca, http://www.cs.tut.fi/~jkorpela /