Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mono/t4
T4 text templating engine
https://github.com/mono/t4
Last synced: 3 days ago
JSON representation
T4 text templating engine
- Host: GitHub
- URL: https://github.com/mono/t4
- Owner: mono
- License: other
- Created: 2017-03-16T22:13:37.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-09-03T22:33:03.000Z (2 months ago)
- Last Synced: 2024-11-04T11:45:34.577Z (7 days ago)
- Language: C#
- Size: 781 KB
- Stars: 393
- Watchers: 22
- Forks: 101
- Open Issues: 52
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: code_of_conduct.md
Awesome Lists containing this project
- stars - mono/t4
README
# Mono.TextTemplating
[![Build](https://github.com/mono/t4/actions/workflows/build.yml/badge.svg)](https://github.com/mono/t4/actions/workflows/build.yml) [![NuGet version (dotnet-t4)](https://img.shields.io/nuget/v/dotnet-t4.svg?style=flat-square)](https://www.nuget.org/packages/dotnet-t4)
T4 templates are a simple general-purpose way to use C# to generate any kind of text or code files.
[`Mono.TextTemplating`](https://github.com/mono/t4) 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](https://www.nuget.org/packages/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.
```bash
$ 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](dotnet-t4/readme.md).
For advanced use, the engine itself is available as a package called [Mono.TextTemplating](https://www.nuget.org/packages/Mono.TextTemplating) that can be embedded in an app. For details, see the [Mono.TextTemplating package readme](Mono.TextTemplating/readme.md).