From c5a363950f08d70608c7e69b53289acdec4b232d Mon Sep 17 00:00:00 2001 From: Mikayla Hutchinson Date: Mon, 2 Oct 2023 17:02:22 -0400 Subject: [PATCH 1/2] Fix some packaging issues --- Mono.TextTemplating.Build/Mono.TextTemplating.Build.csproj | 2 ++ Mono.TextTemplating.Roslyn/Mono.TextTemplating.Roslyn.csproj | 1 - dotnet-t4/dotnet-t4.csproj | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Mono.TextTemplating.Build/Mono.TextTemplating.Build.csproj b/Mono.TextTemplating.Build/Mono.TextTemplating.Build.csproj index ab1cf0b..2296357 100644 --- a/Mono.TextTemplating.Build/Mono.TextTemplating.Build.csproj +++ b/Mono.TextTemplating.Build/Mono.TextTemplating.Build.csproj @@ -11,6 +11,7 @@ buildTasks true en-US + readme.md @@ -30,6 +31,7 @@ + diff --git a/Mono.TextTemplating.Roslyn/Mono.TextTemplating.Roslyn.csproj b/Mono.TextTemplating.Roslyn/Mono.TextTemplating.Roslyn.csproj index b0808a8..5b47239 100644 --- a/Mono.TextTemplating.Roslyn/Mono.TextTemplating.Roslyn.csproj +++ b/Mono.TextTemplating.Roslyn/Mono.TextTemplating.Roslyn.csproj @@ -7,7 +7,6 @@ In-process Roslyn compiler for the Mono.TextTemplating T4 templating engine readme.md true - true diff --git a/dotnet-t4/dotnet-t4.csproj b/dotnet-t4/dotnet-t4.csproj index ac73fe4..60604a4 100644 --- a/dotnet-t4/dotnet-t4.csproj +++ b/dotnet-t4/dotnet-t4.csproj @@ -9,6 +9,7 @@ t4 Mono.TextTemplating readme.md + true From 52e3f3646f0c23eb67a978281a528f4077626613 Mon Sep 17 00:00:00 2001 From: Mikayla Hutchinson Date: Mon, 2 Oct 2023 17:45:04 -0400 Subject: [PATCH 2/2] Fix preprocessed template sample in READNE Fixes #158 --- dotnet-t4/readme.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dotnet-t4/readme.md b/dotnet-t4/readme.md index ea051a3..f3b62a3 100644 --- a/dotnet-t4/readme.md +++ b/dotnet-t4/readme.md @@ -38,7 +38,13 @@ Number | Square | Cube Alternatively, invoking `t4 powers.tt -c MyApp.Powers` will produce a `powers.cs` file containing the runtime template class, which you can compile into your app and execute at runtime with new parameter values: ```csharp -string powersTableMarkdown = new MyApp.Powers { Max = 10 }.Process(); +var template = new MyApp.Powers { + Session = new Dictionary { + { "Max", 10 } + } +}; +template.Initialize(); +string powersTableMarkdown = template.TransformText(); ``` To learn more about the T4 language, see the [Visual Studio T4 documentation](https://learn.microsoft.com/en-us/visualstudio/modeling/writing-a-t4-text-template?view=vs-2022).