eps icon indicating copy to clipboard operation
eps copied to clipboard

[Feature Request] Support for partial templates

Open fourpastmidnight opened this issue 3 years ago • 1 comments

I just want to take a moment and say that when I went searching for templating in PowerShell, this was at the top of the search results. And after looking through the examples and ReadMe, it seems to be a really nice templating DSL. I'm working on porting a JavaScript library, which is making use of handlebars templates, and I'm considering (strongly) taking a dependency on this to achieve a similar effect! Thanks for making this!

I don't see that there is any support for "partial templates". It would be nice to be able to split up larger templates, especially those which may contain conditional or repetitive sections, into several smaller templates, and have a "master" template reference the partial templates.

(P.S. I know this repo hasn't been updated in a while, so I'm just opening this request so it has visibility. Depending on my time and my project requirements, this may be something I could look into adding—no promises—but, in case anyone else is so inclined, here's the request 😉 )

fourpastmidnight avatar Feb 25 '22 17:02 fourpastmidnight

Have not tried but did you try calling Invoke-EpsTemplate. from a template?

<%= Invoke-EpsTemplate -Template 'PARTIAL... <%= $name %> %>

sytone avatar Apr 10 '22 17:04 sytone