softmoth / raku-Template-Mustache

Raku library for the Mustache template format
https://modules.raku.org/dist/Template::Mustache:cpan:SOFTMOTH
Artistic License 2.0
21 stars 19 forks source link

Inheritance templates #34

Closed antoniogamiz closed 4 years ago

antoniogamiz commented 4 years ago

Will this feature be implemented in the near future? It would be handy for Documentable.

softmoth commented 4 years ago

Can you give a quick example of what you need? Thanks!

softmoth commented 4 years ago

Sorry, I mean, is there a subset that is particularly needed, or do you need the full blown implementation like it's detailed at https://github.com/mustache/spec/pull/75

antoniogamiz commented 4 years ago

I would like to use the skeleton defined here, replacing the "main content" part with another mustache template, depending on the document I want to generate using Documentable.

softmoth commented 4 years ago

Let me know if you have problems using this. See t/12-inheritence.t for an example of usage. In this example, t/views/layout.mustache is like your main.mustache skeleton, and t/views/article.mustache is your document template.

I'll push a new release with this included soon; I just want to give it a bit of time for more testing and perhaps to fix a few extra issues. But I wanted to get this initial version out to you as soon as possible, since I think it should be complete enough for your needs.

Thank you, Antonio!

softmoth commented 4 years ago

I've released Template::Mustache:ver<1.2.0>, which passes all of the inheritance spec tests found in the GRMustache implementation.

Please open an issue if you have any problems using this, or need any further features.