Overview
Cottle is an open-source (MIT) templating engine for C# .NET designed to be light (no external dependency & simple API), fast (see benchmark) and extensible (see advanced features). Cottle language and C# API look like this:
{library} is a great library to {["discover", "learn", "use"][rand(0, 3)]}!
var document = Document.CreateDefault(template).DocumentOrThrow;
return document.Render(Context.CreateBuiltin(new Dictionary<Value, Value>
{
["library"] = "Cottle"
}));
Cottle is a great library to learn!
Getting started
User documentation is available at Read the Docs and explains how to use the library with many code snippets and examples.
Performance benchmark against similar libraries shows how Cottle performs compared to other equivalent template engines.
License
This project is open-source, released under MIT licence. See license page for details.