All Projects → mitsuhiko → minijinja

mitsuhiko / minijinja

Licence: Apache-2.0 license
MiniJinja is a powerful but minimal dependency template engine for Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to minijinja

Jinja
A very fast and expressive template engine.
Stars: ✭ 8,170 (+1412.96%)
Mutual labels:  jinja2, templates
Cookie
A Template-based File Generator. Like cookiecutter but works with file templates instead of project templates.
Stars: ✭ 261 (-51.67%)
Mutual labels:  jinja2, templates
Jinja2cpp
Jinja2 C++ (and for C++) almost full-conformance template engine implementation
Stars: ✭ 257 (-52.41%)
Mutual labels:  jinja2, templates
pyLODE
An OWL ontology documentation tool using Python and templating, based on LODE
Stars: ✭ 116 (-78.52%)
Mutual labels:  jinja2, templates
OSCE
Some exploits, which I’ve created during my OSCE preparation.
Stars: ✭ 74 (-86.3%)
Mutual labels:  templates
Flask-QRcode
A concise Flask extension to easily render QR codes on Jinja2 templates using python-qrcode.
Stars: ✭ 89 (-83.52%)
Mutual labels:  jinja2
pipen
pipen - A pipeline framework for python
Stars: ✭ 82 (-84.81%)
Mutual labels:  jinja2
Prism-Templates
Prism Templates using the DotNet New cli
Stars: ✭ 13 (-97.59%)
Mutual labels:  templates
Pode.Web
Web template framework for use with the Pode PowerShell web server
Stars: ✭ 83 (-84.63%)
Mutual labels:  templates
layouts
Wraps templates with layouts. Layouts can use other layouts and be nested to any depth. This can be used 100% standalone to wrap any kind of file with banners, headers or footer content. Use for markdown, HTML, handlebars views, lo-dash templates, etc. Layouts can also be vinyl files.
Stars: ✭ 28 (-94.81%)
Mutual labels:  templates
flexible-templates
Allows saving templates of the "Flexible Content" field, for easy and fast use of them on other pages.
Stars: ✭ 36 (-93.33%)
Mutual labels:  templates
web-7.0
The freenode website, home to our blog, knowledge base and policies
Stars: ✭ 112 (-79.26%)
Mutual labels:  jinja2
opendocs
Documentation resources
Stars: ✭ 46 (-91.48%)
Mutual labels:  templates
marketplace-feedback
This repository is for feedback regarding NativeScript Marketplace. Use the issues system here to submit feature requests, vote for existing ones or report bugs.
Stars: ✭ 16 (-97.04%)
Mutual labels:  templates
django-renderpdf
📄 A Django app to render django templates as PDF files.
Stars: ✭ 37 (-93.15%)
Mutual labels:  templates
quickstart-docker-git
Boostrap projects with a Dockerfile and a folder structure that works.
Stars: ✭ 47 (-91.3%)
Mutual labels:  templates
vtex-cms-sauce
VTEX package for handling CMS requests.
Stars: ✭ 25 (-95.37%)
Mutual labels:  templates
cent
Community edition nuclei templates, a simple tool that allows you to organize all the Nuclei templates offered by the community in one place
Stars: ✭ 315 (-41.67%)
Mutual labels:  templates
CP-Templates
Competitive Programming Templates
Stars: ✭ 28 (-94.81%)
Mutual labels:  templates
jinja2-time
📆 Jinja2 Extension for Dates and Times
Stars: ✭ 64 (-88.15%)
Mutual labels:  jinja2

MiniJinja: a powerful template engine for Rust with minimal dependencies

Build Status License Crates.io rustc 1.43.0 Documentation

MiniJinja is a powerful but minimal dependency template engine for Rust which is based on the syntax and behavior of the Jinja2 template engine for Python.

It's implemented on top of serde and only has it as a single dependency. It supports a range of features from Jinja2 including inheritance, filters and more. The goal is that it should be possible to use some templates in Rust programs without the fear of pulling in complex dependencies for a small problem. Additionally it tries not to re-invent something but stay in line with prior art to leverage an already existing ecosystem of editor integrations.

Example Template

{% extends "layout.html" %}
{% block body %}
  <p>Hello {{ name }}!</p>
{% endblock %}

API

use minijinja::{Environment, context};

fn main() {
    let mut env = Environment::new();
    env.add_template("hello.txt", "Hello {{ name }}!").unwrap();
    let template = env.get_template("hello.txt").unwrap();
    println!("{}", template.render(context! { name => "World" }).unwrap());
}

Minimum Rust Version

MiniJinja supports Rust versions down to 1.43 at the moment. For the order preservation feature Rust 1.49 is required as it uses the indexmap dependency which no longer supports older Rust versions.

Note that we currently cannot run tests against 1.43.0 due to our tests depending on insta which in turn also depends on indexmap.

Sponsor

If you like the project and find it useful you can become a sponsor.

License and Links

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].