Render

Render a template file or directory with a specific dataset

Usage

template-engine render --in ./template.txt --out ./rendered.txt --data ./data.json

Arguments

Argument
Description
Mandatory
Default
Example

in

path of the input template file or directory containing the template files

yes

./input.txt

out

path of the output rendered file or directory

yes

./output.txt

data

path of the data used to render the template

yes

./data.json

data-filter

json path filtering expression used to filter the data

no

$[?(@.sku == record2)]

left-delimiter

character used at the left edge of the single variable wrapping templating expressions

no

{{

right-delimiter

character used at the right edge of the single variable wrapping templating expressions

no

}}

left-loop-variable-delimiter

character used at the left edge of the loop variable wrapping templating expressions

no

(

right-loop-variable-delimiter

character used at the right edge of the loop variable wrapping templating expressions

no

)

left-loop-block-delimiter

character used at the left edge of the loop block wrapping templating expressions

no

[

right-loop-block-delimiter

character used at the right edge of the loop block wrapping templating expressions

no

]

injection-loop-variable

variable used to inject a flat data structure into a template

no

$

key-column

column containing the names of the variables in a tabular data structure

no

id

multiple-output

boolean indicating if multiple output should be generated for each input file. In multiple output mode, the data should have a flat structure

no

false

multiple-output-filename-pattern

pattern used to name the output files in a multiple output context

no

{0}_{i}

panic-if-no-match

boolean indicating if the command should crash when a variable referenced in the template is not found in the data

no

true

Last updated

Was this helpful?