Skip to content

spacelift-io/celplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

celplate

Test

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.

Extensions

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.

Releasing

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.