riok / Kreya

Kreya is a GUI client for gRPC and REST APIs with innovative features for environments, authorizations and more.
https://kreya.app
279 stars 5 forks source link

feat: predefine custom template functions #10

Open buehler opened 3 years ago

buehler commented 3 years ago

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.

CommonGuy commented 3 years ago

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 commented 3 years ago

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