[Pmwiki-users] Tag suggestion: Acronym

Patrick R. Michaud pmichaud
Mon Jan 26 08:46:43 CST 2004


On Mon, Jan 26, 2004 at 07:16:16AM +0100, Eike Decker wrote:
> Well, But some descriptions are quite short, so I remembered that 
> there was a special tag about these words, to describe them if the 
> user moves the mouse over the element - acronyms. 

This does sound like it could be useful.

> [...] there would be a
> syntax needed to type the word and the description associated with it - for
> example {{HTML | Hypertext Meta Language - represents information in a linked
> way}}.

Indeed, coming up with an appropriate markup is always a challenge.  
A couple of off-the-top-of-my-head suggestions...

  [|HTML|HyperText Markup Language|]
     (seems to work okay)
  [/HTML/HyperText Markup Language/]  
     (not very good, can't easily acronym terms with slashes like TCP/IP)

Another idea: introduce a directive to define an acronym (but doesn't
produce any output), and then automatically highlight the first occurrence
of the acronym in the wiki markup.  For example (again, the markup is
just a suggestion):

   [[acronym:HTML:HyperText Markup Language]]
   [[acronym:WWW:World Wide Web]]
   [[acronym:W3C:World Wide Web Consortium]]

   W3C is the standards body for the WWW; they define HTML and its variants.

would automatically produce <acronym> tags around "W3C", "WWW", and "HTML".
A nice feature about this approach is that the acronym directives
could be written once (e.g., in a GroupHeader or include: page)
and then automatically applied to pages.  A question/challenge to this
approach is figuring out how it would interact/interfere with WikiWord
linking (i.e., W3C is a wikiword in the above example, should it
be a link, an acronym, or both?).  

Yet another idea: instead (or perhaps in addition to) using <acronym> -- 
take advantage of the title= attribute of the <a ...> tag.  Both IE and
Netscape display the contents of the title= attribute when a mouse hovers
over a link (same as acronym except the text is also a link).  This could 
potentially be done with WikiStyles, as in:

   %title='World Wide Web Consortium'% {{W3C}} is the standards body
   for the %title='World Wide Web'% {{WWW}}; they define 
   %title='HyperText Markup Language'% {{HTML}} and its variants.

where W3C, WWW, and HTML are all free links.  Hovering over the link
would pop up the short description, clicking on the link could then take
the user to a page with a longer description.  We can then take advantage
of PmWiki's capability to define new WikiStyles.  The following could
be placed in a GroupHeader to define the acronyms:

   %define=HTML title='HyperText Markup Language'%
   %define=W3C title='World Wide Web Consortium'%
   %define=WWW title='World Wide Web'%

and an author could then write:

   %W3C% {{W3C}} is the standards body for the %WWW% {{WWW}}; 
   they define %HTML% {{HTML}} and its variants.

which looks a lot cleaner.  We could also add an "acronym" markup that
takes advantage of WikiStyles.  Perhaps something like [%WWW%], which
automatically generates <acronym title='...'>WWW</acronym> where the
title attribute is taken from the WikiStyle of the same name as the
acronym.

Just some thoughts.  :-)

Pm



More information about the pmwiki-users mailing list