refactor: Introducing Environments

This commit is contained in:
Kyle Fuller
2016-12-01 00:17:04 +00:00
parent 2be672c6a5
commit 9e2a061795
27 changed files with 289 additions and 91 deletions

View File

@@ -17,17 +17,19 @@ feel right at home with Stencil.
.. code-block:: swift
struct Article {
let title: String
let author: String
}
import Stencil
let context = Context(dictionary: [
struct Article {
let title: String
let author: String
}
let context = [
"articles": [
Article(title: "Migrating from OCUnit to XCTest", author: "Kyle Fuller"),
Article(title: "Memory Management with ARC", author: "Kyle Fuller"),
]
])
]
do {
let template = try Template(named: "template.html")