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

The Editor editor at fast.st
Tue Oct 24 04:49:54 CDT 2006


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.

Someone just pointed out ZAPdata doesn't work with pagelist text vars
and multiline data.  It works fine with (:zapdata:), but I can't use
that in pagelists, where I must use text var's.  My data is all stored
in the format:

field1: value

field2: value, if multiline
[[<<]]
rest of value.

field3: value

It might be possible, but not particularly easy for me to use a
different kinds of markup for certain kinds of field.

I already use a double line break (a single blank line) as the
delimiter between data fields, and it works great. If you want to
include line breaks in a post, ZAP automatically converts each blank
line to a [[<<]] so it doesn't trigger the end of the data.  Whether
using ZAP or not, that would make text vars capable of the same thing.

Lastly, I too don't like the look of the multiline vars directive as
the opening and closing seem too far apart, and could get confusing if
there is a lot of text in between.

It should be noted this solution might be a problem in the case of the
example above if someone wanted to just return the Name: or Phone:
(think of all the PmWiki cookbook recipe headers) suggesting maybe an
alternate, invisible data delimiter could be used where several data
values are listed.

> > Name: Elmer Fudd
> > Phone: 123.456.7890
> > Address:
> > Street
> > City, State Postal Code
> > Country

Perhaps they could be put in tables if they want single line data
lists . Stick a [==] at the end of single lines.  Or enclose the value
in [=value=] if multilines are wanted (as long as long paragraphs can
be made to wrap in a page).  Another option is an SDV value that could
be set to make the delimiter (one line break or two).

Thanks so much for this!  As it is, I've just realized my whole
approach to commenting is broken in ZAP, until I can figure out how to
get multiline text var returns. I can think of a few options for ZAP,
but prefer to see what you recommend Pm.

Cheers,
Caveman




More information about the pmwiki-users mailing list