[pmwiki-users] Using Page Text Variables {$:Var} for multi-line Includes
The Editor
editor at fast.st
Tue Oct 24 08:21:55 CDT 2006
On 10/24/06, Patrick R. Michaud <pmichaud at pobox.com> 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.
Any marker would work for me (how about "[@@]"), as ZAP can manipulate
its data input to add the marker--but it would take an extra form
field or two and add some complexity for the admin in setting up the
forms. It might be simplest to code (and for ZAP ease of use) to set
a configurable SDV option which allows either \n\n for the end-of text
or \n for the end of text.
> > 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.
>
> It might be worth noting that [[<<]] really doesn't mean the
> same thing as "blank line"... it generates a substantially different
> output.
Are there specific areas this might pose a problem? I had problems at
first when I first tried using [[<<]] because it destroyed my bullet
list markups. But then I add a line break (\n) with each [[<<]] and
those now work fine. As [[<<]] \n [[<<]] \n is not equal to \n\n it
solved the problem of line breaks in data text. And I don't know of
any other markups that are broken. And in the rare cases it might be
a problem, it might be ok to use (:field: var :)
I do know the current system is not really workable for me--though I
could set a field like multiline=field1,field2, and strip out all the
\n's in those fields but then commenters would loose bullets--at least
in comment boxes. Or I could store the data for those fields in
(:field: var :) format, but then they won't be readable using
(:zapdata:). : (
How hard would it be to just set a \n\n or \n delimiter option?
Cheers,
Caveman
More information about the pmwiki-users
mailing list