Re: [Freemarker-devel] Ideal tag syntax; what's your take on it?
Daniel Henrique Alves Lima <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user,gmane.comp.web.freemarker.devel |
|---|---|
| Message-ID | <[email protected]> |
Daniel Dekany wrote:
>> In my opinion the issue is not with the closing of an empty
>> directive, but with the end of directive syntax. The slash is short
>> (1 character) but cryptic, it is not clear it means "end". My
>> suggestion is to introduce an alternative syntax. Maybe:
>>
>> [@foo @end]
>> [@foo]
>> [@end]
>>
>> Equivalent to [@foo][/@]
>>
>> (May need to use #end instead of @end because the latter is valid
>> directive name AFAIK so it wouldn't be backward-compatible)
>>
>
> We don't really care about BC in this discussion. The problem is
> rather that [@foo @end] is awfully verbose, also [#foo #end]. How
> about this:
>
> [#foo :]
> ...
> [#end]
>
> and if you don't have nested content
>
> [#foo]
>
> So the colon makes it obvious that we have started the nested content
> and so there's a matching @end somewhere. You can also extend the
> concept with:
>
> [#foo :]
> ...
> [#end-foo]
>
> so that optionally, you can tell what directive are you closing.
>
> But my problem is that while "end" is self-explanatory, it's too
> verbose. That verboseness is OK for a Velocity-ish syntax, because
> that don't have the [...]-s to help separating tags for the static
> text. But here... it's "[@end" is too much IMO. Anyway, what I was
> originally thinking about is:
>
> [#foo {]
> ...
> [}]
>
> or [} #foo], optionally.
>
> and
>
> [#foo]
>
> Quite obvious. I was happy with the idea, until I tried it in real
> templates, and there I found it looks kind of noisy, because the {}-s
> and [] looks to similar. That's maybe nit-picking, but... I have found
> that despite it's *weird* and has steeper "learning curve", this looks
> better after you get used to it:
>
> [#foo :]
> ...
> [#.]
>
> or [#. foo], optionally.
>
>
How about
#foo [aaaaaaa
aaaaa#if condition [aaaaa
aaaa
]aaaa
]aaaa
Or perhaps as cryptic as Velocity (sometimes).
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev