File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,10 @@ let run json_filename template_filename =
3434 let path = Printf. sprintf " %s.mustache" name in
3535 if not (Sys. file_exists path) then None
3636 else Some (load_template path) in
37- try Mustache. render ~partials tmpl env |> print_endline
37+ try
38+ let output = Mustache. render ~partials tmpl env in
39+ print_string output;
40+ flush stdout
3841 with Mustache. Render_error err ->
3942 Format. eprintf " Template render error:@\n %a@."
4043 Mustache. pp_render_error err;
Original file line number Diff line number Diff line change 11Simple test:
2-
32 $ mustache data. json foo. mustache
43 Inside the include is " Foo Bar !"
5-
4+
65Include in child or parent directory:
76 $ mkdir subdir
87 $ echo " Test from { {src}} " > subdir/ test. mustache
98 $ echo " { {> subdir/ test }} " > from_parent. mustache
109 $ echo ' { "src": "parent" }' > from_parent. json
1110 $ mustache from_parent. json from_parent. mustache
1211 Test from parent
13-
1412
1513 $ mkdir subdir/ child
1614 $ echo " { {> .. / test }} " > subdir/ child/ from_child. mustache
1715 $ echo ' { "src": "child" }' > subdir/ child/ from_child. json
1816 $ (cd subdir/ child; mustache from_child. json from_child. mustache)
1917 Test from child
20-
You can’t perform that action at this time.
0 commit comments