<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="pto" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#">
<info>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
<title>Annotations</title><biblioid class="uri">http://norman.walsh.name/2004/09/10/annotations</biblioid>
<volumenum>7</volumenum>
<issuenum>162</issuenum>
<pubdate>2004-09-10T09:15:59-04:00</pubdate>
<date>$Date: 2005-10-17 09:59:18 -0400 (Mon, 17 Oct 2005) $</date>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2004</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>The DocBook TC has been talking about annotations for a while
now. Herewith a few random thoughts and a little bit of experimental
implementation.
</para>
</abstract>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#DocBook"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#SelfReference"/>
</info>

<epigraph>
<attribution>
      <personname>
<firstname>Charles</firstname>
	<surname>Dickens</surname>
</personname>
    </attribution>
<para xml:id="p1">When found, make a note of.</para>
</epigraph>

<para xml:id="p2">The DocBook
<phrase>TC<alt>Technical Committee</alt></phrase>
has been talking about annotations for a while now. The genesis of
this discussion is two separate but similar requests:</para>

<itemizedlist>
<listitem>
<para xml:id="p3">Support for acronym expansion (such as
<acronym><alt>American National Standard Code for
Information Interchange</alt>ASCII</acronym> and
<acronym><alt>Extended Binary Coded Decimal
Interchange Code</alt>EBCDIC</acronym>) and</para>
</listitem>
<listitem>
<para xml:id="p4">Support for titles on links (such as
<link xlink:href="http://www.sun.com/">Sun<alt>Sun Microsystems</alt></link>)
</para>
</listitem>
</itemizedlist>

<para xml:id="p5">First, although HTML uses attributes for the simple inline annotations
demonstrated above, we want to use elements. Putting human readable content
in attributes is wrong (it doesn’t support the full range of text that you
might want to use and it doesn’t internationalize well).</para>

<para xml:id="p6">Present a bunch of engineers with a problem and what’s one of
the first things we do? We generalize. There are a lot of issues
around annotations, technical and otherwise, that have to do with just
how far we want to take this generalization. Once you’ve got the stuff
in elements, it’s a short step from inline annotations to more
interesting flavors.
</para>

<para xml:id="p7">Modern browsers display acronym expansions and link titles as
“<phrase annotations="ann.tooltips">tool tips</phrase>”. That little
graphic after the phrase “tool tips” is a “block” annotation. In a
modern, graphical browser clicking on that link will present a “popup
window”. That works in <application>Firefox</application> and
<application>Internet Explorer</application> and sortof in
<application>Opera</application> and sortof in
<application>Safari</application>. In Opera, you have to click twice
on the graphic sometimes, but maybe that’s because I have an antique
version of Opera. In Safari, the popups don’t seem to go away when you
click somewhere else in the window; you have to reload the page to get
rid of them. That’s unfortunate.</para>

<annotation xml:id="ann.tooltips">
<title>Tool Tips</title>
<para xml:id="p8">A tool tip is a word or short phrase displayed
automatically by an application when the user hovers the mouse over
some component in the user interface.</para>
  </annotation>

<para xml:id="p9">I’m using <personname>
      <firstname>Matt</firstname>
<surname>Kruse</surname>
    </personname>’s
<link xlink:href="http://www.mattkruse.com/javascript/popupwindow/">PopupWindow</link>
code. For the moment, I’m going to assume that technical glitches with
specific browsers are just that, technical glitches, and I’m not going
to worry about it too much.</para>

<para xml:id="p10">With a little CSS cleverness, text-only browsers like
<application>links</application> and <application>lynx</application>
work OK too. I hope that means screen readers work too. What
happens is, the block annotations appear at the bottom of the page and
the graphic’s alternate text becomes a hypertext link to those
annotations. Maybe it’s a little cluttered, what with the “X”
alternate text for the close button and all, but it seems like a fair
compromise.</para>

<para xml:id="p11">At the moment, I’m only supporting two classes of annotations:</para>

<itemizedlist>
<listitem>
<para xml:id="p12">Inline annotations are recognized in <tag>abbrev</tag> and <tag>link</tag>
elements and produce an appropriate HTML tool tip. Only the first inline
annotation is recognized, the rest are ignored.</para>
</listitem>
<listitem>
<para xml:id="p13">Block annotations are recognized in most places and produce the little
clickable graphic that makes the popup window.</para>
</listitem>
</itemizedlist>

<para xml:id="p14">One of the open questions with annotation support is what, if
any, rendering should be used for print (or non-interactive)
presentation. I’m using footnotes at the moment, with a distinct
footnote mark, for block annotations. Inline annotations are ignored.</para>

<para xml:id="p15">Comments? Suggestions?</para>

</essay>

