Score
0
Watch 29 Star 45 Fork 9

翅膀的初衷 / jntemplateC#

Join us
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
C#开发的文本解析引擎(模板引擎),简单,易用!支持.net core/.net framework/mono! spread retract

http://www.jiniannet.com

  • C# 92.2%
  • CSS 2.6%
  • HTML 2.3%
  • Batchfile 1.5%
  • Shell 1.2%
  • Other 0.2%
Clone or download
Loading...
README.md

JNTemplate

Build Status GitHub stars GitHub stars GitHub license GitHub issues

English | 中文

What is JNTemplate?

JNTemplate is a .net template engine for generating html, xml, sql, or any other formatted text output.

Features:

  • Easy to learn
  • Easy to use
  • Easy to expand
  • 100% free

Quickstart

Get it on NuGet!

PM> Install-Package JinianNet.JNTemplate

or

> dotnet add package JinianNet.JNTemplate

Building the source


git clone https://github.com/jiniannet/jntemplate.git

Windows:After cloning the repository, run build/build.bat

Linux:After cloning the repository, run build/build.sh

Configuration

You can configure JNTemplate with the EngineConfig class.

var conf = Configuration.EngineConfig.CreateDefault();
// .. configure your instance
Engine.Configure(conf);

Basic Example

template code(index.html):

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>JNTemplate deomo</title>
  </head>
  <body>
      hello,$name!
  </body>
</html>

c# code:

var template = (Template)Engine.LoadTemplate("C:\\wwwwroot\index.html");
\\(Template)Engine.CreateTemplate("hello,$name!");
template.Set("name", "JNTemplate");
var result = template.Render(); 

output:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>JNTemplate deomo</title>
  </head>
  <body>
      hello,JNTemplate!
  </body>
</html>

API

see: www.jiniannet.com

Licenses

MIT

Comments ( 0 )

Sign in for post a comment

C#
1
https://gitee.com/jiniannet/jntemplate.git
git@gitee.com:jiniannet/jntemplate.git
jiniannet
jntemplate
jntemplate
master

Help Search

205735 778617b6 1899542 205747 347fc4a1 1899542