Summary
Creates a text transformation from the provided template on disc, using the specified placeholder.
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, string leftPlaceholder, string rightPlaceholder)
Examples
This sample shows how to create a
TextTransformation<TTemplate> using
the specified template file and placeholder.
string text = TransformTextFile("./template.txt", "{", "}")
.WithToken("subject", "world")
.ToString();
Attributes
Parameters
| Name |
Type |
Description |
| context |
ICakeContext |
The context. |
| path |
FilePath |
The template file path. |
| leftPlaceholder |
string |
The left placeholder. |
| rightPlaceholder |
string |
The right placeholder. |
Return Value