[pmwiki-users] Using Page Text Variables {$:Var} for multi-line Includes

The Editor editor at fast.st
Tue Oct 24 14:15:27 CDT 2006


On 10/24/06, Pico <pmwiki at ben-amotz.com> wrote:
> Patrick R. Michaud wrote:
> > On Tue, Oct 24, 2006 at 05:49:54AM -0400, The Editor wrote:
> >> On 10/16/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >>>> The content of the address variable would start after the first carriage
> >>>> return and would end when a paragraph end is encountered: two returns
> >>>> would be required to end the variable definition.
> >>> The classic approach to this is known as the "heredoc", where one
> >>> says "everything up to XYZ marker".  So, something like this could
> >>> work if we assume that the XYZ marker is "a blank line".
> >> Actually this would be the perfect solution for me.  PLEASE do this,
> >> or make it an option.
> >
> > We just need to come up with a syntax for specifying the end-of-text
> > marker, assuming that someone wants blank lines in the value.

Why not use the existing markup with single line breaks being the
end-of-text marker and keeping (: :) for multi-line for most uses.
But, allow the option of double line breaks (or even some other
delimiter set by the admin) knowing that if that option was selected
he would have to be careful about using the delimiter (double line
breaks) in the text var value.  In the double line case one could put
\n [[<<]] \n if they wanted to avoid the \n\n delimiter (which is what
I do).  Or they could assign a completely different terminator string
like "$#@#%endtextvar$#@#%".  This option combines maximum flexibility
with greatest ease of use.

> Well, I'll just toss these out to start people thinkiing:
>
> 1. ::
> 2. (::)
> 3. (:)
> 4. :
> 5. :end
>
> 1. Because that is the way we end multi-line >>styles<<  But this
> pattern is already used by Jr's Cookbook/MarkupExtensions
>
> 2. To hide the colons in a directive pattern and distinguish it from
> Jr's markup.  This looks like it wants to be a more universal markup
> that could close other directive that allow for multi-line
>
> 3. Simplified version of 1 and 2
>
> 4. Like (:ifend:)

Any of these would be fine--but I still prefer the option of using
single or double line breaks to be the delimiter (or as suggested
above, any string the admin selects).  You wouldn't be able to have
both on the same data page, but you could set it differently on
different pages.

I just think it would be nicer to not have to worry about adding
something special, or removing the delimiter (in recipes).  It would
be easier to authors as well.  Imagine explaining they have to add
(:ifend:) at the conclusion of their mailing address...

The neat thing about the text variables was that they were so
invisible, transparent, and well--natural.  I'd recommend striving to
keep it that way as far as possible. But I sure need someway to put
them into my pagelists!  I had envisioned using comments for all kinds
of things: forums, blogs, instant messaging, etc., (classified
ads!)--but that's all kind of on hold at the moment!

Thanks for the ideas, Pico.

Cheers,
Caveman




More information about the pmwiki-users mailing list