Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Build Status Platforms Package Managers

Blog Twitter Czechboy0

Very basic Swift templating engine. macOS and Linux ready.

Templater is a very simple tool aimed at solving the simple task: in a string template, fill in a few variables with certain values. Something like Stencil or Mustache. Just a super simple version of them.

❓ Why?

I needed to fill in a large markdown file with fresh data every day, to generate a pretty report. The existing libraries seemed like an overkill for the simple usecase, so I wrote a lightweight (literally less than 100 lines of code) solution myself.

πŸš€ Features

The template string must contain one or more strings like {{ variable_name }}, such as Hello, {{ name }}!. When you render this template with the context of name = "world", you'll get Hello, world!.

πŸ”¨ Usage

do {
	//create the template
	let template = Template("Hello, {{ name }}! Today is {{ day }} and it will be {{ weather }}.")

	//have your context
	let context = [
		"name": "Tim",
		"day": "Thursday",
		"weather": "sunny"

	//render the context
	let result = try template.fill(with: context)

	//result: "Hello, Tim! Today is Thursday and it will be sunny."
} catch {
	print("Template error: \(error)")


Swift Package Manager

.Package(url: "", majorVersion: 0, minor: 2)

πŸ’™ Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

πŸ’ Contributing

Please create an issue with a description of your problem or open a pull request with a fix.

✌️ License


πŸ‘½ Author

Honza Dvorsky -, @czechboy0