Skip to content

Commit d6e5470

Browse files
committed
mustache_cli: document partial inclusion and the search path
1 parent 4c4204c commit d6e5470

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

bin/mustache_cli.ml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ let run_command =
7373
`P "The $(i,ocaml-mustache) implementation is tested against
7474
the Mustache specification testsuite.
7575
All features are supported, except for lambdas and setting delimiter tags.";
76+
`S Manpage.s_options;
77+
`S "PARTIALS";
78+
`P "The $(i,ocaml-mustache) library gives programmatic control over the meaning of partials {{>foo}}.
79+
For the $(tname) tool, partials are interpreted as template file inclusion: '{{>foo}}' includes
80+
the template file 'foo.mustache'.";
81+
`P "Included files are resolved in a search path, which contains the current working directory
82+
(unless the $(b,--no-working-dir) option is used)
83+
and include directories passed through $(b,-I DIR) options.";
84+
`P "If a file exists in several directories of the search path, the directory included first
85+
(leftmost $(b,-I) option) has precedence, and the current working directory has precedence
86+
over include directories.";
7687
`S Manpage.s_examples;
7788
`Pre
7889
{|
@@ -92,6 +103,25 @@ Hello OCaml!
92103
Mustache is:
93104
- simple
94105
- fun
106+
107+
108+
\$ cat page.mustache
109+
<html>
110+
<body>
111+
{{>hello}}
112+
</body>
113+
</html>
114+
115+
\$ $(tname) data.json page.mustache
116+
<html>
117+
<body>
118+
Hello OCaml!
119+
Mustache is:
120+
- simple
121+
- fun
122+
</body>
123+
</html>
124+
95125
|};
96126
`S Manpage.s_bugs;
97127
`P "Report bugs on https://github.com/rgrinberg/ocaml-mustache/issues";

0 commit comments

Comments
 (0)