b637c4c4a4af5e9ddc2e81e3b31f3953a42c817d
HummingbirdMustache
Package for rendering Mustache templates. Mustache is a templating language commonly used in server frameworks for generating HTML files (although it is not limited to HTML). You can find out more about Mustache here.
Usage
Load your templates from the filesystem
let library = HBMustacheLibrary("folder/my/templates/are/in")
This will look for all the files with the extension ".mustache" in the specified folder and attempt to load them.
Render an object with a template
let output = library.render(object, withTemplate: "myTemplate")
HummingbirdMustache will render both dictionaries and objects via Mirror reflection. The following two examples will both produce the same output
let object = ["name": "John Smith", "age": 68]
let output = library.render(object, withTemplate: "myTemplate")
and
struct Person {
let name: String
let age: Int
}
let object = Person(name: "John Smith", age: 68)
let output = library.render(object, withTemplate: "myTemplate")
Description
Languages
Swift
99.2%
Shell
0.5%
Dockerfile
0.3%