.TH "Eliom_content.Html5.Custom_data" 3o 2014-07-10 OCamldoc ""
.SH NAME
Eliom_content.Html5.Custom_data \- no description
.SH Module
Module Eliom_content.Html5.Custom_data
.SH Documentation
.sp
Module
.BI "Custom_data"
:
.B sig end
.sp
.sp
.sp
.sp
.I type
.B 'a
.I t
.sp
Custom data with values of type
.B \&'a
\&.
.sp
.sp
.I val create
:
.B name:string ->
.B ?default:'a ->
.B to_string:('a -> string) ->
.B of_string:(string -> 'a) -> unit -> 'a t
.sp
Create a custom data field by providing string conversion functions\&.
If the
.B default
is provided, calls to return that instead of throwing an
exception
.B Not_found
\&.
.sp
.sp
.I val create_json
:
.B name:string ->
.B ?default:'a -> 'a Deriving_Json.t -> 'a t
.sp
Create a custom data from a Json\-deriving type\&.
.sp
.sp
.I val attrib
:
.B 'a t ->
.B 'a -> [> `User_data ] Eliom_content.Html5.attrib
.sp
.B attrib my_data value
creates a HTML5 attribute for the custom\-data
type
.B my_data
with value
.B value
for injecting it into an a HTML5 tree
()\&.
.sp
.sp
.I val get_dom
:
.B Dom_html.element Js.t -> 'a t -> 'a
.sp
.sp
.I val set_dom
:
.B Dom_html.element Js.t -> 'a t -> 'a -> unit
.sp
.sp