type t = Xml.tA sequence of (X)HTML trees.
- see http://www.w3.org/TR/html5/syntax.html#the-doctype
The (X)HTML5 DOCTYPE.
val to_string : t -> stringto_string html is a valid (X)HTML5 polyglot string corresponding to the html structure.
val of_string : ?enc:Xml.encoding -> string -> tof_string ?enc html_str is the tree representation of html_str as decoded by enc. For more information about the default encoding, see Xmlm:inenc.
Note that this function converts all standard entities into their corresponding UTF-8 symbol.
val output : ?nl:bool -> ?indent:int option -> ?ns_prefix:(string -> string option) -> Xmlm.dest -> t -> unitOutputs 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.
- see http://www.w3.org/TR/html-polyglot/
Polyglot Markup
val output_doc : ?nl:bool -> ?indent:int option -> ?ns_prefix:(string -> string option) -> Xmlm.dest -> t -> unitOutputs 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.
- see http://www.w3.org/TR/html-polyglot/
Polyglot Markup
HTML library
type rel = [ | `alternate |
| `author |
| `bookmark |
| `help |
| `license |
| `next |
| `nofollow |
| `noreferrer |
| `prefetch |
| `prev |
| `search |
| `tag |
]val a : ?cls:string -> ?attrs:(string * string) list -> ?hreflang:string -> ?rel:rel -> ?target:target -> ?ty:string -> ?title:string -> ?href:Uri.t -> t -> ta 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.
val img : ?alt:string -> ?width:int -> ?height:int -> ?ismap:Uri.t -> ?title:string -> ?cls:string -> ?attrs:(string * string) list -> Uri.t -> tval html_of_string : string -> t- deprecated
use
string
val string : string -> tval html_of_int : int -> t- deprecated
use
int
val int : int -> tval html_of_float : float -> t- deprecated
use
float
val float : float -> ttype table = t array arrayval nil : t- deprecated
use
empty
val empty : tmodule Create : sig ... endHTML nodes
The type for nodes.
val tag : string -> nodetag name t returns <name>t</name> where <name> can have attributes "class" (if cls is given), "id" (if id is given) and other attributes specified by attrs. You are encouraged not to use tag but prefer the specialized versions below whenever possible.
val div : nodediv ~cls:"cl" t is <div class="cl">t</div>.
val span : nodediv ~cls:"cl" t is <div class="cl">t</div>.
val input : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?ty:string -> string -> tinput v returns a button with value "v".
- parameter ty
the type of the input. Default:
"button".
val br : tval hr : tval wbr : tA "Word Break Opportunity" node.
val param : name:string -> string -> tparam name value return a <param> node to be used in <object>.
val embed : ?width:int -> ?height:int -> ?ty:string -> ?attrs:(string * string) list -> Uri.t -> tembed uri returns an <embed> node for uri.
val col : ?cls:string -> ?style:string -> ?attrs:(string * string) list -> int -> tcol n return a <col span="n"/> tag to specify properties of columns in a <colgroup>.
source uri returns a <source> tag to be used in an <audio> or <video> tag. It specifies an alternative location uri and its type ty for the browser to choose from.
val track : ?default:bool -> ?label:string -> [ `Captions | `Chapters | `Descriptions | `Metadata | `Subtitles of string ] -> Uri.t -> ttrack uri returns a <track> node to insert in an <audio> or <video> tag. The argument of `Subtitles is the language of the track.
val keygen : ?autofocus:bool -> ?disabled:bool -> ?form:string -> ?challenge:bool -> ?keytype:[ `RSA | `DSA | `EC ] -> string -> tkeygen name return a <keygen> tag that specifies a key-pair generator field used for forms.
val anchor : string -> tval h1 : nodeval h2 : nodeval h3 : nodeval h4 : nodeval h5 : nodeval h6 : nodeval li : nodeval dt : nodeval dd : nodeval ul : ?add_li:bool -> ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?licls:string -> t list -> tval ol : ?add_li:bool -> ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?licls:string -> t list -> tval dl : ?add_dtdd:bool -> ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?dtcls:string -> ?ddcls:string -> (t * t) list -> tval p : nodeval blockquote : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?cite:Uri.t -> t -> tval pre : nodeval figure : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?figcaption:t -> t -> tval main : nodeval s : nodeThe <s> tag specifies text that is no longer correct, accurate or relevant. The <s> tag should not be used to define replaced or deleted text, use the <del> for that purpose.
val cite : nodeval abbr : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?title:string -> t -> tval time : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?datetime:string -> t -> tval code : nodeval sub : nodeval sup : nodeval b : nodeval u : nodeval mark : nodeval bdi : nodeval bdo : nodeval ruby : nodeval rb : nodeval rt : nodeval rtc : nodeval rp : nodeval aside : nodeval ins : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?cite:Uri.t -> ?datetime:string -> t -> tval del : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?cite:Uri.t -> ?datetime:string -> t -> tval html : nodeval title : nodeval header : nodeval body : nodeval section : nodeval article : nodeval address : nodeHead elements
val head : nodeval link : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?title:string -> ?media:string -> ?ty:string -> ?rel:string -> Uri.t -> tlink uri returns a <link href="uri"> element to be put in the <head>.
val meta : ?cls:string -> ?id:string -> ?name:string -> ?content:string -> ?charset:string -> (string * string) list -> tmeta attrs returns a <meta> tag to be put in the <head>.
val base : ?cls:string -> ?id:string -> ?attrs:(string * string) list -> ?target:string -> Uri.t -> tbase uri returns a <base href="uri" /> tag that specifies the base URI for all relative URLs in the HTML document.
val style : ?media:string -> ?scoped:bool -> string -> tstyle css return a <style> tag giving the css directives. This tag is typically found in the <head>. In the <body> of the document, scoped must be set to true.
- parameter scoped
Specifies that the styles only apply to this element's parent element and that element's child elements. Only for HTML5. Default:
false.
- parameter media
Specifies what media/device the media resource is optimized for.
Discouraged HTML tags
val small : nodeval i : nodeIn HTML5, it is not guaranteed that it will render text in italics.
- deprecated
Use CSS instead.
val tt : nodeThe <tt> tag is not supported in HTML5.
- deprecated
Use CSS instead.
val em : nodeval strong : nodeval var : nodeval kbd : nodeval samp : node