slang
Version, currently 1.6.127 versions
- 2.0.3latestJan 2, 2026
- 2.0.2not indexedJan 2, 2026
- 2.0.1not indexedJan 2, 2026
- 2.0.0not indexedJan 2, 2026
- 1.7.1not indexedJan 2, 2026
- 1.7.0not indexedJan 2, 2026
- 1.6.1not indexedJan 2, 2026
- 1.6.0not indexedJan 2, 2026
- 1.5.1not indexedJan 2, 2026
- 1.5.0not indexedJan 2, 2026
- 1.4.2not indexedJan 2, 2026
- 1.4.1not indexedJan 2, 2026
- 1.4.0not indexedJan 2, 2026
- 1.3.1not indexedJan 2, 2026
- 1.3.0not indexedJan 2, 2026
- 1.2.0not indexedJan 2, 2026
- 1.1.0not indexedJan 2, 2026
- 1.0.1not indexedJan 2, 2026
- 1.0.0not indexedJan 2, 2026
- 0.2.0not indexedJan 2, 2026
- 0.1.6not indexedJan 2, 2026
- 0.1.5not indexedJan 2, 2026
- 0.1.4not indexedJan 2, 2026
- 0.1.3not indexedJan 2, 2026
- 0.1.2not indexedJan 2, 2026
- 0.1.1not indexedJan 2, 2026
- 0.1.0not indexedJan 2, 2026
github.com/toddsundsted/slang
Slim-inspired templating language for Crystal
7 stars
0 dependents
License: MIT
Nothing has been indexed for 1.6.1 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
slang:
github: toddsundsted/slang
version: ~> 1.6.1Then run:
shards installshard.yml
No shard.yml has been indexed for 1.6.1. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# Slang
[](https://github.com/toddsundsted/slang/actions)
Lightweight, terse, templating language for Crystal. Originally
forked from [jeromegn/slang](https://github.com/jeromegn/slang). Now
with more [Slim](https://github.com/slim-template/slim) compatibility.
## Installation
To install the latest code, add this to your application's `shard.yml`,
or pin it to a [released version](https://github.com/toddsundsted/slang/releases):
```yaml
dependencies:
slang:
github: toddsundsted/slang
branch: main
```
## Usage
### Preferred: use Kilt
[Kilt](https://github.com/jeromegn/kilt) is included as a dependency for this project. It should help integrating non-ECR template engines.
Add this to your application's `shard.yml`:
```yaml
dependencies:
slang:
github: toddsundsted/slang
branch: main
kilt:
github: jeromegn/kilt
```
```
require "kilt/slang"
Kilt.render("path/to/file.slang") #=> <compiled template>
```
Example with [Kemal](http://kemalcr.com) (includes Kilt):
```crystal
require "kilt/slang"
get "/" do
render "path/to/file.slang"
end
```
### Without Kilt
```crystal
String.build do |str|
Slang.embed("path/to/file.slang", "str")
end
```
## Syntax
```slim
doctype html
html
head
meta name="viewport" content="width=device-width,initial-scale=1.0"
title This is a title
css:
h1 {color: red;}
p {color: green;}
style h2 {color: blue;}
body
/! Visible multi-line comment
span this is wrapped in a comment
/[if IE]
p Dat browser is old.
/ Invisible multi-line comment
span this is wrapped in a comment
h1 This is a slang file
h2 This is blue
input type="checkbox" checked=false
input type="checkbox" checked=true
input type="checkbox" checked="checked"
span#some-id.classname
#hello.world.world2
- some_var = "hello world haha"
span
span data-some-var=some_var two-attr="fun" and a #{p("hello")}
span
span.deep_nested
p
| text inside of <p>
= Process.pid
| text node
' other text node
span.alongside pid=Process.pid
custom-tag#with-id pid="#{Process.pid}"
- ["ah", "oh"].each do |s|
span = s
/ This is an invisible comment
#amazing-div some-attr="hello"
/! This is a visible comment
script var num1 = 8*4;
javascript:
var num2 = 8*3;
alert("8 * 3 + 8 * 4 = " + (num1 + num2));
```
Given the context:
```crystal
some_var = "hello"
strings = ["ah", "oh"]
```
Compiles to HTML:
```html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>This is a title</title>
<style>
h1 {color: red;}
p {color: green;}
</style>
<style>h2 {color: blue;}</style>
</head>
<body>
<!--Visible multi-line comment
<span>this is wrapped in a comment</span>
-->
<!--[if IE]>
<p>Dat browser is old.</p>
<![endif]-->
<h1>This is a slang file</h1>
<h2>This is blue</h2>
<input type="checkbox"/>
<input type="checkbox" checked/>
<input type="checkbox" checked="checked"/>
<span id="some-id" class="classname">
<div id="hello" class="world world2">
<span>
<span data-some-var="hello world haha" two-attr="fun">and a hello</span>
<span>
<span class="deep_nested">
<p>
text inside of <p>
</p>
#{Process.pid}
text node
other text node
</span>
</span>
</span>
<span class="alongside" pid="#{Process.pid}">
<custom-tag id="with-id" pid="#{Process.pid}">
<span>ah</span>
<span>oh</span>
</custom-tag>
</span>
</div>
</span>
<div id="amazing-div" some-attr="hello"></div>
<!--This is a visible comment-->
<script>var num1 = 8*4;</script>
<script>
var num2 = 8*3;
alert("8 * 3 + 8 * 4 = " + (num1 + num2));
</script>
</body>
</html>
```
## Contributing
1. Fork it ( https://github.com/toddsundsted/slang/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [jeromegn](https://github.com/jeromegn) Jerome Gravel-Niquet - creator, maintainer
- [toddsundsted](https://github.com/toddsundsted) Todd Sundsted - maintainer of this fork
- [kRaw1er](https://github.com/kRaw1er) Dmitry Neveshkin
- [elorest](https://github.com/elorest) Isaac Sloan
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.6.1- Tagged
- Jan 2, 2026
- Commit
b817c89c7e5a- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/toddsundsted/slang
Metadata
- Created
- Aug 13, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 27