[Pmwiki-users] Re: Re: Categories instead of hierarchies?

John Rankin john.rankin
Thu Oct 28 16:19:16 CDT 2004


On Friday, 29 October 2004 9:28 AM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>On Thu, Oct 28, 2004 at 09:58:25PM +0200, chr at home.se wrote:
>> 
>> 	(:category XYZ,2004,Horror:)
>> 
>> > It also means building a lot of extra support for categories into the
>> > base code.
>> 
>> I don't quite see how this requires a *lot* of extra support, but then 
>> again I haven't been thinking about how it should be
>implemented either.
>
>...figure out how you're going to find all of the pages that belong to
>category XYZ.  Since (:category XYZ:) no longer creates a link to
>Category.XYZ, you can't just do a backlinks search to find all of the
>pages in the XYZ category.  You could try searching for the (:category XYZ:) 
>markup itself, but you also have to make sure that it hasn't been 
>escaped by [=...=] or [@...@] somehow, and searching for literal 
>"(:category XYZ:)" doesn't help you if the author wrote 
>"(:category 2004, XYZ:)" --you have to build a really good
>pattern match.
>
>Add to this that you still have to search for the [[!XYZ]] links as well,
>and you now need a specialized "category search" function that is
>fairly expensive to implement.  Or, you have to have each page save its
>list of categories (linked and non-linked) to a separate field when it's 
>written, which means writing code to update/maintain this extra field on
>save, and we *still* need the specialized category search.
>
>It's just much nicer when you can do a simple search for 'Category.XYZ'
>or '[[!XYZ]]' and take advantage of the linkages and processing PmWiki
>already has.
>
>Pm
There *might* be a simple solution for what Christian wants to do.

Suppose (the markup is for illustration only)

C:[[#categories]] [[!XYZ]], [[!ABC]]

displays as '' (nothing).

Further suppose that

[[#categories | !]]

says 'get the text from [[#categories]] to the end of the line'
ie

[[!XYZ]], [[!ABC]]

Then I think everything 'just works'. And if we interpret C for 
Comment instead of C for Category, it's a general solution that
happens to be useful for category lists, rather than a special
case invented just for categories.

Just a thought.

-- 
JR
--
John Rankin





More information about the pmwiki-users mailing list