"extends" in ede templates

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

"extends" in ede templates

Andreas Reuleaux-2
Hi Brendan, Hi mailinglist,

I came across your Haskell ede templates coming from servant,
and servant-ede in particular:
 
  https://hackage.haskell.org/package/servant-ede
  https://github.com/alpmestan/servant-ede

and I got some simple examples running (within servant) similar
to those in

  https://github.com/alpmestan/servant-ede/tree/master/example

and of course I can play with ede on the ghci repl.
Well, thanks for creating ede in the first place
(and I am therefore CC'ing to the haskell-servant mailing list as well).

Now, I see that one ede template can "include" other ones as explained
in  http://brendanhay.nz/ede/Text-EDE.html, in the section "Includes",
but - coming from other templating systems in Python etc. - it appears
to me, that it is not currently possible that one template "extends"
another one. Is this true?

I assume you know what I mean by extending, but two links nevertheless
for better explanations / examples:

  * you mentioned ede templates being similar to Jinja2 and Liquid
    templates. - Well Jinja2 templates know how extend another one, cf.

    http://jinja.pocoo.org/docs/2.9/templates/#template-inheritance

    "[...] a child template might look like this:"

        {% extends "base.html" %}
        {% block title %}Index{% endblock %}
        {% block head %}
            {{ super() }}
            <style type="text/css">
                .important { color: #336699; }
            </style>
        {% endblock %}
        {% block content %}
            <h1>Index</h1>
            <p class="important">
              Welcome to my awesome homepage.
            </p>
        {% endblock %}



  * I also found an interesting discussion about "extension" of mustache
    (hastache) templates

      https://stackoverflow.com/questions/7925931/can-mustache-templates-do-template-extension
   
    which seem similar to ede to me (right?)


I wonder, if it possible / difficult / foreseen to add templates
extension to ede?, any advice on a workaround?

Thanks in advance,
  Andreas


--