00039: $Titlespaced variable and $AsSpaced functions not available

Summary: $Titlespaced variable and $AsSpaced functions not available
Created: 2004-09-15 22:30
Status: Closed, added for 2.0.devel13
Category: Feature
From: jr
Priority: 45
Version: 2.0dev4
OS: OSX/Apache1.3.29/Php4.3.2

Description: In PmWiki 1 it is possible to (a) use $Titlespaced instead of $Title and (b) substitute a local AsSpaced function. For example, this allows the WikiCalendar to display page names as 2004 09 16. One can do it manually with the [:title Spaced Title:] directive, but automation is better.

I just haven't figured out how I want to deal with [:spacewikiwords:] and AsSpaced yet. But I'm glad it's in PITS now so I don't forget it (and it has an appropriate priority on it). --Pm

Some questions and possible answers:

What should happen about references to $Name?

option 1
change [:spacewikiwords:] to [:spacewikinames:] and it spaces both wiki words and $Name in the title bar.
option 2
add a separate [:spacewikinames:] directive that causes $Name to be spaced.
option 3
introduce a $Namespaced variable (akin to $Titlespaced).

It always felt a bit inconsistent that in PmWiki 1 spacewikiwords doesn't space the group or title.

Should wiki words be spaced by default?

With the greater weight being given to [[page name]] markup, perhaps:

  • $Name should be spaced by default
  • wiki words should be spaced by default
  • an author can disable spacing with a [:joinwikiwords:] directive

Do we still need an AsSpaced function?

Yes, so an administrator can override the default capitalisation; eg to display Terms of Reference instead of Terms Of Reference; or to display FrameMaker or PmWiki instead of Frame Maker and Pm Wiki.

As an alternative, I've added a cookbook entry to create spaced WikiWords and handle spacing of titles in pages. It's a different approach and I'm not saying it's the right one, but it works now if you need it and it presents a different way of thinking about the problem. LarryBaltz

I like the comments above, especially the points about $Name being spaced by default, and WikiWords being spaced by default. I think it's safe to assume that if there is a $SpaceWikiWords variable, then ALL WikiWords should be spaced (Groupname, Pagename, and body text). Why would somebody want to enable something like that, but now apply it to Titles and such? I don't think it makes any sense. Either you want em or you don't. I think enabling the spacing by default is a great idea too. - Steven Leite