Crates.io | yampl |
lib.rs | yampl |
version | 0.0.10 |
source | src |
created_at | 2023-03-27 10:10:30.459049 |
updated_at | 2023-04-06 14:56:37.94548 |
description | cli utility for rendering templates with args described in yaml file |
homepage | |
repository | https://github.com/semichkin/yampl |
max_upload_size | |
id | 821999 |
size | 23,679 |
To use this tool, you need to have Rust installed on your system.
You can then install the tool using cargo
, Rust's package manager.
cargo install yampl
yampl render --config ./config.yampl --output ./rendered.txt
The config file describes how to render template.
template
: The path to the template file that you want to render.params
: A table containing the arguments that you want to pass to the template.template: ./example/template.yaml
params:
goprivate: {{env "GOPRIVATE"}}
some:
some:
some: "some _ some _ some"
Assuming that the config.yaml
file has the following contents:
template: ./template.txt
params:
name: John
age: 30
And the template.txt
file has the following contents:
Hello, {{name}}!
You are {{age}} years old.
The above command will render the template using the arguments specified in the config file and write the output to the output.txt
file