Skip to content

Commit fa3dffa

Browse files
authored
[skip ci] Update to the release 1.0.0
1 parent 59a107d commit fa3dffa

File tree

1 file changed

+43
-26
lines changed

1 file changed

+43
-26
lines changed

README.md

+43-26
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[![conan.io](https://api.bintray.com/packages/flexferrum/conan-packages/jinja2cpp:flexferrum/images/download.svg?version=1.0.0:testing) ](https://bintray.com/flexferrum/conan-packages/jinja2cpp:flexferrum/1.0.0:testing/link)
1515
[![Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Jinja2Cpp/Lobby)
1616

17-
C++ implementation of Jinja2 Python template engine. This library was originally inspired by [Jinja2CppLight](https://github.com/hughperkins/Jinja2CppLight) project and brings support of mostly all Jinja2 templates features into C++ world.
17+
C++ implementation of Jinja2 Python template engine. This library brings support of powerful Jinja2 templates features into the C++ world. Reports and dynamic html pages, source code generation and
1818

1919
## Introduction
2020

@@ -28,6 +28,7 @@ Main features of Jinja2C++:
2828
- Templates extention, including and importing
2929
- Macros
3030
- Rich error reporting.
31+
- Shared template enironment with templates cache support
3132

3233
For instance, this simple code:
3334

@@ -60,7 +61,7 @@ hello; world!!!
6061

6162
In order to use Jinja2C++ in your project you have to:
6263
* Clone the Jinja2C++ repository
63-
* Build it according with the instructions
64+
* Build it according with the [instructions](https://jinja2cpp.dev/docs/build_and_install.html)
6465
* Link to your project.
6566

6667
Usage of Jinja2C++ in the code is pretty simple:
@@ -73,7 +74,7 @@ jinja2::Template tpl;
7374
2. Populate it with template:
7475

7576
```c++
76-
tpl.Load("{{'Hello World' }}!!!");
77+
tpl.Load("{{ 'Hello World' }}!!!");
7778
```
7879

7980
3. Render the template:
@@ -95,7 +96,7 @@ More detailed examples and features describtion can be found in the documentatio
9596
## Current Jinja2 support
9697
Currently, Jinja2Cpp supports the limited number of Jinja2 features. By the way, Jinja2Cpp is planned to be full [jinja2 specification](http://jinja.pocoo.org/docs/2.10/templates/)-conformant. The current support is limited to:
9798
- expressions. You can use almost every style of expressions: simple, filtered, conditional, and so on.
98-
- big number of filters (**sort, default, first, last, length, max, min, reverse, unique, sum, attr, map, reject, rejectattr, select, selectattr, pprint, dictsort, abs, float, int, list, round, random, trim, title, upper, wordcount, replace, truncate, groupby, urlencode, capitalize**)
99+
- big number of filters (**sort, default, first, last, length, max, min, reverse, unique, sum, attr, map, reject, rejectattr, select, selectattr, pprint, dictsort, abs, float, int, list, round, random, trim, title, upper, wordcount, replace, truncate, groupby, urlencode, capitalize, escape**)
99100
- big number of testers (**eq, defined, ge, gt, iterable, le, lt, mapping, ne, number, sequence, string, undefined, in, even, odd, lower, upper**)
100101
- limited number of functions (**range**, **loop.cycle**)
101102
- 'if' statement (with 'elif' and 'else' branches)
@@ -115,27 +116,20 @@ Full information about Jinja2 specification support and compatibility table can
115116

116117
## Supported compilers
117118
Compilation of Jinja2Cpp tested on the following compilers (with C++14 and C++17 enabled features):
118-
- Linux gcc 5.0
119-
- Linux gcc 6.0
120-
- Linux gcc 7.0
121-
- Linux clang 5.0
122-
- Linux clang 6.0
123-
- Linux clang 7
124-
- Linux clang 8
119+
- Linux gcc 5.5 - 9.0
120+
- Linux clang 5.0 - 9
125121
- MacOS X-Code 9
126122
- MacOS X-Code 10
127123
- MacOS X-Code 11 (C++14 in default build, C++17 with externally-provided boost)
128-
- Microsoft Visual Studio 2015 x86, x64
129-
- Microsoft Visual Studio 2017 x86, x64
130-
- Microsoft Visual Studio 2019 x86, x64
124+
- Microsoft Visual Studio 2015 - 2019 x86, x64
131125
- MinGW gcc compiler 7.3
132126
- MinGW gcc compiler 8.1
133127

134128
**Note:** Support of gcc version >= 9.x or clang version >= 8.0 depends on version of Boost library provided.
135129

136130
## Build and install
137131
Jinja2Cpp has several external dependencies:
138-
- `boost` library (at least version 1.55)
132+
- `boost` library (at least version 1.65)
139133
- `nonstd::expected-lite` [https://github.com/martinmoene/expected-lite](https://github.com/martinmoene/expected-lite)
140134
- `nonstd::variant-lite` [https://github.com/martinmoene/variant-lite](https://github.com/martinmoene/variant-lite)
141135
- `nonstd::value-ptr-lite` [https://github.com/martinmoene/value-ptr-lite](https://github.com/martinmoene/value-ptr-lite)
@@ -176,12 +170,6 @@ In simpliest case to compile Jinja2Cpp you need:
176170
> cmake --build . --target install
177171
```
178172

179-
6. Also you can run the tests:
180-
181-
```
182-
> ctest -C Release
183-
```
184-
185173
In this case Jinja2Cpp will be built with internally-shipped dependencies and install them respectively. But Jinja2Cpp supports build with externally-provided deps. Different Jinja2Cpp usage scenarios can be found in this repository: https://github.com/jinja2cpp/examples-build
186174

187175
### Usage with conan.io dependency manager
@@ -191,11 +179,11 @@ Jinja2Cpp can be used as conan.io package. In this case you should do the follow
191179
2. Register the following remote conan.io repositories:
192180
* https://api.bintray.com/conan/martinmoene/nonstd-lite
193181
* https://api.bintray.com/conan/bincrafters/public-conan
194-
* https://api.bintray.com/conan/manu343726/conan-packages
182+
* https://api.bintray.com/conan/flexferrum/conan-packages
195183

196184
The sample command is: `conan remote add martin https://api.bintray.com/conan/martinmoene/nonstd-lite`
197185

198-
3. Add reference to Jinja2Cpp package (`jinja2cpp/0.9.1@Manu343726/testing`) to your conanfile.txt, conanfile.py or CMakeLists.txt. For instance, with usage of `conan-cmake` integration it could be written this way:
186+
3. Add reference to Jinja2Cpp package (`jinja2cpp/1.0.0@flexferrum/testing`) to your conanfile.txt, conanfile.py or CMakeLists.txt. For instance, with usage of `conan-cmake` integration it could be written this way:
199187

200188
```cmake
201189
include (../../cmake/conan.cmake)
@@ -204,7 +192,7 @@ if (NOT MSVC)
204192
endif ()
205193
206194
conan_cmake_run(REQUIRES
207-
jinja2cpp/0.9.1@Manu343726/testing
195+
jinja2cpp/1.0.0@flexferrum/testing
208196
gtest/1.7.0@bincrafters/stable
209197
BASIC_SETUP
210198
${CONAN_SETTINGS}
@@ -231,7 +219,7 @@ You can define (via -D command line CMake option) the following build flags:
231219
- **JINJA2CPP_BUILD_TESTS** (default TRUE) - to build or not to Jinja2Cpp tests.
232220
- **JINJA2CPP_STRICT_WARNINGS** (default TRUE) - Enable strict mode compile-warnings(-Wall -Werror and etc).
233221
- **JINJA2CPP_BUILD_SHARED** (default OFF) - Specify Jinja2Cpp library library link type.
234-
- **MSVC_RUNTIME_TYPE** (default /MD) - MSVC runtime type to link with (if you use Microsoft Visual Studio compiler).
222+
- **JINJA2CPP_MSVC_RUNTIME_TYPE** (default /MD) - MSVC runtime type to link with (if you use Microsoft Visual Studio compiler).
235223
- **JINJA2CPP_DEPS_MODE** (default "internal") - modes for dependencies handling. Following values possible:
236224
- `internal` In this mode Jinja2Cpp build script uses dependencies (include `boost`) shipped as subprojects. Nothing needs to be provided externally.
237225
- `external-boost` In this mode Jinja2Cpp build script uses only `boost` as externally-provided dependency. All other dependencies taken from subprojects.
@@ -240,7 +228,7 @@ You can define (via -D command line CMake option) the following build flags:
240228

241229

242230
### Build with C++17 standard enabled
243-
In case of C++17 standard enabled for your project you should define `variant_CONFIG_SELECT_VARIANT=variant_VARIANT_NONSTD` macro in the build settings.
231+
In case of C++17 standard enabled for your project you should define `variant_CONFIG_SELECT_VARIANT=variant_VARIANT_NONSTD nssv_CONFIG_SELECT_STRING_VIEW=nssv_STRING_VIEW_NONSTD optional_CONFIG_SELECT_OPTIONAL=optional_OPTIONAL_NONSTD` macros in the build settings.
244232

245233
## Acknowledgments
246234
Thanks to **@manu343726** for CMake scripts improvement, bugs hunting and fixing and conan.io packaging.
@@ -258,6 +246,35 @@ Thanks to **@rmorozov** for stanitized builds setup
258246

259247
## Changelog
260248

249+
### Version 1.0.0
250+
#### Changes and improvements
251+
- `default` attribute added to the `map` filter (#48)
252+
- escape sequences support added to the string literals (#49)
253+
- arbitrary ranges, generated sequences, input iterators etc. now can be used with `GenericList` type (#66)
254+
- nonstd::string_view is now one of the possible types for the `Value`
255+
- `filter` tag support added to the template parser (#44)
256+
- `escape` filter support added to the template parser (#140)
257+
- `capitalize` filter support added to the template parser (#137)
258+
- multiline version of `set` tag added to the parser (#45)
259+
- added built-in reflection for nlohmann json and rapid json libraries (#78)
260+
- `loop.depth` and `loop.depth0` variables support added
261+
- {fmt} is now used as a formatting library instead of iostreams
262+
- robin hood hash maps is now used for internal value storage
263+
- rendering performance improvements
264+
- template cache implemented in `TemplateEnv`
265+
- user-defined callables now can accept global context via `*context` special param
266+
- MinGW, clang >= 7.0, XCode >= 9, gcc >= 7.0 are now officially supported as a target compilers (#79)
267+
268+
#### Fixed bugs
269+
- Fixed pipe (`|`) operator precedence (#47)
270+
- Fixed bug in internal char <-> wchar_t converter on Windows
271+
- Fixed crash in parsing `endblock` tag
272+
- Fixed scope control for `include` and `for` tags
273+
- Fixed bug with macros call within expression context
274+
275+
#### Breaking changes
276+
- MSVC runtime type is now defines by `JINJA2CPP_MSVC_RUNTIME_TYPE` CMake variable
277+
261278
### Version 0.9.2
262279
#### Major changes
263280
- User-defined callables implemented. Now you can define your own callable objects, pass them as input parameters and use them inside templates as regular (global) functions, filters or testers. See details here: https://jinja2cpp.dev/docs/usage/ud_callables.html

0 commit comments

Comments
 (0)