Summary
Creates a text transformation from the provided template on disc.
- Namespace
- Cake
.Common .Text - Containing Type
- Text
Transformation Aliases
Syntax
[CakeMethodAlias]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "Stream reader leaves stream open.")]
public static TextTransformation<TextTransformationTemplate> TransformTextFile(this ICakeContext context, FilePath path)
Examples
This sample shows how to create a
TextTransformation<TTemplate>
using
the specified template file with the placeholder format <%key%>
.
string text = TransformTextFile("./template.txt")
.WithToken("subject", "world")
.ToString();
Attributes
Type | Description |
---|---|
Cake |
An attribute used to mark script method aliases. |
Suppress |
Parameters
Name | Type | Description |
---|---|---|
context | ICakeContext | The context. |
path | FilePath | The template file path. |
Return Value
Type | Description |
---|---|
TextTransformation |
A TextTransformation<TTemplate> representing the provided template. |