Skip to content

mono/t4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e128cfc · Sep 3, 2024
Oct 1, 2023
Oct 12, 2023
Feb 28, 2024
Jan 24, 2024
Jan 26, 2024
Jan 25, 2024
Feb 28, 2024
Oct 1, 2023
Oct 6, 2022
Oct 3, 2023
Oct 1, 2023
Jan 26, 2022
Oct 3, 2022
Oct 12, 2023
Dec 5, 2019
Oct 1, 2023
Jan 26, 2022
Oct 5, 2022
Mar 17, 2017
Apr 10, 2020
Feb 23, 2021
Sep 3, 2024

Repository files navigation

Mono.TextTemplating

Build NuGet version (dotnet-t4)

T4 templates are a simple general-purpose way to use C# to generate any kind of text or code files.

Mono.TextTemplating started out as an open-source reimplementation of the Visual Studio T4 text templating engine, but has since evolved to have many improvements over the original, including support for C# 10 and .NET 6.

The dotnet-t4 tool can be used either to process T4 templates directly, or preprocess them into runtime template classes that can be included in your app and processed at runtime.

$ dotnet tool install -g dotnet-t4
$ echo "<#@ parameter name='Name' #>Hello <#=Name#>" | t4 -o - -p:Name=World
Hello World

To learn more, see the dotnet-t4 readme.

For advanced use, the engine itself is available as a package called Mono.TextTemplating that can be embedded in an app. For details, see the Mono.TextTemplating package readme.