StubbleOrg / Stubble

Trimmed down {{mustache}} templates in .NET
Other
405 stars 58 forks source link

how to change syntax ? #87

Closed yuzd closed 4 years ago

yuzd commented 4 years ago

can i

change

{{ }}

to

<%= %>

Romanx commented 4 years ago

Hi there,

When configuring your renderer as defined in the getting started guide here you can call the method SetDefaultTags which takes an object allowing you to define the tags. This would look like this:

var stubble = new StubbleBuilder()
  .Configure(settings => {
    settings.SetDefaultTags(new Tags("<%", "%>"));
  })
  .Build();

Another option is to use the Set Delimiter tag in your template like this: {{=<% %>=}}

Hope that helps,

yuzd commented 4 years ago

thanks