-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExamples.cs
More file actions
35 lines (25 loc) · 914 Bytes
/
Copy pathExamples.cs
File metadata and controls
35 lines (25 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Text;
namespace Cutout.Sample;
public static partial class Examples
{
[Template("This is a very simple example")]
public static partial void Test(this StringBuilder builder);
#region ParameterExample
[Template("This is a very simple example with a {{parameter}} parameter")]
public static partial void Test2(this StringBuilder builder, string parameter);
#endregion
#region ExampleWithConditionAndConstTemplate
private const string TemplateExample = """
A multi-line template example
with a {{parameter}} parameter.
It also has a conditional section,
{%- if parameter == "INVALID" -%}
show this text
{%- else -%}
show this text instead
{%- end -%}
""";
[Template(TemplateExample)]
public static partial void Test3(this StringBuilder builder, string parameter);
#endregion
}