[Pmwiki-users] Re: new directive tag syntax (was: Pmwiki new version)

John Feezell JohnFeezell
Fri Jun 11 16:00:17 CDT 2004


On Fri, 11 Jun 2004 10:15:28 -0600, Patrick R. Michaud  
<pmichaud at pobox.com> wrote:

> On Thu, Jun 10, 2004 at 08:02:07AM -0700, Wayne Lee wrote:
>>
>> why have separate syntax for values
>> and directives?
>
> I think the biggest reason is that values sometimes need to appear
> within a directive, and the separate syntax becomes easier to read.
> For example, I think it's much easier for people to read and parse
>
>    [:search {$Group}/ text:]

This form sure makes a lot of sense to me but I wonder if it might
be possible to reverse the symbols, e.g.,

      :[search {$Group}/ text]:

some how this seems "better" to me.

>
> than it is to read
>
>    [:search [:group:]/ text:]
>    {{search {{group}}/ text}}
>    (.search (.group.)/ text.)
>
> but perhaps that's just my quirkiness.  I'll also note that the
> possibility of nested directives with the same syntax can make the
> programming side of things *much* more complicated -- not only for me
> but also for anyone who wants to add new directives to PmWiki
> (e.g. in a Cookbook module).  The fact that this makes the programming
> more complex doesn't mean it shouldn't be done, but it is a consideration
> for people who would like to customize things later.
>
> To me a value and a directive are slightly different--a directive usually
> implies we want to perform (or suppress) some action, whereas a value
> is just a simple text substitution.  Again, I'll go back to the notion
> of title--I think we need both a directive to set a page's title as well
> as a way of displaying the page's title in the output.  To me this
> implies different markup
>
>    [:title my page's title:]  -- set the title for the page
>    {$Title}                   -- substitute page's title here
>

I would prefer,

      :[title my page's title]:
      {$Title}

> although that doesn't have to be the case
>
>    [:settitle my page's title:]
>    [:title:]
>
>> the '$' can be replaced by an internationally
>> acceptable letter that easy to type after the '['.
>> the original colon at the end of the directive
>> (e.g. [:noheader:]) is an extra letter to type,
>> and an extra letter to type in error, that IMO
>> doesn't buy much.
>
> The extra character at the end of the directive buys a *lot*, namely, the
> ability to include a closing bracket in a parameter.  If we go with
> [$directive param], then there's not an easy way for "param" to contain
> a closing bracket.
>
> Pm
>

/JF



More information about the pmwiki-users mailing list