[pmwiki-users] IncludeText doc

Patrick R. Michaud pmichaud at pobox.com
Thu Feb 15 08:13:05 CST 2007


On Thu, Feb 15, 2007 at 08:59:47AM -0500, Pierre Racine wrote:
> I can add that if we do not specify the ending anchor, the 
> starting anchor suffixed with "end" is assumed. Ex.: [[#anchorname]]bla,
> bla, bla...[[#anchornameend]]

In the current implementation, if no ending anchor is provided
then the next anchor in the text is used.  The use of an "end"
suffix is a convention we've been using and encouraging, but it's
not actually coded anywhere.

I've been thinking of modifying the routine slightly so
that if no anchor is specified, then we use the "end" suffix
if it exists and the next anchor if not.  But PmWikiPhilosophy #3
applies -- so far I haven't heard from anyone who needs the
capability to include blocks of text containing anchors.

> And what is the usage of the last boolean (true/false) argument?

I got rid of the third argument some time ago... but
apparently I forgot to update the call to IncludeText()
in scripts/pagelist.php .  It was originally used to tell
IncludeText() to process any '&', '<', '>', etc. characters
in the retrieved text.

It'll undoubtedly be corrected when I add the section retrieval
code.

Thanks!

Pm

> 
> >-----Message d'origine-----
> >De : Patrick R. Michaud [mailto:pmichaud at pobox.com] 
> >Envoyé : 14 février 2007 13:36
> >À : Pierre Racine
> >Cc : pmwiki-users at pmichaud.com
> >Objet : Re: [pmwiki-users] IncludeText doc
> >
> >On Wed, Feb 14, 2007 at 11:37:53AM -0500, Pierre Racine wrote:
> >>    Hi list,
> >>     
> >>    is "function IncludeText($pagename, $inclspec)" 
> >documented somewhere?
> >>     
> >>    I want to read template string enclosed between 
> >[[#templatename]] and
> >>    [[#templatenameend]] similar to the one in 
> >PageListTemplates. I fill that
> >>    IncludeText is the right function to do this but I can't 
> >figure what
> >>    are its arguments...
> >
> >Actually, this particular capability (grab a template enclosed between
> >two anchors) is expected to become its own function, which 
> >pagelist templates and include will use.
> >
> >In the meantime, the arguments to IncludeText are
> >
> >    $pagename -- the current page
> >    $inclspec -- the specification for the include (i.e., it's the
> >      argument to the (:include ...:) directive)
> >
> >
> >Thus, calling
> >
> >    IncludeText("Group.Page", "ABC#def#ghi")
> >
> >would return the text between the [[#def]] and [[#ghi]]
> >anchors on page Group.ABC.
> >
> >Pm
> 



More information about the pmwiki-users mailing list