Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: predefine custom template functions #10

Open
buehler opened this issue Feb 14, 2021 · 2 comments
Open

feat: predefine custom template functions #10

buehler opened this issue Feb 14, 2021 · 2 comments
Labels
enhancement New feature or request status:future We plan to work on this in the future

Comments

@buehler
Copy link

buehler commented Feb 14, 2021

Is your feature request related to a problem? Please describe.
Since the template language allows custom inline / simple and more advanced functions, it would be cool to
have some "general" way of adding template functions. (For example generate UUIDv4)

Describe the solution you'd like
It could be like "environment", a way of adding various functions to the templating language.
They should be prepended to any templating execution to have "global" custom functions.

@buehler buehler added the enhancement New feature or request label Feb 14, 2021
@CommonGuy
Copy link
Contributor

We like the idea of defining custom template functions per project to allow reuse and plan to implement this in the future.

Support for UUIDv4 will hopefully be added to the template language directly, so this may be supported much sooner.

@CommonGuy CommonGuy added the status:future We plan to work on this in the future label Feb 16, 2021
@CommonGuy
Copy link
Contributor

CommonGuy commented Apr 9, 2021

Kreya 1.3.0 (released just now) ships the newest version of Scriban, which supports the math.uuid function: https://github.com/scriban/scriban/blob/master/doc/builtins.md#mathuuid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request status:future We plan to work on this in the future
Projects
None yet
Development

No branches or pull requests

2 participants