JinianNet.JNTemplate 2.4.3
JNTemplate
JNTemplate is fast, lightweight, extensible .net template engine for generating html, xml, sql, or any other formatted text output.
Special placeholders in the template allow writing code similar to c# syntax. Then the template is passed data to render the final document.
How to use
Install
dotnet add package JinianNet.JNTemplate
Import
using JinianNet.JNTemplate;
var
chsare code:
var text = @"Hello, ${name}";
var template = Engine.CreateTemplate(text);
template.Set("name","jntemplate");
var result = template.Render();
Console.WriteLine(result);
output:
Hello, jntemplate
Iteration
var text = @"
<ul>
${foreach(name in list)}
<li>${name}</li>
${end}
</ul>
";
var template = Engine.CreateTemplate(text);
template.Set("list", new string[] { "github","jntemplate" });
var result = template.Render();
Console.WriteLine(result);
output:
<ul>
<li>github</li>
<li>jntemplate</li>
</ul>
Function
var text = "$test.SayHello(\"jntemplate\")";
var template = Engine.CreateTemplate(text);
template.Set("test", new TestHelper());
var result = template.Render();
Console.WriteLine(result);
public class TestHelper
{
public string SayHello(string name)
{
return "hello " + name;
}
}
output:
hello jntemplate
License
No packages depend on JinianNet.JNTemplate.
.NET Framework 2.0
- No dependencies.
.NET Framework 3.5
- No dependencies.
.NET Framework 4.0
- No dependencies.
.NET Framework 4.6
- No dependencies.
.NET Framework 4.8
- No dependencies.
.NET Core 3.1
- No dependencies.
.NET 5.0
- No dependencies.
.NET 6.0
- No dependencies.
.NET 7.0
- No dependencies.
.NET 8.0
- No dependencies.
.NET 9.0
- No dependencies.
.NET Standard 2.0
- System.Reflection.Emit (>= 4.7.0)
- System.Reflection.Emit.Lightweight (>= 4.7.0)
.NET Standard 2.1
- No dependencies.
| Version | Downloads | Last updated |
|---|---|---|
| 2.4.4 | 0 | 2025/11/21 |
| 2.4.3 | 3 | 2025/7/5 |
| 2.4.2 | 4 | 2025/7/5 |
| 2.4.1 | 4 | 2025/7/5 |
| 2.3.3 | 3 | 2025/7/5 |
| 2.3.2 | 3 | 2025/7/5 |
| 2.3.1 | 4 | 2025/7/5 |
| 2.3.0 | 3 | 2025/7/5 |
| 2.2.5 | 3 | 2025/7/5 |
| 2.2.4 | 3 | 2025/7/5 |
| 2.2.2 | 3 | 2025/7/5 |
| 2.2.0 | 3 | 2025/7/5 |
| 2.1.2 | 3 | 2025/7/5 |
| 2.1.1 | 3 | 2025/7/5 |
| 2.0.1 | 3 | 2025/7/5 |
| 2.0.0 | 3 | 2025/7/5 |
| 1.4.2 | 3 | 2025/7/5 |
| 1.4.1 | 3 | 2025/7/5 |
| 1.4.0 | 3 | 2025/7/5 |
| 1.3.3 | 3 | 2025/7/5 |
| 1.3.2 | 3 | 2025/7/5 |
| 1.3.1 | 3 | 2025/7/5 |
| 1.3.0 | 3 | 2025/7/5 |
| 1.2.2.17 | 2 | 2025/8/27 |
| 1.2.2.4 | 2 | 2025/8/28 |
| 1.2.2 | 3 | 2025/7/5 |
| 1.2.1 | 3 | 2025/7/5 |
| 1.2.0.5 | 2 | 2025/8/28 |
| 1.2.0.2 | 2 | 2025/8/28 |
| 1.2.0.1 | 2 | 2025/8/28 |
| 1.2.0 | 3 | 2025/7/5 |