RepositoryC#CNChina
jiniannet

jiniannet/jntemplate

jntemplate is an fast and lightweight html templating engine for C# .NET.

156stars
43forks
1issues
1views

JNTemplate

Build status GitHub stars GitHub stars GitHub license GitHub issues

English | 中文

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




  <h1>Hello, ${name}</h1>


output:




  <h1>Hello, jntemplate</h1>


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
});

Licenses

MIT

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
pantor/inja

A Template Engine for Modern C++

2.0k
Nov 18, 2026
RepositoryJavaScript
nextapps-de/mikado

The fastest template library/engine for building web-based user interfaces and apps.

853
Nov 13, 2026
RepositoryC++
jinja2cpp/Jinja2Cpp

Jinja2 C++ (and for C++) almost full-conformance template engine implementation

602
Nov 30, 2026
RepositoryJavaScript
twbs/bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

175.1k
Dec 1, 2026
RepositoryC#
scriban/scriban

A fast, powerful, safe and lightweight scripting language and engine for .NET

4.0k
Nov 22, 2026
RepositoryC#
Dotnet-Boxed/Templates

.NET project templates with batteries included, providing the minimum amount of code required to get you going faster.

3.5k
Nov 11, 2026
RepositoryPython
pallets/jinja

A very fast and expressive template engine.

11.8k
Jun 14, 2025
RepositoryPHP
twigphp/Twig

Twig, the flexible, fast, and secure template language for PHP

8.4k
Nov 24, 2026
RepositoryGo
Masterminds/sprig

Useful template functions for Go templates.

4.8k
Jul 18, 2025