A Makeup lexer for Google's Common Expression Language (CEL).
Provides syntax highlighting for CEL expressions in ExDoc, Livebook, and any tool that uses the Makeup highlighting pipeline.
Installation
Add makeup_cel to your list of dependencies in mix.exs:
def deps do
[
{:makeup_cel, "~> 0.1.0"}
]
endUsage
ExDoc
CEL code blocks are highlighted automatically once the dependency is added:
```cel
request.auth.claims.email.endsWith("@example.com")
```Standalone
Makeup.highlight("x > 10 ? 'big' : 'small'", lexer: Makeup.Lexers.CelLexer)Supported syntax
Covers the full CEL lexical spec:
- Keywords:
true,false,null,in - Reserved words:
as,break,const,continue,else,for,function,if,import,let,loop,package,namespace,return,var,void,while - Literals: integers, unsigned integers, hex integers, floats, strings (single/double/triple-quoted), raw strings, bytes literals
- Operators:
+,-,*,/,%,<,<=,>=,>,==,!=,&&,||,! - Comments:
// single-line - Builtin functions and type names
License
Apache-2.0 — see LICENSE.