← Winnitude! Search  ·  Reader Mode (891 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 66 LINKS

GitHub - vixcpp/template: Template rendering engine for Vix.cpp

Repository navigation

template
Public

About

Template rendering engine for Vix.cpp

Resources

Readme MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy Activity Custom properties

Stars

2 stars

Watchers

0 watching

Forks

0 forks Report repository
Branches

Tags
Go to Branches page Go to Tags page

Latest commit

 

History


30 Commits
View commit history for this file.

Folders and files

Name Name Last commit message Last commit date
.github/ workflows .github/ workflows    
benchmarks benchmarks    
cmake cmake    
docs docs    
examples examples    
include/ vix/ template include/ vix/ template    
src src    
templates templates    
tests tests    
.gitignore .gitignore    
CHANGELOG.md CHANGELOG.md    
CMakeLists.txt CMakeLists.txt    
CMakePresets.json CMakePresets.json    
CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md    
CONTRIBUTING.md CONTRIBUTING.md    
LICENSE LICENSE    
README.md README.md    
SECURITY.md SECURITY.md    
vix.json vix.json    

Repository files navigation

Vix Template Engine

Vix Template Engine is a minimal, deterministic and high-performance C++ template rendering engine built for real systems.

Designed for predictability , performance , and clarity .


Simple. Deterministic. Fast.

The Vix template engine removes complexity found in traditional template systems.

No magic. No hidden state. Just a clean pipeline:

Loader → Lexer → Parser → AST → Template → Renderer

Example

Template

Hello {{ name }}
{% if user %}Welcome{% endif %}

C++

#include <vix/template/Engine.hpp>

using namespace vix::template_;

int main() {
  Engine engine;

  Context ctx;
  ctx.set("name", "Alice");
  ctx.set("user", true);

  auto result = engine.render_string(
    "Hello {{ name }} {% if user %}Welcome{% endif %}",
    ctx
  );

  std::cout << result.output;
}

Output

Hello Alice Welcome

Features (V1)

  • Variable interpolation
  • If conditions
  • For loops
  • HTML escaping (automatic)
  • AST-based rendering
  • Deterministic execution
  • Optional caching

Syntax

Variables

{{ name }}

Condition

{% if user %}
Hello
{% endif %}

Loop

{% for item in items %}
{{ item }}
{% endfor %}

Why Vix Template Engine

Deterministic

Same input → same output No hidden behavior

Minimal

Only essential features No over-engineering

Performance-first

  • AST reused across renders
  • no dynamic parsing at runtime
  • low allocations

C++ Native

No runtime dependency Full control over memory and performance


Build

cmake --preset dev-ninja
cmake --build --preset build-ninja

Run Examples

./build-ninja/template_basic_render
./build-ninja/template_loops_and_conditions

Benchmarks

./build-ninja/template_render_bench
./build-ninja/template_parse_bench
./build-ninja/template_cache_bench

Architecture

The engine is built on a clean separation of concerns:

  • Loader → source retrieval
  • Lexer → tokenization
  • Parser → AST creation
  • Template → compiled structure
  • Renderer → execution

This makes the system:

  • easy to understand
  • easy to extend
  • easy to optimize

Roadmap

Upcoming features:

  • Filters ({{ name | upper }})
  • Includes
  • Layout inheritance
  • Expression system
  • Compiler optimizations

Philosophy

The goal is not to be complex first.

The goal is to be:

  • correct
  • fast
  • extensible

Contributing

Contributions are welcome.

If you care about modern C++, performance, and real-world systems, this project is for you.


⭐ Star the project if you like the direction.

MIT License

About

Template rendering engine for Vix.cpp

Resources

Readme MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy Activity Custom properties

Stars

2 stars

Watchers

0 watching

Forks

0 forks Report repository

Releases

Packages

Contributors

Languages