Muonroi.Templating.Abstractions 2.0.2

dotnet add package Muonroi.Templating.Abstractions --version 2.0.2
                    
NuGet\Install-Package Muonroi.Templating.Abstractions -Version 2.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Muonroi.Templating.Abstractions" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Muonroi.Templating.Abstractions" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Muonroi.Templating.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Muonroi.Templating.Abstractions --version 2.0.2
                    
#r "nuget: Muonroi.Templating.Abstractions, 2.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Muonroi.Templating.Abstractions@2.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Muonroi.Templating.Abstractions&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Muonroi.Templating.Abstractions&version=2.0.2
                    
Install as a Cake Tool

Muonroi.Templating.Abstractions

Abstract definitions and contracts for template rendering engines within the Muonroi ecosystem.

NuGet License

Overview

Muonroi.Templating.Abstractions provides the core interfaces required for template rendering within the Muonroi Building Blocks architecture. It abstracts away the underlying templating engine implementation (like Scriban, Liquid, or Razor), allowing developers to rely on standard contracts throughout their codebase without tightly coupling to any specific rendering technology.

This package is designed for library authors building components that require dynamic content generation, such as email dispatchers, document generators, and notification systems, enabling seamless substitution of the templating engine at the application composition root.

By relying on this abstraction, the wider Muonroi ecosystem guarantees that rendering is handled predictably and interchangeably. It promotes the SOLID principles, specifically the Dependency Inversion Principle, where high-level modules (your business logic) do not depend on low-level modules (the rendering engine), but both depend on abstractions.

Ecosystem Combinations

Works great standalone. Becomes significantly more powerful when combined.

+ Templating.Scriban → Scriban implements ITemplateEngine; swap without changing calling code

Muonroi.Templating.Scriban provides the robust implementation. Simply swap your DI registration to change engines without touching your application logic.

+ Pdf → Templating renders HTML templates; Pdf renders the HTML to PDF

By combining with Muonroi.Pdf, you can use ITemplateEngine to construct a dynamic HTML string, then pipe it into the PDF layout engine to generate rich reports.

+ Tenancy → Per-tenant template resolution: different tenants get different templates

Using Muonroi.Tenancy, you can dynamically select which template string to render based on ITenantContext.CurrentTenantId.

+ Caching → Template compilation results cached: GetOrSetAsync("tpl:{name}", () ⇒ engine.CompileAsync(...))

Integrate Muonroi.Caching.Abstractions to cache the compiled AST of your templates for blazing fast execution.

Full Stack

builder.Services.AddSingleton<ITemplateEngine, ScribanTemplateEngine>();
builder.Services.AddMPdfService();
builder.Services.AddTenantContext();

Installation

dotnet add package Muonroi.Templating.Abstractions

Samples

  • samples/PdfGeneration/ - HTML to PDF generation using templates.
  • samples/MultiTenantSaaS/ - Per-tenant template resolution.

License

Apache 2.0 — see LICENSE-APACHE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Muonroi.Templating.Abstractions:

Package Downloads
Muonroi.RuleEngine.Runtime

Runtime orchestration layer for Muonroi RuleEngine, providing execution pipelines and integration points for rule evaluation services.

Muonroi.RuleEngine.Proliferation

Rule Proliferation Engine — AI-driven neuron scenario generation and execution for Muonroi RuleEngine.

Muonroi.Templating.Scriban

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.2 386 8/26/2026