Templo Engine

Template engine of Templo tool 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.

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 // Getting the input text let inputtext = std::fs::readto_string("./input.py").unwrap();

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

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

// 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}') ```