Templo Engine

Template engine for insert and modify variables inside of text files.

example

The input text can have some placeholders represented by "{> arg <}". These placeholders will be used to insert the arguments passed to the engine. The engine provides some native functions to manipulate the argument value as well.

input.py ```py class {> upperfirst(classname) <}: def init(self): self.name = '{> class_name <}'

obj = {> upperfirst(classname) <}()

print(f'The class name is {obj.name}')

```

execution

```rust use templo_engine::*;

// Getting the input text let inputtext = std::fs::readto_string("./input.py").unwrap();

// The arguments let arguments = vec![ EngineArg { key: String::from("classname"), value: String::from("dog"), valuetype: EngineArgType::String, } ];

// Inserting the arguments on text let engine = Engine::new(arguments); let text = engine.compile(input_text);

// writing the output file std::fs::write("./output.py", text.unwrap()).unwrap(); ```

output.py ```py class Dog: def init(self): self.name = 'dog'

obj = Dog()

print(f'The class name is {obj.name}') ```