Description
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.
JNTemplate alternatives and similar packages
Based on the "Template Engine" category.
Alternatively, view jntemplate alternatives based on common mentions on social networks and blogs.
-
SmartFormat.NET
A lightweight text templating library written in C# which can be a drop-in replacement for string.Format -
MaltReport
A WYSIWYG document template engine to generates .odt/.ods/docx/xlsx/doc/xls documents for .NET
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of JNTemplate or a related project?
README
JNTemplate
What is 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.
Installation
Install and update using NuGet:
PM> Install-Package JinianNet.JNTemplate
or
> dotnet add package JinianNet.JNTemplate
Quickstart
Basics
Rendering a basic html template with a predefined data model.
c# code
var template = Engine.LoadTemplate(@"c:\wwwroot\view\index.html"); ;
template.Set("name", "jntemplate");
var result = template.Render();
index.html
<!DOCTYPE html>
<html>
<body>
<h1>Hello, ${name}</h1>
</body>
</html>
output:
<!DOCTYPE html>
<html>
<body>
<h1>Hello, jntemplate</h1>
</body>
</html>
Iteration
Iteration is achieved by using the foreach binding on the element you wish to iterate.
c# code
var template = Engine.LoadTemplate(@"c:\wwwroot\view\view.html"); ;
template.Set("list", new string[] { "github","jntemplate" });
var result = template.Render();
view.html
<ul>
${foreach(name in list)}
<li>${name}</li>
${end}
</ul>
output:
<ul>
<li>github</li>
<li>jntemplate</li>
</ul>
Configuration
You can configure JNTemplate with the IOptions
class.
Engine.Configure((options)=>{
// .. configure your instance
});
Links
- Website: https://www.jiniannet.com
- Documentation: https://docs-en.jiniannet.com
- Code: https://github.com/jiniannet/jntemplate
Licenses
MIT
*Note that all licence references and agreements mentioned in the JNTemplate README section above
are relevant to that project's source code only.