Getting started

How to get Jinja2++

Get the latest package: jinja2cpp/0.9.1@Manu343726/testing

Or download the latest release: Release 0.9.2


A basic example

Using Jinja2C++ in your code is pretty simple:

  1. Include Jinja2C++ template declaration:
    #include <jinja2/template.h>
  2. Declare the jinja2::Template object:
    jinja2::Template tpl;
  3. Populate it with template:
    tpl.Load("{{'Hello World' }}!!!");
  4. Render the template:
    std::cout << tpl.RenderAsString(jinja2::ValuesMap{}).value() << std::endl;

and you will get:

Hello World!!!

That’s all!