FrankFang / gulp-html-extend

Extend your html files
67 stars 8 forks source link

Multiple extends #17

Open codrin-iftimie opened 9 years ago

codrin-iftimie commented 9 years ago

a.html

<!-- @@master master.html -->
<!-- @@block m_header-->
    <!-- @@include b.html -->
<!-- @@close -->

b.html

<!-- @@master master2.html -->
<!-- @@block m2_header-->
    <something></something>
<!-- @@close -->

I'm currently trying to extend an included template as above. Any idea why master2 is not included and extended?

FrankFang commented 9 years ago

It's not supported.
Including works before extending. So a.html equals

<!-- @@master master.html -->
<!-- @@block m_header-->
    <!-- @@master master2.html -->
    <!-- @@block m2_header-->
    <something></something>
    <!-- @@close -->
<!-- @@close -->
FrankFang commented 9 years ago

Why Multiple extendings? What's your use cases?

codrin-iftimie commented 9 years ago

I'm trying to create a jinja2 template out of multiple html files. This template has like a switch statement inside of it that imports other resources. It would help a great deal to extend some of these imports... I can make a PR in the next days depending on how much free time I have.

Would such a feature interest you?

FrankFang commented 9 years ago

It sounds reasonable. It does not take much time. Let me see what I can do.

prium commented 8 years ago

Hi Frank, this would be very helpful for me too. I am trying to do the same thing. Could you please help?