5a2f22df4feca43d67da95ad02dc1c47c776d9ce
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%