You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On python you can do something like below after installing the jinja2 plugin for ruamel.yaml
import os
from ruamel.yaml import YAML
yaml = YAML(typ='jinja2')
with open('input.yaml') as fp:
data = yaml.load(fp)
myArray = data['A']['B'][1]['myArray']
pos = myArray.index('val2')
myArray.insert(pos+1, 'val 3')
with open('output.yaml', 'w') as fp:
yaml.dump(data, fp)
os.system('diff -u input.yaml output.yaml')
Is there any way to do this on javascript? I should be able to load a jinja2 yaml file, modify the yaml parts and dump it and still have the jinja2 templating variables/for loops and etc.
The text was updated successfully, but these errors were encountered:
I have a jinja2 yaml template and I want to be able to parse it using js-yaml.
Something like plugin system for ruamel.yaml from this answerl https://stackoverflow.com/a/44515747
On python you can do something like below after installing the jinja2 plugin for ruamel.yaml
Is there any way to do this on javascript? I should be able to load a jinja2 yaml file, modify the yaml parts and dump it and still have the jinja2 templating variables/for loops and etc.
The text was updated successfully, but these errors were encountered: