(** [Ohtml] is a module that can be used together with [.ohtml] view template
    files. *)

type t = Buffer.t -> unit
(** [t] represents an Ohtml view. This is usually a generated by [ohtml.exe]
    tool. *)

val escape_html : string -> string
(** [escape_html s] is a XSS attack safe version of HTML text value [s]. *)

val escape_attr : string -> string
(** [escape_attr s] is a XSS attack safe version of HTML attribute value [s]. *)

(** {1 Attribute} *)

type attribute

val attribute : name:string -> value:string -> attribute
(** [attribute ~name ~value] is a html attribute with [name] and [value]. *)

val bool : string -> attribute
(** [bool name] is a [name] only attribute, eg. disabled. *)

val null : attribute
(** [null_attribute] is a no-op attribute. It outpus nothing. This is
    particularly useful in use-cases where one wants to control the generation
    of HTML node attribute based on some condition. For eg.
    [(if cond then Ohtml.attribute ~name ~value else Ohtml.null)] *)

val write_attribute : attribute -> t
