layout | title | nav_order | description | permalink |
---|---|---|---|---|
default |
Home |
1 |
Powerful text template engine for your C++ project! |
/ |
{: .no_toc } {: .fs-9 }
Jinja2C++ is a modern C++ implementation of the Python's Jinja2 template engine.
This project was inspired by Jinja2CppLight library.
{: .fs-6 .fw-300 }
{: .no_toc }
- Library supports C++14/17/20;
- Supports mainstream compilers (Visual C++, gcc, clang);
- Easy-to-use interface/Great UI;
- Conformance to Jinja2 specification;
- Partial support for both narrow- and wide-character strings both for templates and parameters;
- Built-in reflection for C++ types and popular json libraries (nlohmann and rapid);
- Powerful full-featured Jinja2 expressions with filtering (via '|' operator) and 'if'-expressions;
- Control flow statements ('set', 'filter', 'for', 'if', 'do', 'with');
- Templates extension ('extends', 'block');
- Templates reuse ('include', 'import', 'from');
- Macros ('macro', 'call');
- Rich error reporting;
- Shared template enironment with templates cache support.
View it on GitHub{: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } View it on Conan{: .btn .fs-5 .mb-4 .mb-md-0 }
{: .no_toc }
The simplest way: to get the latest conan.io package: jinja2cpp/1.2.1
Or follow the build and install instructions
{: .no_toc }
Jinja2C++ is © 2018-{{ "now" | date: "%Y" }} by Flex Ferrum and Ruslan Morozov.
{: .no_toc }
Jinja2C++ is distributed by a Mozilla Public License 2.0.
{: .no_toc }
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
{: .no_toc }
- Thanks to authors of original Jinja2 specification for the exceptional work!
- Thanks to manu343726 for CMake scripts improvement, conan.io packaging and bugs hunting and fixing.
- Thanks to martinmoene for perfectly implemented xxx-lite libraries.
- Thanks to vitaut for the amazing text formatting library.
- Thanks to martinus for the fast hash maps implementation.
- File include/jinja2cpp/value_ptr.hpp Copyright © 2017-2019 by Martin Moene
- File src/lexertk.h Originally copyright © 2001 by Arash Partow