inja icon indicating copy to clipboard operation
inja copied to clipboard

A Template Engine for Modern C++

Results 50 inja issues
Sort by recently updated
recently updated
newest added

In SQL I can INSERT a row in a database with a VARCHAR SQL type column named 'col1' with `std::string my_template = "INSERT INTO [my_table] (col1) VALUES ('my_value');"` To note...

The [macro](https://jinja.palletsprojects.com/en/3.0.x/templates/#macros) feature in Jinja would be super great to have. I'm finding myself repeating lots of small snippets in my templates, things for which `include` in't well suited (too...

enhancement

I want this: ``` begin ## for a in b {{ a }} ## endfor end ``` for `b` = `[1, 2, 3, 4]` to become this: ``` begin 1...

Exceptions have a `SourceLocation` object, which stores the line and column numbers where the problem was encountered. This produces error messages like: `[inja.exception.render_error] (at 1:10) variable 'name' not found` https://github.com/pantor/inja/blob/17a59c0b78e620157c253b0c7643cfa987135f8d/include/inja/exceptions.hpp#L9-L12...

Close #246 This pull request consists of three commits. 1. The first commit adds the following method to `Parser` and use it in the `parse_expression` method with two arguments. ```c++...

I inserted the following three lines [here](https://github.com/pantor/inja/blob/v3.3.0/test/test-functions.cpp#L252) and ran tests. ```c++ CHECK(env.render("{{ multiply(3, 3) }}", data) == "9.0"); CHECK(env.render("{{ multiply(3, 1 + 2) }}", data) == "9.0"); CHECK(env.render("{{ multiply(1 +...

I have a list of items (could be objects as well) in the json data file. [ "item1", "item2","item3" ] Now when trying to use them in a loop like...

enhancement

Create body.txt placed into "path_to_tmplate" folder with some static content. Consider a template string: A code: json data; Environment env("path_to_tmplate/"); auto result = env.render("Hello {% include \"body.txt\" %}", data); Code...

### Problem I'm Trying To Solve I'd like to pass a variable as the data context of the included template, so a huge template can be split into more modularized...

enhancement

Please consider adding `{% set %} ... {% endset %}`-statement e.g. ``` {% set x %} line1 line2 line2 {% endset %} ``` P.S. Thanks for `inja`! :)

enhancement