File tree Expand file tree Collapse file tree
codegenr/_samples/render/yaml_output Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ [yaml_output ]
2+ source = " data.json"
3+ templates = [" ." ]
4+ output = " ."
5+ custom_helpers = []
6+ global_parameters = {}
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " John" ,
3+ "age" : 30 ,
4+ "cars" : [
5+ " Ford" ,
6+ " BMW" ,
7+ " Fiat"
8+ ]
9+ }
Original file line number Diff line number Diff line change 1+
2+ data :
3+ name : John
4+ age : 30
5+ cars :
6+ - Ford
7+ - BMW
8+ - Fiat
9+
10+
11+ # test yaml output helper
12+ # ==============================
13+ bar :
14+ baz : true
15+
16+
17+ # test yaml output of current context
18+ # ==============================
19+ age : 30
20+ cars :
21+ - Ford
22+ - BMW
23+ - Fiat
24+ name : ' John'
25+
26+
Original file line number Diff line number Diff line change 1+ ### FILE output.yaml
2+
3+ data:
4+ name: {{ name }}
5+ age: {{ age }}
6+ cars:
7+ {{ #each cars }}
8+ - {{ this }}
9+ {{ /each }}
10+
11+
12+ # test yaml output helper
13+ # ==============================
14+ {{ json_str_query " foo" " foo:\n bar:\n baz: true\n" format =" yaml" }}
15+
16+ # test yaml output of current context
17+ # ==============================
18+ {{ json_str_query " @" (json_to_str this ) format =" yaml" }}
19+
20+ ### /FILE
You can’t perform that action at this time.
0 commit comments