https://github.com/opensourceame/slick-template
A template engine that mimics the syntax from Ruby's Slim language
https://github.com/opensourceame/slick-template
html5 template-engine
Last synced: 3 months ago
JSON representation
A template engine that mimics the syntax from Ruby's Slim language
- Host: GitHub
- URL: https://github.com/opensourceame/slick-template
- Owner: opensourceame
- License: mit
- Created: 2024-07-10T08:06:24.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-07-31T10:40:36.000Z (over 1 year ago)
- Last Synced: 2024-07-31T11:57:40.981Z (over 1 year ago)
- Topics: html5, template-engine
- Language: Elixir
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slick-template
A template engine that mimics the syntax from Ruby's Slim language
#### Example Template
```slim
doctype strict
html
head
title My HTML title
stylesheet src='/some.css'
javascript:
console.log('embedded JS inside the template');
body
css:
.alert { color: 'red'; }
.menu-bar
- if user.logged_in
img src={user.profile.image_path}
- else
a#login-button.btn.btn-primary href={login_path} Login
.alert
h1 {greeting}
p.exciting This is the first ever Elixir Slick Template
h2#member-list Members
form
input type='checkbox' disabled=True checked=True
p
ul
- for user in users
li
/ code comment - show the user's names. This line will not render.
span {user.first_name} {user.last_name}
/! render the footer
#footer Thanks for using Slick!
```
#### Rendered HTML
Trim-Template will render the above template into HTML, as below:
```html
My HTML title
console.log('embedded JS inside the template');
.alert { color: 'red'; }
Hello World!
This is the first ever Elixir Slick Template
Members
-
Stephen Colbert
-
Bob Marley
-
Charlie Chaplin
```