simple-generator

command module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 8 Imported by: 0

README

simple-generator

Very simple golang template engine for cli usage, using the golang template package and the template functions from sprig.

Package template implements data-driven templates for generating textual output.

Simple-generator works with JSON or YMAL as input data format only

Dokumentation

Install

If you have Go 1.12.x installed:

GO111MODULE=on go get -u github.com/theNorstroem/simple-generator@v1.0.2

Usage


 simple-generator -d data.json -t template.xxx // renders to stdout
 simple-generator -d data.json -t template.xxx > target.file
 
 simple-generator -h  // help 
 Usage of simple-generator:
   -d string
          Path to data file which contains YAML or JSON
   -t string
          Path to tpl file



Example

Watch out the example data in /sample

simple-generator -d ./sample/values.yaml -t ./sample/example.tmpl // renders to stdout

Usage with stdin

 cat ./datafile.yaml | simple-generator -t ./templates/templatefile.tmpl > targetfile.proto

 simple-generator -t ./templates/templatefile.tmpl > targetfile.proto < ./datafile.json
 

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL