Thursday's lunchtime links, and ideas on highlighting content

Written by Adrian Holovaty on August 29, 2002

Luke Wroblewski: On the Pursuit of Simplicity. As I mentioned yesterday, news sites have much to learn about keeping things simple. (Link from InfoDesign)

New Architect: Weighing the Risks and Rewards of Standards.

Nathan Ashby-Kuhlman: The Web needs Xanadu features, particularly "the ability to address individual paragraphs, sentences or even words in someone else's document." I couldn't agree more. We need a way to permalink to anything on the Web (to borrow a blogging term).

On that note, I've recently been throwing around ideas with Stuart and Paul about devising some sort of standardized system for accessing a part of an HTML document. I have a rudimentary system already in place on You can add ?highlight=[highlightstring] to the end of any blog URL, and it'll highlight every occurrence of [highlightstring]. What I would rather have, though, is something like HighlightParagraph=[paragraphNumber], which would highlight an entire paragraph, or perhaps HighlightWords=[FirstWordNumber]to[LastWordNumber], where FirstWordNumber and LastWordNumber are the word boundaries of the document's requested selection (e.g., the 25th through 36th words).

The problem with such an idea, Stuart points out, is the user interface. It would be easy to program a publishing system to highlight the appropriate content, given those query strings, but we need something that would make it easy to create such query strings in the first place. In other words, in my last example, how would a user determine the word numbers of a selection without having to count them him or herself? An interesting problem.


Posted by Ben Meadowcroft on August 30, 2002, at 2:40 p.m.:

Rather than invent your own addressing system why not take a few ideas from XPointer. This is the W3C's proposed recommendation for addressing individual parts of documents.

XPointer "supports addressing into the internal structures of XML documents. It allows for traversals of a document tree and choice of its internal parts based on various properties, such as element types, attribute values, character content, and relative position." see W3C XML Pointer

For sites written in valid XHTML the proporties of XLink will be available (via extension initially). I think that your ideas are good, just remember that there are proposed standards out there that you can base your ideas on and eventually adopt when they become more mainstream.

Posted by Adrian Holovaty on August 30, 2002, at 5:56 p.m.:

No pun intended, but thanks for the pointer. Looks very interesting...

Posted by Craig Saila on September 3, 2002, at 7:31 p.m.:

You example link doesn't work right now, it produces an error page with this: "ERROR: Numbers only, please."

Posted by Adrian on September 3, 2002, at 7:45 p.m.:

Thanks for the heads-up. (I left a slash out of the URL.) I've fixed it.

Posted by Rob on September 5, 2002, at 6:43 a.m.:

While I meant to think more about this when you posted about it and now weeks afterward, I was just thinking that perhaps there would be a software solution, in the least. It still won't be perfect, but you could wrangle it so that the program in question figures out where the string is located in the document and would return/use the correct query string. This would still require, obviously, the source document and the part of the document someone wanted to use. Thinking of CMS systems, this could perhaps be accomplished even using bookmarklets (which are, typically, awfully non-standard-compliant, unfortunately (or at least cross-browser/cross-platform)).

Posted by Adrian on September 6, 2002, at 2:12 a.m.:

I think one way of doing it, as suggested to me by Stuart, would be to program it so that if a user highlights part of the text and clicks "permalink", JavaScript will determine the selected text and send it to the server-side script, which will return an appropriate permalink page with the text highlighted.

Comments have been turned off for this page.