[pmwiki-users] summarize function (pagelisting with includes)

Patrick R. Michaud pmichaud at pobox.com
Fri Mar 4 14:42:01 CST 2005


On Fri, Mar 04, 2005 at 02:47:54PM -0500, Martin Fick wrote:
>   I have hacked the include fucniton to create a new markup
> and function called summarize.  Think of this as a
> multi-file include. The syntax is similar to the include
> syntax (:summarize pages#start#end:) where pages is a
> regular expression wildcard.  This includes the text from
> all the matching pages if they contain the start anchor. 
> It preceedes each page's include text with the name of the
> page linked to itself.

Just a quick note that this could easily generate invalid HTML
(in the sense that it won't validate), since page anchors are 
supposed to be unique on a page.

> Example:
>   (:summarixe  Machine.*#Net#NetEnd)
> 
>   I hope this might be usefull to someone else or if it can
> be improved (I think globbing might be better than
> regexp), included as an addition to pmwiki.
> 
>   It seems like there might be other similar ideas that
> could be added too/instead.  Maybe (:include:) should be
> enhanced to do globbing (similar without titles), and/or
> (:pagelist:) could be enhanced to perform this?

I've been planning to use (:pagelist:) for this instead of
(:include:).  But we have to back up a bit to see how it
would work:

    (:pagelist group=Machine:)

generates a list of all of the pages in the "Machine" group,
in alphabetical order.  If we wanted a simpler listing, without
the "Machine" heading, we would use:

    (:pagelist group=Machine fmt=simple:)

It's fairly easy to write another fmt= handler that includes
the entire text of the page, as in:

    (:pagelist group=Machine fmt=publish:)

This would cause the text of each page in the Machine group
to be displayed one-after-another, with an appropriate
header for each page.  This would be useful for generating
a (printable) page containing the text of all pages in a
group.  For free, we'd also get

    (:pagelist trail=MyBookTrail fmt=publish:)

which would give us all of the pages as listed in MyBookTrail
in the sequence given there, and once we're able to quickly
grab pages in a given category we have

    (:pagelist category=Book fmt=publish:)

So, it's not hard to imagine doing

    (:pagelist group=Machine fmt=include section=#Net:)

which grabs the #Net section out of each page in the
Machine group.

Anyway, that's the way I've been heading, but to be
extensible I'm having to do a bit of reimplementation and
redesign of the pagelist code to be able to handle this.
(I've always known that pagelist was going to need some
redesign, but I needed some experience with it first.)

Pm



More information about the pmwiki-users mailing list