Kyle Fuller 7b42eb6bec Implement if and ifnot tags
Closes #3
2014-10-26 11:36:55 +00:00
2014-10-26 11:36:55 +00:00
2014-10-26 11:36:55 +00:00
2014-10-23 12:29:09 +01:00
2014-10-23 12:29:09 +01:00
2014-10-25 15:48:54 +01:00

Stencil

Stencil is a simple and powerful template language for Swift. It provides a syntax similar to Django and Jinja2.

Example

There are {{ articles.count }} articles.

{% for article in articles %}
  - {{ article.title }} by {{ article.author }}.
{% endfor %}
let context = Context(dictionary: [
    "articles": [
        [ "title": "Migrating from OCUnit to XCTest", "author": "Kyle Fuller" ],
        [ "title": "Memory Management with ARC", "author": "Kyle Fuller" ],
    ]
])

let template = Template(named: "template.stencil")
let result = template.render(context)

if let error = result.error {
    println("There was an error rendering your template (\(error)).")
}

println("\(result.string)")

License

Stencil is licensed under the BSD license. See LICENSE for more info.

Description
A simple and powerful template language for Swift.
Readme 993 KiB
Languages
Swift 74.6%
HTML 16.6%
Ruby 8.5%
Shell 0.3%