[pmwiki-users] categories in pagelist

Patrick R. Michaud pmichaud at pobox.com
Mon Apr 2 14:47:05 CDT 2007


On Mon, Apr 02, 2007 at 09:38:54PM +0200, Petko Yotov wrote:
> On Monday 02 April 2007 21:16, Patrick R. Michaud wrote:
> > On Mon, Apr 02, 2007 at 08:55:35PM +0200, Petko Yotov wrote:
> > > Thanks Patrick. I always thought that this should behave like the word
> > > match filter, so, "link=Cat1,Cat2" to mean "all pages with links to both
> > > Cat1 and Cat2".
> >
> > I think this is inconsistent with the other filters -- consider
> >
> >     1.  group=PmWiki,Site
> >     2.  name=Test*,XYZ*
> >     3.  $:Status=open,closed,pending
> >
> > We expect these to mean
> >
> >     1.  pages in either the PmWiki or Site groups
> >     2.  pages that begin with either "Test" or "XYZ"
> >     3.  pages with $:Status of open, closed, or pending
> 
> Yes, but for a page we usually have one group, one name and at most one 
> $:Status while we sometimes have more than one link. :-)

I think we should still aim for overall consistency.

> > Actually, this is the approach I'm currently working on, so that
> >
> >     link=+Cat1,+Cat2           # pages with links to both Cat1 and Cat2
> >     link=Cat1,Cat2             # pages with links to Cat1 or Cat2
> >     link=Cat1,Cat2,+Cat3       # pages with links to Cat3 and (Cat1 or Cat2)
> >
> > But it's not completely trivial to implement.
> 
> I see inconsistencies with the "optional" Cat1 that is sometimes "required":
> 
>   link=Cat1              # same as link=+Cat1
>   link=+Cat1,Cat2        # same as link=+Cat1 or link=+Cat1,+Cat2?
>   link=-Cat1,Cat2        # same as link=-Cat1 or link=-Cat1,+Cat2?
>   link=-Cat1,Cat2,+Cat3  # same as link=-Cat1,+Cat2 or link=-Cat1,+Cat2,+Cat3?

Here's how I currently see the above:

    link=Cat1               # link=+Cat1
    link=+Cat1,Cat2         # link=+Cat1,+Cat2
    link=-Cat1,Cat2         # link=-Cat1,+Cat2
    link=-Cat1,Cat2,+Cat3   # link=-Cat1,+Cat2,+Cat3

In other words, any values without + or - are part of a required
"or grouping" -- i.e., at least one of the specified values must be
present.  (If there's only one, it must be present.)

> One more logical (for me) approach would be to use conditionals as in:
>   link="(Cat1 && !Cat2) || Cat3"
> but I fear this may be even more difficult to implement, and is definitely 
> more inconsistent with the "group=" and other filters.

And it's less author friendly.

> > >   For me what is absolutely essential is the speed of a pagelist,
> > >   so I prefer to only use .pageindex and not open every file for
> > >   inspection unless impossible (so: no PageTextVar search for now).

...and this is why the expanded link= parameter is taking a bit of time
to design and implement, because I think to be done correctly we need to 
preserve the speeds provided by pageindex, as well as provide an
unambigous interpretation for link=cat1,cat2 (while also providing for
the other interpretation).

Pm



More information about the pmwiki-users mailing list