aboutsummaryrefslogtreecommitdiff
path: root/lib/render/template.mli
diff options
context:
space:
mode:
Diffstat (limited to 'lib/render/template.mli')
-rw-r--r--lib/render/template.mli9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/render/template.mli b/lib/render/template.mli
index 3f9ef97..4118496 100644
--- a/lib/render/template.mli
+++ b/lib/render/template.mli
@@ -26,3 +26,12 @@ type node =
(** Never raises; a malformed template is an [Error] with a human-readable
reason, because the template is user input. *)
val parse : string -> (node list, string) result
+
+(** Render against a value. Escaping is applied to every interpolated value and
+ NEVER to the template's own literal text, which is the author's markup.
+ A missing key renders as the empty string -- the one deliberate silence, so
+ that a template survives a rite that does not set every optional field. *)
+val render : flavour:Escape.flavour -> node list -> value -> string
+
+(** [parse] then [render]. *)
+val render_string : flavour:Escape.flavour -> string -> value -> (string, string) result