SchlenkR / Trulla

Type Safe Text Templates - usable as type provider (F#) or source generator (C#)
Apache License 2.0
61 stars 0 forks source link

logo

Trulla Templates is like Handlebars or Mustache templates, but statically typed and safe!

NuGet Badge - C# Source Generator

NuGet Badge - F# Type Provider

npm version - Node CLI

The Trulla Approcah

Examples and Usage

Node via CLI

Go to the Node CLI Documentation

C# usage via Source Generators

Go to the C# Documentation

F# usage via Type Providers**

Go to the F# Documentation

General Template Syntax

Have a look at the tests for more samples!

for loops (with separator)

{{for c in chars}}{{c}}{{end}}
{{for x in numbers|;}}{{x.id}}{{end}}

if/else

Order is {{if order.isActive}}active{{else}}closed{{end}}.

How it works internally

Trulla is implemented in F#. It basically contains everything a "real" language has, like

If you want to know more, have a look at the (Internals)[./src/docs/Internals.md].