Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
* fix links
* update version tags
  • Loading branch information
rmorozov committed Nov 19, 2023
1 parent 17fe19b commit 4393211
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.23.0)
project(Jinja2Cpp VERSION 1.3.0)
project(Jinja2Cpp VERSION 1.3.1)

if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
set(JINJA2CPP_IS_MAIN_PROJECT TRUE)
Expand Down
78 changes: 61 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Hello World!!!

That's all!

More detailed examples and features description can be found in the documentation: [https://jinja2cpp.dev/docs/usage](https://jinja2cpp.github.io/docs/usage)
More detailed examples and features description can be found in the documentation: [https://jinja2cpp.github.io/docs/usage](https://jinja2cpp.github.io/docs/usage)

## Current Jinja2 support
Currently, Jinja2C++ supports the limited number of Jinja2 features. By the way, Jinja2C++ is planned to be a fully [jinja2 specification](http://jinja.pocoo.org/docs/2.10/templates/)-conformant. The current support is limited to:
Expand All @@ -111,7 +111,7 @@ Currently, Jinja2C++ supports the limited number of Jinja2 features. By the way,
- recursive loops
- space control and 'raw'/'endraw' blocks

Full information about Jinja2 specification support and compatibility table can be found here: [https://jinja2cpp.dev/docs/j2_compatibility.html](https://jinja2cpp.github.io/docs/j2_compatibility.html).
Full information about Jinja2 specification support and compatibility table can be found here: [https://jinja2cpp.github.io/docs/j2_compatibility.html](https://jinja2cpp.github.io/docs/j2_compatibility.html).

## Supported compilers
Compilation of Jinja2C++ tested on the following compilers (with C++14 and C++17 enabled features):
Expand All @@ -134,10 +134,10 @@ Compilation of Jinja2C++ tested on the following compilers (with C++14 and C++17
| **X-Code** 9, 10, 11 | [![Build Status](https://travis-ci.org/jinja2cpp/Jinja2Cpp.svg?branch=master)](https://travis-ci.org/jinja2cpp/Jinja2Cpp) |
| **MSVC** 2017 (x86, x64), **MSVC** 2019 (x86, x64), C++14/C++17 | [![](https://github.com/jinja2cpp/Jinja2Cpp/workflows/CI-windows-build/badge.svg)](https://github.com/jinja2cpp/Jinja2Cpp/actions?query=workflow%3ACI-windows-build) |
| **g++** 5, 6, 7, 8, 9, 10, 11 **clang** 5, 6, 7, 8, 9, 10, 11, 12 C++14/C++17/C++20 | [![](https://github.com/jinja2cpp/Jinja2Cpp/workflows/CI-linux-build/badge.svg)](https://github.com/jinja2cpp/Jinja2Cpp/actions?query=workflow%3ACI-linux-build) |

## Build and install
Jinja2C++ has several external dependencies:
- `boost` library (at least version 1.65)
- `boost` library (at least version 1.65)
- `nonstd::expected-lite` [https://github.com/martinmoene/expected-lite](https://github.com/martinmoene/expected-lite)
- `nonstd::variant-lite` [https://github.com/martinmoene/variant-lite](https://github.com/martinmoene/variant-lite)
- `nonstd::optional-lite` [https://github.com/martinmoene/optional-lite](https://github.com/martinmoene/optional-lite)
Expand Down Expand Up @@ -182,24 +182,37 @@ In this case, Jinja2C++ will be built with internally-shipped dependencies and i
Jinja2C++ can be used as conan.io package. In this case, you should do the following steps:

1. Install conan.io according to the documentation ( https://docs.conan.io/en/latest/installation.html )
2. Add a reference to Jinja2C++ package (`jinja2cpp/1.1.0`) to your conanfile.txt, conanfile.py or CMakeLists.txt. For instance, with the usage of `conan-cmake` integration it could be written this way:
2. Add a reference to Jinja2C++ package (`jinja2cpp/1.2.1`) to your conanfile.txt, conanfile.py or CMakeLists.txt. For instance, with the usage of `conan-cmake` integration it could be written this way:

```cmake
include (../../cmake/conan.cmake)
if (NOT MSVC)
set (CONAN_SETTINGS SETTINGS compiler.libcxx=libstdc++11)
endif ()
conan_cmake_run(REQUIRES
cmake_minimum_required(VERSION 3.24)
project(Jinja2CppSampleConan CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
add_definitions("-std=c++14")
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
TLS_VERIFY ON)
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_autodetect(settings)
conan_cmake_run(REQUIRES
jinja2cpp/1.1.0
gtest/1.7.0@bincrafters/stable
gtest/1.14.0
BASIC_SETUP
${CONAN_SETTINGS}
OPTIONS
jinja2cpp:shared=False
gtest:shared=False
OPTIONS
jinja2cpp/*:shared=False
gtest/*:shared=False
BUILD missing)
set (TARGET_NAME jinja2cpp_build_test)
add_executable (${TARGET_NAME} main.cpp)
Expand Down Expand Up @@ -229,6 +242,8 @@ You can define (via -D command-line CMake option) the following build flags:
Jinja2C++ tries to use standard versions of `std::variant`, `std::string_view` and `std::optional` if possible.

## Acknowledgments
Thanks to **@flexferrum** for creating this library, for being one of the brightest minds in software engineering community. Rest in peace, friend.

Thanks to **@manu343726** for CMake scripts improvement, bug hunting, and fixing and conan.io packaging.

Thanks to **@martinmoene** for the perfectly implemented xxx-lite libraries.
Expand All @@ -240,6 +255,35 @@ Thanks to **@martinus** for the fast hash maps implementation.

## Changelog


### Version 1.3.1

#### Changes and improvements
- bump deps versions
- add new json binding - boost::json
- speedup regex parsing by switching to boost::regex(std::regex extremely slow)
- templates are now loading faster

#### Fixed bugs
- small fixes across code base

#### Breaking changes
- internal deps now used through cmake fetch_content
- default json serializer/deserializer is switched to boost::json

### Version 1.2.1

#### Changes and improvements
- bump deps versions
- support modern compilers(up to Clang 12) and standards(C++20)
- tiny code style cleanup

#### Fixed bugs
- small fixes across code base

#### Breaking changes
- internal deps point to make based boost build

### Version 1.1.0
#### Changes and improvements
- `batch` filter added
Expand Down Expand Up @@ -297,13 +341,13 @@ Thanks to **@martinus** for the fast hash maps implementation.

### Version 0.9.2
#### Major changes
- 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
- 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.github.io/docs/usage/ud_callables.html
- Now you can define global (template environment-wide) parameters that are accessible for all templates bound to this environment.
- `include`, `import` and `from` statements implemented. Now it's possible to include other templates and use macros from other templates.
- `with` statement implemented
- `do` statement implemented
- Sample build projects for various Jinja2C++ usage variants created: https://github.com/jinja2cpp/examples-build](https://github.com/jinja2cpp/examples-build)
- Documentation site created for Jinja2C++: https://jinja2cpp.dev/
- Documentation site created for Jinja2C++: https://jinja2cpp.github.io

#### Minor changes
- Render-time error handling added
Expand Down

0 comments on commit 4393211

Please sign in to comment.