[Pmwiki-users] Hierarchical groups

Patrick R. Michaud pmichaud
Tue Jun 8 17:42:12 CDT 2004


I'm still looking into the possibility of dealing with hierarchical groups,
or at least offering it as an optional feature.

The issue I've generally had with hierarchical groups is dealing with
relative links between pages.  Absolute links where the entire
group name is specified are no problem.  But if we want to allow
relative links, where only a part of the path needs to be specified,
then it gets a bit tricky.  For example, if we're currently on a page
called "NFL.Teams.Patriots.Playoffs", then how do the following
resolve...?

1. [[SeasonOpen]] links to NFL.Teams.Patriots.SeasonOpen (standard wikiword)
2. [[Teams.WorkingTogether]] links to Teams.WorkingTogether or 
      NFL.Teams.WorkingTogether or NFL.Teams.Patriots.Teams.WorkingTogether?
3. [[Patriots.Washington]] links to NFL.Teams.Patriots.Washington or
      Patriots.Washington or NFL.Teams.Patriots.Patriots.Washington?
4. [[Playoffs.WildCard]] links to NFL.Teams.Patriots.Playoffs.WildCard,
      or Playoffs.WildCard?

Some suggest using a "parent" operator such as '..' to resolve, meaning move
up one level in the hierarchy, the same as filesystems currently do.
Unfortunately, '.' is already being used as a group separator character.
I suppose I could change this to something else, but '.' just seems
natural to me somehow.  Alternately, we could use something like '^'
to mean "parent".

So far I've only come up with three approaches that I think might work.

The first is to only allow absolute group names--i.e., all group names
start from the top.  I personally don't have a problem with this, but
I suspect people will have issues with the lack of a way to do relative
group references...

Another approach is to just adopt the filesystem (hierarchical directory)
form of links.  This has an advantage of being widely understood, at 
least among people who work with filesystems.  On the other hand, this 
would mean that a reference to [[Alpha/Beta]] would always put "Beta" 
at a level below the current one (i.e., beneath the page named "Alpha" 
at the current level).  We'd undoubtedly want some sort of markup 
to indicate "top level", such as a leading '/' or '^'.

The other approach is to use the first component as a relative anchor
if it occurs in the current group name.  Thus, in the page Alpha.Beta.Gamma,
the link [[Beta.Zeta]] would refer to Alpha.Beta.Zeta, [[Alpha.Delta.Epsilon]]
would refer to Alpha.Delta.Epsilon, and [[Iota.Omega]] would refer
to Iota.Omega.  But this can also get confusing, because [[Alpha.Delta.Epsilon]]
and [[Delta.Epsilon]] refer to different pages, even though
[[Alpha.Beta.Zeta]] and [[Beta.Zeta]] refer to the same page.

Anyway, I don't have clean answers, and I've liked the way PmWiki's
current grouping mechanism works.  But if someone comes up with a clean
alternative, and if a majority of folks like it, I'm certain it can be
supported.

Pm



More information about the pmwiki-users mailing list