All Projects → whilein → te4j

whilein / te4j

Licence: Apache-2.0 license
Fast and easy template engine

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to te4j

Contemplate
Contemplate: Fast, extendable object-oriented and light-weight Template Engine for PHP, Python, Node.js, Browser and XPCOM/SDK JavaScript
Stars: ✭ 15 (-25%)
Mutual labels:  fast, template-engine
Gorazor
Razor view engine for go
Stars: ✭ 772 (+3760%)
Mutual labels:  fast, template-engine
Quicktemplate
Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template
Stars: ✭ 2,287 (+11335%)
Mutual labels:  fast, template-engine
modulor-html
Missing template engine for Web Components
Stars: ✭ 36 (+80%)
Mutual labels:  template-engine
pixie
Tiny template functions.
Stars: ✭ 14 (-30%)
Mutual labels:  fast
Apex.Serialization
High performance contract-less binary serializer for .NET
Stars: ✭ 82 (+310%)
Mutual labels:  fast
FAST
A GML supplement library for GMS 2.3+
Stars: ✭ 22 (+10%)
Mutual labels:  fast
utils
⚡ A collection of common functions but with better performance, less allocations and less dependencies created for Fiber.
Stars: ✭ 21 (+5%)
Mutual labels:  fast
carbone
Fast and simple report generator, from JSON to pdf, xslx, docx, odt...
Stars: ✭ 810 (+3950%)
Mutual labels:  template-engine
discord-economy-super
Easy and customizable economy module for your Discord bot.
Stars: ✭ 28 (+40%)
Mutual labels:  fast
base64.c
Base64 Library in C
Stars: ✭ 60 (+200%)
Mutual labels:  fast
pypugjs
PugJS syntax adapter for Django, Jinja2 and Mako templates
Stars: ✭ 237 (+1085%)
Mutual labels:  template-engine
gender-render
Template-system and proof-of-concept for rendering gender-neutral text-, email- and RPG-text-templates with the correct pronouns of all people involved.
Stars: ✭ 21 (+5%)
Mutual labels:  template-engine
esh
Simple templating engine based on shell.
Stars: ✭ 165 (+725%)
Mutual labels:  template-engine
ByteCopy
Simple C99 program and API for copying files.
Stars: ✭ 16 (-20%)
Mutual labels:  fast
HTML-templating-with-Google-Apps-Script
Use data from your spreadsheets to build a webpage or a client-side app ✨
Stars: ✭ 55 (+175%)
Mutual labels:  template-engine
Tkinter-Designer
An easy and fast way to create a Python GUI 🐍
Stars: ✭ 4,697 (+23385%)
Mutual labels:  fast
skmeans
Super fast simple k-means implementation for unidimiensional and multidimensional data.
Stars: ✭ 59 (+195%)
Mutual labels:  fast
Fuga-Framework
Web Framework for Java
Stars: ✭ 15 (-25%)
Mutual labels:  template-engine
text-classification-baseline
Pipeline for fast building text classification TF-IDF + LogReg baselines.
Stars: ✭ 55 (+175%)
Mutual labels:  fast

Te4j

About the project

Te4j (Template Engine For Java) - Fastest and easy template engine

Pros

  • Extremely fast (132k renders per second on 4790K)
  • Easy and simple syntax
  • No dependencies

Cons (temporary)

  • No community :(
  • Sometimes awful code
  • Poor documentation

Benchmarks

Click me

Example

index.html

<p>Message: {{ message }}</p>

Main.java

public class Main {
    public static void main(String[] args) {
         Pojo pojo = new Pojo();
         Template<Pojo> template = Te4j.load(Pojo.class).from("index.html");
         
         String result = template.renderAsString(pojo);
         System.out.println(result); // <p>Message: Hello world!</p>
    }

    public static class Pojo {
        public String getMessage() {
            return "Hello world!";
        }
    }
}

Also, you are able to create custom template context

TemplateContext ctx = Te4j.custom()
        // deletes repeating spaces, tabs, crlf from output
        .minify(Minify.DEL_CF, Minify.DEL_LF, Minify.DEL_TABS, Minify.DEL_REPEATING_SPACES)
        // .minify(Minify.getValues())
        // .minifyAll()

        // you can choose which output type will be used
        //
        // BYTES - renderAsBytes and renderTo will be optimized
        // STRING - renderAsString will be optimized
        .output(Output.BYTES, Output.STRING)
        // .output(Output.getValues())
        // .outputAll()

        // btw you can enable hot reloading
        //
        // it does not impact performance,
        // but I recommend disabling it in production
        // for max. performance
        .enableAutoReloading()
        .build();

Template<Pojo> template = ctx.load(Pojo.class).from("index.html");

More examples in docs

Full Docs

Click me

Add as dependency

Maven

<dependencies>
    <dependency>
        <groupId>io.github.whilein</groupId>
        <artifactId>te4j</artifactId>
        <version>1.1</version>
    </dependency>
</dependencies>

Gradle

dependencies {
    implementation 'io.github.whilein:te4j:1.1'
}

Build the project

  1. Execute ./gradlew build
  2. Output file located at build/libs/te4j.jar

Contact

Vkontakte, Telegram

Post Scriptum

I will be very glad if someone can help me with development.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].