On 2/15/07, Patrick R. Michaud <[EMAIL PROTECTED]> wrote:
> On Thu, Feb 15, 2007 at 08:40:39PM +0100, Dominique Faure wrote:
> > >It's relatively easy to scan the files in cookbook/ for
> > >strings matching a given pattern, so perhaps we just
> > >need a way of specifying recipe information in the comments
> > >of script files.  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');
>
> and
>
>     SDVA($RecipeInfo['RandomQuotes'], array(
>        'Version' => '2007-02-15',
>        'url' => 'http://www.example.org/recipes/RandomQuotes'
>        ));
>
> or even
>
>     $RandomQuotesVersion = '2007-02-15';
>     SDV($RecipeInfo['RandomQuotes']['Version'], $RandomQuotesVersion);
>
> If we're willing to restrict recipe authors to one or two specific
> syntaxes for setting $RecipeInfo, then perhaps we can live with parsing
> assignment statements as opposed to looking inside of comments.
>
> I do think it's preferable that recipes be able to use SDV()
> to set $RecipeInfo instead of always forcing a value.  Using
> SDV() allows an administrator (or possibly another recipe) to
> easily override the recipe's understanding of its version.
>

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');

> 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-->
>
> and not
>
>    <!--$RecipeInfo['XYZSkin']['Version'] = '2007-02-15'-->
>
> as the latter is likely to confuse the heck out of everyone.
>

An interesting hint is that it provides an easy way to know which skin
is used when asked to debug a site.

Dom

_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to