Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 2.58 KB

File metadata and controls

44 lines (29 loc) · 2.58 KB

PosInformatique.Foundations.Text.Templating

NuGet version NuGet downloads

Introduction

This package provides a small abstraction to generate text from templates, independently of the underlying templating engine.

It defines the TextTemplate<TModel> base class and the ITextTemplateRenderContext interface, which can be implemented by concrete template engines.

Currently only the following text engine implementation are provided in PosInformatique.Foundations:

Install

You can install the package from NuGet:

dotnet add package PosInformatique.Foundations.Text.Templating

Features

  • Abstraction to represent a text template with a strongly-typed model: TextTemplate<TModel>
  • Asynchronous rendering API through RenderAsync
  • Pluggable rendering context via ITextTemplateRenderContext to access services during template execution
  • Engine-agnostic design: can be used with different template engines (Razor, etc.)

Usage

This package only provides the abstraction (base classes and interfaces). To actually render templates using Razor components, use one of the dedicated implementation package:

Links