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

Patrick R. Michaud pmichaud
Fri Oct 1 01:35:48 CDT 2004


JR wrote:
> Displaying CamelCase words is definitely a barrier for some types
> of audience.

Good point.  Still, it's all going to be as easy as setting
$SpaceWikiWords = 1; in a config.php.

> >I haven't figured out what to do with spacing of the group name in the
> >default template. 
> 
> FWIW, I'd leave it as is. 

Worth a lot, thanks.

> >I've been thinking of perhaps another approach -- namely, to make 
> >pagenames case insensitive everywhere [...] then a page's name 
> >for display purposes would come from a field held inside the pagefile
> >itself; the field would be initialized with the case+spacing that was
> >used by whatever/whoever created the page initially.
> 
> That would work. What happens when somebody does ?action=rename --
> I assume the text entered in the rename box would go into
> this new field. 

Something like that.

> And is this field used as the default link text for links to the
> page? 

No, I wasn't thinking (at all) of going that far.  To me it's important 
that the capitalization and spacing of link text be consistent with
its context, and a single field in a target page just can't cover that for 
all of the contexts of source pages, such as beginnings of sentences or
places where a part of the name/title should be omitted (e.g., leading
articles).

>     I write [[wiki word]] to create a new page
>         this displays as a link to wiki word
>     I later refer to it by writing [[WikiWord]]s and
>     WikiWord
>         I *think* the answer is to use the new field's spacing
>         and the reference's capitalisation (one needs to be able
>         to start a sentence with a capital letter)
> [...]

Well, a couple of thoughts.  First, as you noted, I think that whatever 
spacing and capitalization appear in double brackets should generally
be honored, because if an author writes [[WikiWord]]s that's a pretty 
good indication that the space isn't desired (because one could've been 
easily added if it was).  And it's certainly the case that [[(wiki) word]]s
probably shouldn't have the system second-guessing the author as to
capitalization.  It's really only in bare WikiWord links that the author 
is limited in spacing/capitalization, because of the need to be able to 
locate and delimit the link target in the markup.

So, if one thinks of WikiWords as being a convenient markup for 
"link to another page", then it's likely a site administrator's decision
as to what the source of the link text for those links should be.  Some 
sites will want to stay closer to a WYSIWYG concept, keeping the 
displayed link text close to the markup text.  Others will want to go 
ahead and do some simple formatting based on the link target's name, a-la 
[:spacewikiwords:].  And a third group might view WikiWords strictly 
as link target specifiers, with the link text coming from the page's 
[:title:] directive, a "here's my link text for WikiWords" field in the
page, or from a previous link.

But the way I'd probably support all of these may be to simply provide 
alternate markup rule entries for bare wikilinks--i.e., rules that 
override PmWiki's default "wikilink" rule with ones that have the 
desired semantics for determining the link text of bare wikiwords
(and possibly other sequences we'd like to have treated as links).

Pm



More information about the pmwiki-users mailing list