# Kitamura 北村 [![Actions](https://github.com/JoelWi/kitamura/actions/workflows/main.yml/badge.svg)](https://github.com/JoelWi/kitamura/actions/workflows/main.yml) [![Coverage Status](https://coveralls.io/repos/github/JoelWi/kitamura/badge.svg?branch=main)](https://coveralls.io/github/JoelWi/kitamura?branch=main) Kitamura is a templating engine for rendering templates based on placeholders defined in your templates. Placeholders are provided in the form of content parameters that are in JSON. # Overview Below is the general idea of how to use Kitamura. Formatting of the template is respected, and overall there are no expectations that anything but what Kitamura is looking for will be modified. Kitamura will return a Result, which will contain either the rendered template, or an error message. ```text Input HTML Hello ${first_name}! Input Data { "first_name": "Joel" } Output HTML Hello Joel! ``` # Features Variables Lists Conditionals - builtins: - == - != - ?exists - ?not_empty - ?contains('some substring value') # Examples ``` use std::collections::HashMap; use kitamura::render_template; use serde_json::json; let input_html = "Hello ${first_name}!"; let mut input_data = HashMap::new(); input_data.insert("first_name".to_string(), json!("Joel")); let output_html = render_template(input_html.to_string(), input_data); assert_eq!(output_html, "Hello Joel!"); ``` ``` use std::collections::HashMap; use kitamura::render_template; use serde_json::json; let input_html = " "; let mut input_data = HashMap::new(); input_data.insert( fruits".to_string(), son!([{"name": "Lemon", "colour": "Yellow", "weight": "150g"}, "name": "shiikuwasha", "colour": "Green", "weight": "80g"}, "name": "Lychee", "colour": "Red", "weight": "50g"}]), ; let output_html = render_template(input_html.to_string(), input_data); assert_eq!(output_html, " "); ``` ``` use std::collections::HashMap; use kitamura::render_template; use serde_json::json; let input_html = "