[pmwiki-users] About {$:var} text-variables

V.Krishn webmaster at insteps.net
Mon Sep 11 13:08:55 CDT 2006


On Monday 11 September 2006 23:04, you wrote:
> --- "V.Krishn" <webmaster at insteps.net> wrote:
> > {(function args)Group.PageName$[?:# ...](index)var}
> > I was wondering what could this (index) be of use
> > off.
>
> When I suggest an index, I was specifically thinking
> of using it for wikipaths.  The idea was that if we
> were going to look things up by various wiki markup
> sections, say for example by bulleted items, then we
> could pick the nth bulleted item.
>
> For more ideas, check out the current suggested
> wikipath grammar here:
> http://www.theficks.name/test/wikipaths/pmwiki.php?n=Wikipath.Grammar
>
> I started hacking a recipe this weekend and it can do
> some very rudimentary things here:
> http://www.theficks.name/test/wikipaths/pmwiki.php?n=G1.Test
> There is a lot of debug stuff outputted at the
> beginning, ignore that:  I did say hack :).
>
> What this has led me to is to realize that chained
> wikipaths need to be rethought somewhat.  Here is an
> example:
>
> * Item A1
> ## Item B1
> * Item A2
> ## Item B2
>
> How can I specify Item B2 by position?  The intent was
> to maybe do something like {{$*2##}} where the two
> would look at sub items to Item A2.  This leads to the
> question, how are sub items defined from a document
> structures standpoint?  The example above looks
> obvious, but it really isn't.  Here is another example
> that might illustrate the difficulty:
>
> ! Heading H1
> * Item A1
> ## Item B1
> ! Heading H2
> ## Item B2
>
> What would {{$*Item##}} refer to? Item B1? Or does it
> include Item B2?  In other words, where does a
> subsection end, is there any hiearchy that can actualy
> be deduced from a document?  Afterall, Item B2 is
> after Item A1, but I don't think that most people
> would consider it a sub item to A1.  So this means
> that an end to the Item A1's subsection must somehow
> be deduced.  Is it the presence of a heading element
> (H2)?
> If so, what about in this case:
>
> # Item H1
> ** Item A1
> ## Item B1
> # Item H2
> ## Item B2
>
> Does {{$**Item##}} include Item H2 or B2? Very hard to
> determine.  The wiki doc does not seem to actually
> provide a hiearchy even though most of us perceive it
> as having one (unless I am missing it?)
>
> Any advice on this delimma is highly sought, I am
> currently thinking of saying that a subsection
> continues until the next subsection of the same type
> with either the same or higher order(?).  In other
> words a # or a ## would end a ## section, but nothing
> else would.  Somehow though, it does seem like a
> heading or should end all non heading sections?
>
> > Could this use eg (.) to denote - 'create
> > unambiguous expansion or expand the
> > variables before getting the values back'.
> > Other uses could be (>) or (<)
>
> Sorry, I don't uderstand this question?
I was meaning
{(function args)Group.PageName$[?:# ...](.)var}
or
{(function args)Group.PageName$[?:# ...](\)var}
meaning get the varible value after substitution.
others
{(function args)Group.PageName$[?:# ...](<)var}
{(function args)Group.PageName$[?:# ...](>)var}

But I think this would become more complicated.
V.Krishn
>
> -Martin
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com




More information about the pmwiki-users mailing list