[pmwiki-users] Rethinking $RecipeInfo (was: Keeping recipes up to date)

Patrick R. Michaud pmichaud at pobox.com
Thu Feb 15 15:08:07 CST 2007


On Thu, Feb 15, 2007 at 09:49:20PM +0100, Dominique Faure wrote:
> On 2/15/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> >> >Perhaps something as simple as...?
> >> >
> >> >    # RecipeInfo: Name=RandomQuotes Version=2007-02-15
> >> >
> >> From the parsing point of view, I don't see any real difference between:
> >>
> >>  # RecipeInfo: Name=RandomQuotes Version=2007-02-15
> >>
> >> and:
> >>
> >>  $RecipeInfo['RandomQuotes']['Version']='2007-02-15';
> >
> >Except that we can also expect things like:
> >
> >    SDV($RecipeInfo['RandomQuotes']['Version'], '2007-02-15');
>
> As the author of two (and soon more) interdependent recipes, being
> able to efficiently check their own version is not an option for me.
> So, I vote for:
> 
>  SDV($RecipeInfo['RandomQuotes']['Version'], '2007-02-15');

Yes, after writing my last message and thinking about it a bit
more, I think I'm going to accept the following forms

    $RecipeInfo['RandomQuotes']['Version'] = '2007-02-15';
    SDV($RecipeInfo['RandomQuotes']['Version'], '2007-02-15');

and perhaps I'll allow for double-quotes as well.  I did a quick
check on pmwiki.org and nearly all of the recipes use the 
assignment form with single quotes.

A nice advantage of doing it this way is that a lot of
existing recipes will work without needing additional updates.

> >But I think we may still want to parse skin templates for
> >$RecipeInfo, and that is probably better done with
> >
> >   <!--RecipeInfo: Name=XYZSkin Version=2007-02-15-->
> 
> An interesting hint is that it provides an easy way to know which skin
> is used when asked to debug a site.

Ah yes, a very good point.

Thanks for the excellent advice,

Pm



More information about the pmwiki-users mailing list