On 01/27/2011 01:41 PM, Vincent Massol wrote:
On Jan 27, 2011, at 10:05 AM, Marius Dumitru Florea wrote:
On 01/26/2011 08:16 PM, Vincent Massol wrote:
> Hi Marius,
>
> While this is technically interesting isn't this adding too much complexity for
the gain it brings?
>
> For ex:
> * the transformation will run always on all pages for all content, thus adding some
small performance lag
> * it's a little bit too magical maybe
>
> I feel your example doesn't clearly show the advantage:
> * the grouping is saving 1 line of code in the example
> * the automatic import is saving 4 lines at the expense of clarity
>
> Personally I think i'd *much* prefer to hide all this behind a gallery macro:
>
> {{gallery}}
> image:first.png
> ...
> image:last.png
> {{/gallery}}
>
> That macro would automatically add the SSX/JSX + class, thus hiding all complexity
and implementation details from users.
>
> WDYT?
Indeed, this will do for my purpose (office presentation viewer). But,
as Jerome said, sometimes using style names is more convenient.
Yes but in that case we allow it (as you've shown in your example below) even if not
100% convenient (it's not that bad) :)
I think it's good to direct users to package
more complex things into macros, especially since it's easy to package as a wiki
macro. It has several advantages, one of them being that it makes the "snippet"
reusable.
One issue we have is that wiki macros that import JS/CSS can't be used
inside velocity code.