You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

Cottle

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Cottle

High performance, light & extensible template engine library for .NET 4.7.2 and above.

2.1.0
nugetNuGet
Version published
Maintainers
2
Created
Source

Cottle: Compact Object to Text Transform Language

Build Status NuGet license

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).

Sample

Hello, {name}!

{if len(messages) > 0:
    You have {len(messages)} new message{if len(messages) > 1:s} in your mailbox!
|else:
    You have no new message.
}
var document = Document.CreateDefault(template).DocumentOrThrow;

return document.Render(Context.CreateBuiltin(new Dictionary<Value, Value>
{
    ["messages"] = GetMessages(),
    ["name"] = "JC Denton"
}));

Resource

Keywords

Template

FAQs

Package last updated on 02 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts