[Pmwiki-users] Re: AsSpaced function (was pmwiki-2.0.devel9 released)

Patrick R. Michaud pmichaud
Sat Oct 2 10:18:04 CDT 2004


On Sat, Oct 02, 2004 at 01:20:40PM +0200, chr at home.se wrote:
> On 2 Oct 2004, John Rankin wrote:
> > I find abbreviations with a lower case letter are a common problem,
> > like CoP or SOEs or BSc:
> 
> Slightly related.. what's the plural of an acronym? For instance, let's 
> say we write CCD for 'charge coupled device' as in:
> 	The CCD in my camera has 3.3 million photo sensitive elements.
> When using the acronym in a plural sence, I think I should be writing 
> something like:
> 	The CCDs have become much cheaper lately.
> but because this is interpreted by PmWiki as a wiki word, I find myself 
> writing something like this instead:
> 	The CCD:s have become much cheaper lately.

One can always do the `NotAWikiWord convention that jr uses:

       The `CCDs have become much cheaper lately.

I've added this (and several other of jr's excellent markups) to the 
distribution version of PmWiki 2.

> Maybe '[:upper:]+s' shouldn't be interpreted as a wiki word?

Sure, but there's also quite a few others (e.g., "PhDs") that
can pose problems.  At some point you're just better off without 
WikiWords.

> What about inverting the defaults? Instead of trying to exclude certain
> words from being interpreted as WikiWords, maybe we should come up with an
> easy way to let administrators and/or users specify what words or patterns
> that should be interpreted as WikiWords/links?

There is already an "easy" way to do this -- it's called 
$WikiWordPattern.  :-)  

> Another alternative might be to only interpret WikiWord as a link if the
> corresponding page 'WikiWord' already exists? (Instead of turning it into 
> a 'create page link').

This can be done also--even in v1.  One can disable create page links
globally by changing $WikiPageCreateFmt ($LinkPageCreateFmt in v2), or
one can change the translation of bare WikiWords to check for page
existence first before converting.

Another solution is to simply disable the link decorations on links to
non-existent pages, so that the WikiWord to a non-existent page looks 
like normal text but the link is still available if someone wants to 
create the target page.  I.e., something like:

   $WikiPageCreateFmt =
      "<a class='createlink' href='\$PageUrl?action=edit'>\$LinkText</a>";

   $HTMLHeaderFmt[] = "<style type='text/css'><!--
      a.createlink { text-decoration:none; color:inherit; }
      --></style>";

This will still leave a link there, but it will look just like the
surrounding text--i.e., someone won't see that it's a link unless they 
hover over it with the mouse or otherwise activate it.

Pm



More information about the pmwiki-users mailing list