#yaml-config #render-template #command-line-tool #config-file #content #utility #rendering

bin+lib yampl

cli utility for rendering templates with args described in yaml file

7 releases

0.0.10 Apr 6, 2023
0.0.9 Apr 4, 2023
0.0.8 Mar 30, 2023

#2745 in Command line utilities

Download history 37/week @ 2024-07-29 42/week @ 2024-09-23 3/week @ 2024-09-30

110 downloads per month

MIT/Apache

8KB
118 lines

CLI utility for template rendering

Installation

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

Usage

yampl render --config ./config.yampl --output ./rendered.txt

Config file

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"

Example

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

Dependencies

~6.5MB
~131K SLoC