T. R. Bernstein 6061715025
Some checks failed
CI / macOS (push) Has been cancelled
CI / linux (swift:6.0) (push) Has been cancelled
CI / linux (swift:6.1) (push) Has been cancelled
CI / linux (swift:6.2) (push) Has been cancelled
CI / windows (6.1) (push) Has been cancelled
Adapt project for Astzweig
2025-09-29 15:03:48 +02:00
2025-09-29 15:03:48 +02:00
2025-09-29 15:03:48 +02:00
2021-05-03 15:33:28 +01:00
2024-03-22 12:34:03 +00:00
2021-03-15 18:22:41 +00:00
2025-03-26 09:53:44 +00:00
2025-09-29 15:03:48 +02:00

Swift-Mustache

Package for rendering Mustache templates. Mustache is a "logic-less" templating language commonly used in web and mobile platforms. You can find out more about Mustache here.

Note

This repository is a fork of hummingbird-project/swift-mustache. It may contain modifications required by our other open source tools.

Usage

Load your templates from the filesystem

import Mustache
let library = MustacheLibrary("folder/my/templates/are/in")

This will look for all the files with the extension ".mustache" in the specified folder and subfolders and attempt to load them. Each file is registed with the name of the file (with subfolder, if inside a subfolder) minus the "mustache" extension.

Render an object with a template

let output = library.render(object, withTemplate: "myTemplate")

Swift-Mustache treats an object as a set of key/value pairs when rendering and will render both dictionaries and objects via Mirror reflection. Find out more on how Mustache renders objects here.

Support

Swift-Mustache supports all standard Mustache tags and is fully compliant with the Mustache spec with the exception of the Lambda support.

Additional features

Swift-Mustache includes some features that are specific to its implementation. Please follow the links below to find out more.

Documentation

Reference documentation for swift-mustache can be found here

Description
No description provided
Readme Apache-2.0 350 KiB
Languages
Swift 99.2%
Shell 0.5%
Dockerfile 0.3%