Celplate provides an elegant way to template files using the Common Expression Language (CEL). The package comes with all the batteries included: a generic scanner and a single (CEL) evaluator for it.
By default the scanner assumes that any block of text that start with ${{
is a special input block
which has to be evaluated and must end with }}
, example:
${{ inputs.serial }}
Too see the library in action, checkout the end to end test for it.
Note that the current implementation does not support escaping the special input block.
We've added ext/Strings extensions to the CEL evaluator. This includes a bunch of useful methods, such as charAt
, indexOf
, join
, split
, replace
, trim
etc.
To create a new release just create a new tag with a v
prefix and push it to main. For more details checkout the go docs on publishing modules.