Illustrates one way to avoid creating invalid YAML documents while authoring fragment functions in your ytt templates.
(see https://gist.github.com/pivotaljohn/2be1aab1a58c5a8711bfa355de7d8cae)
$ ytt -f frag-funcs-after.yml
output:
a: b
c: d
Illustrates one way to avoid creating invalid YAML documents while authoring fragment functions in your ytt templates.
(see https://gist.github.com/pivotaljohn/2be1aab1a58c5a8711bfa355de7d8cae)
$ ytt -f frag-funcs-after.yml
output:
a: b
c: d
#@ load("@ytt:template", "template") | |
#@ def my_function(): | |
#@ if True: | |
a: b | |
#@ end | |
#@ end | |
--- | |
#@ def my_function2(): | |
c: d | |
#@ end | |
--- | |
output: | |
_: #@ template.replace(my_function()) | |
_: #@ template.replace(my_function2()) |