mirror of
https://github.com/pantor/inja.git
synced 2026-03-20 16:05:57 +00:00
@@ -21,7 +21,7 @@ endif()
|
||||
## PROJECT
|
||||
## name and version
|
||||
##
|
||||
project(inja LANGUAGES CXX VERSION 0.1)
|
||||
project(inja LANGUAGES CXX VERSION 1.0.0)
|
||||
set(INJA_VERSION ${PROJECT_VERSION})
|
||||
|
||||
##
|
||||
|
||||
@@ -22,7 +22,7 @@ inja::render("Hello {{ name }}!", data); // Returns "Hello world!"
|
||||
|
||||
## Integration
|
||||
|
||||
Inja is a headers only library, which can be downloaded in the releases or directly from the `src/` folder. Inja uses json by nlohmann as its single dependency, so make sure that it is included before inja. json can be found [here](https://github.com/nlohmann/json/releases).
|
||||
Inja is a headers only library, which can be downloaded from the [releases](https://github.com/pantor/inja/releases) or directly from the `src/` folder. Inja uses json by nlohmann as its single dependency, so make sure that it is included before inja. json can be found [here](https://github.com/nlohmann/json/releases).
|
||||
|
||||
```c++
|
||||
#include "json.hpp"
|
||||
@@ -35,6 +35,8 @@ using json = nlohmann::json;
|
||||
|
||||
You can also integrate inja in your project using [Hunter](https://github.com/ruslo/hunter), a package manager for C++.
|
||||
|
||||
If you are using the [Meson Build System](http://mesonbuild.com), then you can wrap this repository as a subproject.
|
||||
|
||||
|
||||
## Tutorial
|
||||
|
||||
|
||||
7
meson.build
Normal file
7
meson.build
Normal file
@@ -0,0 +1,7 @@
|
||||
project('inja', 'cpp')
|
||||
|
||||
inja_inc = include_directories('src')
|
||||
|
||||
inja_dep = declare_dependency(
|
||||
include_directories : inja_inc
|
||||
)
|
||||
32
src/inja.hpp
32
src/inja.hpp
@@ -1,6 +1,38 @@
|
||||
/*
|
||||
Inja - A Template Engine for Modern C++
|
||||
version 1.0.0
|
||||
https://github.com/pantor/inja
|
||||
|
||||
Licensed under the MIT License <https://opensource.org/licenses/MIT>.
|
||||
Copyright (c) 2017-2018 Pantor <https://github.com/pantor>.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef PANTOR_INJA_HPP
|
||||
#define PANTOR_INJA_HPP
|
||||
|
||||
#define PANTOR_INJA_VERSION_MAJOR 1
|
||||
#define PANTOR_INJA_VERSION_MINOR 0
|
||||
#define PANTOR_INJA_VERSION_PATCH 0
|
||||
|
||||
|
||||
#ifndef NLOHMANN_JSON_HPP
|
||||
static_assert(false, "nlohmann/json not found.");
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user