freemarker-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taher Alkhateeb <slidingfilame...@gmail.com>
Subject Re: Proposal for FREEMARKER-84: More flexible handlig of missing templates
Date Sun, 18 Feb 2018 10:22:29 GMT
I feel clumsy now :) Thank you for the explanation, I'm beginning to
understand this a bit. I'll follow up on the JIRA

On Sat, Feb 17, 2018 at 7:57 PM, Daniel Dekany <ddekany@apache.org> wrote:
> Saturday, February 17, 2018, 2:36:37 PM, Taher Alkhateeb wrote:
>
>> Ahh I see, I guess that's the layer of complexity Jacopo was pointing
>> to (fall back mechanism). Every time I engage here I learn something
>> :) In this case I stand neutral. it sounds a bit challenging but I
>> have zero knowledge of the code base and perhaps the architecture
>> allows for that.
>
> It allows that. It's already possible to do with the public
> Environment Java API. It's just that then you had to implement a
> custom TemplateDirectiveModel and all... and it might not be so easy
> to do (or to do correctly) for an average user.
>
> Anyway, an important selling point of FreeMarker is that you generally
> have to run less circles to make developers add this-and-that tool,
> also to find the typically lacking documentation of in-house
> directives, because lot of the stuff is there out-of-the-box and is
> documented in the Manual. (Except that people enjoy using ancient
> FreeMarker versions... like 2.3.19(!) and 2.3.23 are big favorites.)
>
>> I find this over all intriguing and interesting, if you intend to work
>> on this feature would you mind sharing the JIRA number so I can follow
>> on the code changes?
>
> It's in the thread Subject... :)
> https://issues.apache.org/jira/browse/FREEMARKER-84
>
>
>> On Sat, Feb 17, 2018 at 4:06 PM, Daniel Dekany <ddekany@apache.org> wrote:
>>> Saturday, February 17, 2018, 9:36:48 AM, Taher Alkhateeb wrote:
>>>
>>>> Wrong link, sorry, correcting.
>>>>
>>>> http://jinja.pocoo.org/docs/2.10/templates/#include
>>>
>>> Just be sure it's clear, we also have an ignore_missing option (in the
>>> released versions). But it's often not very useful if you can't do
>>> some action in case the template is missing.
>>>
>>> Jinja also allows you to specify a list of template names instead of
>>> just one, and uses that as a fallback list. That's something I have
>>> considered as well, and I believe it covers most use-cases for the
>>> proposed feature. However, it falls into the same mistake as
>>> ingnore_missing, as it focuses on a concrete use-case while missing
>>> another (when you have to do something before the template if it
>>> exists). I prefer less but more generic devices. With that could have
>>> avoid adding ignore_missing as well.
>>>
>>>> On Feb 17, 2018 11:34 AM, "Taher Alkhateeb" <slidingfilaments@gmail.com>
>>>> wrote:
>>>>
>>>>> For a point of comparison, the python jinja2 template engine (widely
used)
>>>>> has an "include" directive that has an attribute named "ignore missing"
>>>>> [1]. I also remember seeing similar behavior in other engines.
>>>>>
>>>>> So I guess perhaps from a usability point of view this seems to be a
>>>>> desired feature by users. However, I don't know what the impact in terms
of
>>>>> complexity would reflect in the code base.
>>>>>
>>>>> http://jinja.pocoo.org/docs/2.10/templates/#list-of-global-functions
>>>>>
>>>>> On Feb 17, 2018 11:18 AM, "Jacopo Cappellato" <jacopo.cappellato@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> On Fri, Feb 16, 2018 at 8:04 AM, Daniel Dekany <ddekany@apache.org>
>>>>>> wrote:
>>>>>>
>>>>>> > Some more opinions guys? Especially as we got one opinion against
the
>>>>>> > feature.
>>>>>> >
>>>>>>
>>>>>> Just to clarify my opinion: I am not against this feature; I simply
don't
>>>>>> consider it a must since there are some workaround to get a similar
>>>>>> behavior. But if it will be implemented I will be happy too.
>>>>>>
>>>>>> Jacopo
>>>>>>
>>>>>
>>>
>>> --
>>> Thanks,
>>>  Daniel Dekany
>>>
>>
>
> --
> Thanks,
>  Daniel Dekany
>

Mime
View raw message