[pmwiki-users] (:include parameters

Patrick R. Michaud pmichaud at pobox.com
Mon Nov 21 09:15:49 CST 2005


On Sun, Nov 20, 2005 at 02:11:45PM -0500, Henrik Bechmann wrote:
> (Probably a question for Pm)
> 
> The (:include ... :) directive includes options to select a portion of 
> the included page, between named markers: MyGroup.MyPage#Start#End
> 
> where the MyPage text has
> 
> [[#Start]] and [[#End]] markers embedded.
> 
> BUT it turns out these markers have to mark blocks, so you can't do in 
> MyPage
> 
> Hello There. [[#Start]]This is the first sentence that I want to 
> Include.[[#End]] And the rest I don't want.
> ...
> Note that the only difference is the removal of [^\n]* in both cases
> [...]. So the question:
> 
> Is there any problem with this change to the regex? Any suggestions?

Yes, the problem is that (:include:) was originally designed to
be able to work with markup like:

    !!! [#section1] Section 1
    text
    text
    text

    !!! [#section2] Section 2
    text
    text
    text

so that someone can do (:include SomePage#section1#section2:) or
(:include SomePage#section1) to get the contents of section1.  
Removing the [^\n]'s from the regex means that the !!!'s above 
are treated as being in the wrong sections.

(:include Page#from#to:) has always been defined in PmWiki as a 
line-oriented markup.  If we really want to cut markers in mid-line
we probably need a different option or (:include:) syntax to support it.

Pm




More information about the pmwiki-users mailing list