Embedded Crystal is a template language created in 2016.
#101on PLDB | 8Years Old | 287Repos |
git clone https://github.com/crystal-lang/crystal/
Embedded Crystal (ECR) is a template language for embedding Crystal code into other text, that includes but is not limited to HTML. The template is read and transformed at compile time and then embedded into the binary.
# greeting.ecr
<%- if @name -%>
Greeting, <%= @name %>!
<%- else -%>
Greeting!
<%- end -%>
Greeting.new(nil).to_s #=> Greeting!
<% if @name %>
Greeting, <%= @name %>!
<% else %>
Greeting!
<% end %>
Feature | Supported | Example | Token |
---|---|---|---|
Comments | ✓ | # A comment | |
Line Comments | ✓ | # A comment | # |
Semantic Indentation | X |