An open API service indexing awesome lists of open source software.

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

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




Thanks for using Slick!

```