rtgen

Crates.iortgen
lib.rsrtgen
version0.1.0
created_at2025-03-16 01:23:47.716452+00
updated_at2025-03-16 01:23:47.716452+00
descriptionTemplate builer/aggregation tool
homepage
repository
max_upload_size
id1594040
size35,983
(Antsthebul)

documentation

README

rtgen

Rust Template Generator

Overview

Supported files:

  • YAML
  • JSON

Purpose

Inspired by Terraform, rtgen is a CLI tool to easily aggregate various files homogenous file types to create a single file. Rather than having an extremely verbose file, due to repeating object definitions, you can create a template, and "compile" to a single file, aggregating small, modularized files, to help make your codebase much more maintainable.

Usage

Follow these steps or run the example

  1. Create a template. main.yaml.
greetings:
    - "{{ lookup('*') }}"
  1. Create the directory /greetings
  2. Create a file 2 files within this directory

esp.yaml

Hola Mundo!

eng.yaml

Hello World
  1. Run rtgen -t main.yaml and you should see
greetings:
    - Hola Mundo!
    - Hello World

Example

Run make run-example-yaml to how examples/main.yaml is used as a template, and creates the output seen in output.yaml

Caveats

  • JSON output, although correct, may show map objects with keys in a different order
  • Currently child tempaltes cannot contain refernces other files (it will not be evaulated and is returned as an empty string)

See the docs for more info

Commit count: 0

cargo fmt