Module Cow_htmlSource

(X)HTML library

A sequence of (X)HTML trees.

Sourceval doctype : string
Sourceval to_string : t -> string

to_string html is a valid (X)HTML5 polyglot string corresponding to the html structure.

Sourceval of_string : ?enc:Cow_xml.encoding -> string -> t

of_string ?enc html_str is the tree representation of html_str as decoded by enc. For more information about the default encoding, see Encoding.

Note that this function converts all standard entities into their corresponding UTF-8 symbol.

Sourceval output : ?nl:bool -> ?indent:int option -> ?ns_prefix:(string -> string option) -> Xmlm.dest -> t -> unit

Outputs valid (X)HTML5 polyglot text from a t. Only non-void element handling is implemented so far. For more information about the parameters, see Xmlm.make_output.

Sourceval output_doc : ?nl:bool -> ?indent:int option -> ?ns_prefix:(string -> string option) -> Xmlm.dest -> t -> unit

Outputs a valid (X)HTML5 polyglot document from a t. Only non-void element handling and HTML5 DOCTYPE is implemented so far. For more information about the parameters, see Xmlm.make_output.

HTML library

Sourcetype rel = [
  1. | `alternate
  2. | `author
  3. | `bookmark
  4. | `help
  5. | `license
  6. | `next
  7. | `nofollow
  8. | `noreferrer
  9. | `prefetch
  10. | `prev
  11. | `search
  12. | `tag
]
Sourcetype target = [
  1. | `blank
  2. | `parent
  3. | `self
  4. | `top
  5. | `Frame of string
]
Sourceval a : ?hreflang:string -> ?rel:rel -> ?target:target -> ?ty:string -> ?title:string -> ?cls:string -> href:Uri.t -> t -> t

a href html generate a link from html to href.

  • parameter title

    specifies extra information about the element that is usually as a tooltip text when the mouse moves over the element. Default: None.

  • parameter target

    Specifies where to open the linked document.

  • parameter rel

    Specifies the relationship between the current document and the linked document. Default: None.

  • parameter hreflang

    the language of the linked document. Default: None.

  • parameter ty

    Specifies the media type of the linked document.

Sourceval img : ?alt:string -> ?width:int -> ?height:int -> ?ismap:Uri.t -> ?title:string -> ?cls:string -> Uri.t -> t
Sourceval interleave : string array -> t list -> t list
Sourceval html_of_string : string -> t
Sourceval string : string -> t
Sourceval html_of_int : int -> t
  • deprecated

    use int

Sourceval int : int -> t
Sourceval html_of_float : float -> t
Sourceval float : float -> t
Sourcetype table = t array array
Sourceval html_of_table : ?headings:bool -> table -> t
Sourceval nil : t
Sourceval empty : t
Sourceval concat : t list -> t
Sourceval list : t list -> t
Sourceval some : t option -> t
Sourceval append : t -> t -> t

append par ch appends ch to par

Sourceval (++) : t -> t -> t
Sourcemodule Create : sig ... end

HTML nodes

Sourcetype node = ?cls:string -> ?id:string -> ?attrs:(string * string) list -> t -> t

The type for nodes.

Sourceval div : node

div ~cls t is <div class="cls">t</div>.

Sourceval span : node

div ~cls: t is <div class="cls">t</div>.

Sourceval input : node
Sourceval meta : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?name:string -> ?content:string -> ?charset:string -> t -> t
Sourceval br : node
Sourceval hr : node
Sourceval source : node
Sourceval wbr : node
Sourceval param : node
Sourceval embed : node
Sourceval col : node
Sourceval track : node
Sourceval keygen : node
Sourceval anchor : string -> t
Sourceval base : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?href:Uri.t -> ?target:string -> t -> t
Sourceval style : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?media:string -> ?typ:string -> t -> t
Sourceval h1 : node
Sourceval h2 : node
Sourceval h3 : node
Sourceval h4 : node
Sourceval h5 : node
Sourceval h6 : node
Sourceval small : node
Sourceval li : node
Sourceval dt : node
Sourceval dd : node
Sourceval ul : ?add_li:bool -> ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?licls:string -> t list -> t
Sourceval ol : ?add_li:bool -> ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?licls:string -> t list -> t
Sourceval dl : ?add_dtdd:bool -> ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?dtcls:string -> ?ddcls:string -> (t * t) list -> t
Sourceval tag : string -> node
Sourceval i : node
Sourceval p : node
Sourceval tt : node
Sourceval blockquote : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?cite:Uri.t -> t -> t
Sourceval pre : node
Sourceval figure : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?figcaption:t -> t -> t
Sourceval main : node
Sourceval em : node
Sourceval strong : node
Sourceval s : node
Sourceval cite : node
Sourceval q : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?cite:Uri.t -> t -> t
Sourceval dfn : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?title:string -> t -> t
Sourceval abbr : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?title:string -> t -> t
Sourceval data : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> value:string -> t -> t
Sourceval time : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?datetime:string -> t -> t
Sourceval code : node
Sourceval var : node
Sourceval samp : node
Sourceval kbd : node
Sourceval sub : node
Sourceval sup : node
Sourceval b : node
Sourceval u : node
Sourceval mark : node
Sourceval bdi : node
Sourceval bdo : node
Sourceval ruby : node
Sourceval rb : node
Sourceval rt : node
Sourceval rtc : node
Sourceval rp : node
Sourceval aside : node
Sourceval ins : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?cite:Uri.t -> ?datetime:string -> t -> t
Sourceval del : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?cite:Uri.t -> ?datetime:string -> t -> t
Sourceval html : node
Sourceval title : node
Sourceval head : node
Sourceval header : node
Sourceval body : node
Sourceval nav : node
Sourceval section : node
Sourceval article : node
Sourceval address : node
Sourceval script : ?src:string -> ?typ:string -> ?charset:string -> t -> t