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

John Rankin john.rankin
Thu Sep 30 16:01:23 CDT 2004


On Friday, 1 October 2004 8:04 AM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>
>Comments and questions welcome as always.  The items now on my hit list:
>   * $Name, $Title, $Titlespaced, etc.
>   * automatic spacing of WikiWords (AsSpaced)

I'd like to propose some requirements for the AsSpaced function.

1. Make spacing the default and in particular make $Name in
   the template $SpacedName (change Wiki Help and Search Wiki too)

2. One directive ([:joinwikiwords:] perhaps) changes body text and 
   the pagename display (ie $SpacedName is not spaced if the
   [:joinwikiwords:] directive is set)

-- If PmWiki doesn't do 1, then one directive [:spacewikiwords:]
   changes both body text and the pagename spacing

3. At a minimum make the AsSpaced function a variable, so sites
   can customise name spacing

4. Consider adding the following capabilities:

-- a list of words not to be capitalised if \sword\s is true
   including A An Of The To By And So On (I have a list for English)
   producing for example: A Place to Stand (A is capitalised but to
   isn't)

-- a list of words not to be spaced such as PmWiki, PowerPoint, 
   FrameMaker, FileMaker (probably very site specific)

-- a special case of this is the 'mostly uppercase words': SoI,
   PhD, MSc, CoP, TEOs, CIOs and other abbreviation plurals

   I'm wondering if a general rule like: don't space 
   (^|\s)[:upper:]+[:lower:][:upper:]?(\s|$) is appropriate

-- a list of words that start [:lower:][:upper:] like
   iTunes, iMac, eLearning, eGovernment, thereby avoiding 
   'I Tunes, I Mac' etc

5. Make the word lists language-dependent, so choosing a 
   language automatically chooses the right word lists

6. Alternatively, provide a mechanism for:

-- disabling wikiwords (which I think already exists)
   plus naming pages according to the creator's
   directions

-- if I write [[iTunes]] or [[TEOs]] or [[A Place to Stand]]
   that becomes the $Name of the page

-- I imagine this being done by changing to space to a
   (forgive me) '_' to name the file and translating the
   (forgive me) '_' back to a space for display purposes

-- then perhaps a very simple AsSpaced function is all that's 
   needed (item 3 above)

-- the drawback to this is with wikiwords enabled 
      [[A Place to Stand]] is not the same as APlaceToStand
      iTunes may or may not be the same as ITunes

7. Family names are another matter, eg Ma?c\s[:upper:]
   probably wouldn't space; O\s[:upper:] on some sites
   might become O'[:upper:]

8. This is slippery slope / avoid gratuitous features 
   territory, but I *do* think PmWiki 2 can do a better
   job than PmWiki 1. I hope at least some of these
   suggestions are useful.

   Comments and improvements welcome.



-- 
JR
--
John Rankin





More information about the pmwiki-users mailing list