Module Html_Node

This module defines HTML nodes

The types correspond to the content categories so that only valid children are around for an element.

Due to some political differences, there are currently two organitzations that work on the HTML specs: WHATWG and W3C.

The WHATWG HTML spec is currently considered the authoritative source. W3C also published the HTML 5.2 spec that will also be referenced in these docs.

type +'node t
module Node : sig ... end
include Node
type a = [
| `a
]
type abbr = [
| `abbr
]
type address = [
| `address
]
type area = [
| `area
]
type article = [
| `article
]
type aside = [
| `aside
]
type audio = [
| `audio
]
type b = [
| `b
]
type base = [
| `base
]
type bdi = [
| `bdi
]
type bdo = [
| `bdo
]
type blockquote = [
| `blockquote
]
type body = [
| `body
]
type br = [
| `br
]
type button = [
| `button
]
type canvas = [
| `canvas
]
type caption = [
| `caption
]
type cite = [
| `cite
]
type code = [
| `code
]
type col = [
| `col
]
type colgroup = [
| `colgroup
]
type data = [
| `data
]
type datalist = [
| `datalist
]
type dd = [
| `dd
]
type del = [
| `del
]
type details = [
| `details
]
type dfn = [
| `dfn
]
type dialog = [
| `dialog
]
type div = [
| `div
]
type dl = [
| `dl
]
type dt = [
| `dt
]
type em = [
| `em
]
type embed = [
| `embed
]
type fieldset = [
| `fieldset
]
type figcaption = [
| `figcaption
]
type figure = [
| `figure
]
type form = [
| `form
]
type h1 = [
| `h1
]
type h2 = [
| `h2
]
type h3 = [
| `h3
]
type h4 = [
| `h4
]
type h5 = [
| `h5
]
type h6 = [
| `h6
]
type head = [
| `head
]
type header = [
| `header
]
type hgroup = [
| `hgroup
]
type hr = [
| `hr
]
type html = [
| `html
]
type i = [
| `i
]
type iframe = [
| `iframe
]
type img = [
| `img
]
type input = [
| `input
]
type ins = [
| `ins
]
type kbd = [
| `kbd
]
type label = [
| `label
]
type legend = [
| `legend
]
type li = [
| `li
]
type main = [
| `main
]
type map = [
| `map
]
type mark = [
| `mark
]
type meta = [
| `meta
]
type meter = [
| `meter
]
type nav = [
| `nav
]
type noscript = [
| `noscript
]
type option = [
| `option
]
type object_ = [
| `object_
]
type ol = [
| `ol
]
type optgroup = [
| `optgroup
]
type output = [
| `output
]
type p = [
| `p
]
type param = [
| `param
]
type picture = [
| `picture
]
type pre = [
| `pre
]
type progress = [
| `progress
]
type q = [
| `q
]
type rb = [
| `rb
]
type rp = [
| `rp
]
type rt = [
| `rt
]
type rtc = [
| `rtc
]
type ruby = [
| `ruby
]
type s = [
| `s
]
type samp = [
| `samp
]
type script = [
| `script
]
type section = [
| `section
]
type select = [
| `select
]
type source = [
| `source
]
type span = [
| `span
]
type slot = [
| `slot
]
type small = [
| `small
]
type strong = [
| `strong
]
type style = [
| `style
]
type sub = [
| `sub
]
type summary = [
| `summary
]
type sup = [
| `sup
]
type table = [
| `table
]
type tbody = [
| `tbody
]
type td = [
| `td
]
type template = [
| `template
]
type textarea = [
| `textarea
]
type tfoot = [
| `tfoot
]
type th = [
| `th
]
type thead = [
| `thead
]
type time = [
| `time
]
type title = [
| `title
]
type tr = [
| `tr
]
type track = [
| `track
]
type u = [
| `u
]
type ul = [
| `ul
]
type var = [
| `var
]
type video = [
| `video
]
type wbr = [
| `wbr
]
type text = [
| `text
]
type fragment = [
| `fragment
]
type flex_item = [
| `flex_item
]
type +'a custom = [
| `custom of 'a
]

Custom Elements

type empty = br

Elements with no children

type headings = [
| h1
| h2
| h3
| h4
| h5
| h6
]
type other = [
| text
| fragment
]
module ContentCategory : sig ... end
include ContentCategory
type none = [
| caption
| col
| colgroup
| dd
| dt
| figcaption
| head
| html
| legend
| li
| optgroup
| option
| param
| rb
| rp
| rt
| rtc
| source
| summary
| tbody
| tfoot
| th
| thead
| tr
| track
]
type metadata = [
| base
| template
| title
| meta
| noscript
| script
| style
]
type standard_flow = [
| a
| abbr
| address
| area
| article
| aside
| audio
| b
| bdi
| bdo
| blockquote
| br
| button
| canvas
| cite
| code
| data
| datalist
| del
| details
| dfn
| dialog
| div
| dl
| em
| embed
| fieldset
| figure
| footer
| form
| headings
| hgroup
| header
| hr
| i
| iframe
| img
| input
| ins
| kbd
| label
| main
| map
| mark
| meta
| meter
| nav
| noscript
| object_
| ol
| output
| p
| picture
| pre
| progress
| q
| ruby
| s
| samp
| script
| section
| select
| slot
| small
| span
| strong
| sub
| sup
| table
| template
| textarea
| time
| u
| ul
| var
| video
| wbr
]
type 'a flow = [
| standard_flow
| 'a custom
]
type sectioning = [
| article
| aside
| nav
| section
]
type sectioning_root = [
| blockquote
| body
| details
| dialog
| fieldset
| figure
| td
]
type heading = [
| headings
| hgroup
]
type standard_phrasing = [
| a
| abbr
| area
| article
| aside
| audio
| b
| bdi
| bdo
| br
| button
| canvas
| cite
| code
| data
| datalist
| del
| dfn
| em
| embed
| i
| iframe
| img
| input
| ins
| kbd
| label
| map
| mark
| meta
| meter
| noscript
| object_
| output
| picture
| progress
| q
| ruby
| s
| samp
| script
| select
| slot
| small
| span
| strong
| sub
| sup
| template
| textarea
| time
| u
| var
| video
| wbr
]
type 'a phrasing = [
| standard_phrasing
| 'a custom
]
type embedded = [
| audio
| canvas
| em
| iframe
| img
| object_
| picture
| video
]
type interactive = [
| a
| audio
| button
| details
| em
| iframe
| img
| input
| label
| object_
| select
| textarea
| video
]
type standard_palpable = [
| a
| abbr
| address
| article
| aside
| audio
| b
| bdi
| bdo
| blockquote
| button
| canvas
| cite
| code
| data
| details
| dfn
| em
| figure
| footer
| form
| headings
| hgroup
| header
| i
| iframe
| img
| input
| ins
| kbd
| label
| main
| map
| mark
| meter
| nav
| object_
| ol
| output
| p
| pre
| progress
| q
| ruby
| s
| samp
| section
| select
| small
| strong
| sub
| sup
| table
| textarea
| time
| u
| ul
| var
| video
]
type 'a palpable = [
| standard_palpable
| 'a custom
]
module Element = ContentCategory.Element
type standard_element = [
| embedded
| standard_flow
| heading
| interactive
| metadata
| standard_palpable
| standard_phrasing
| sectioning
| sectioning_root
]
type 'a element = [
| embedded
| 'a flow
| heading
| interactive
| metadata
| 'a palpable
| 'a phrasing
| sectioning
| sectioning_root
| Element.category
| none
]
type 'a content = [
| 'a element
| other
| flex_item
]
external to_text_node : [> text ] as a t -> Dom.text = "%identity"
external to_fragment : [> fragment ] as a t -> Dom.documentFragment = "%identity"
external to_node : [< _ content ] t -> Dom.node = "%identity"
external to_element : [< _ element ] t -> Dom.element = "%identity"
external from_node : Dom.node -> [< _ content ] t = "%identity"
val show_element : [< 'a element ] t -> string
val show_text : [> text ] t -> string
external nodeList_to_array : Dom.nodeList -> Dom.node array = "Array.prototype.slice.call" "BS"
val show_fragment : [> fragment ] t -> string
val show : [< `a | `abbr | `address | `area | `article | `aside | `audio | `b | `base | `bdi | `bdo | `blockquote | `body | `br | `button | `canvas | `caption | `cite | `code | `col | `colgroup | `custom of 'a * 'b | `data | `datalist | `dd | `del | `details | `dfn | `dialog | `div | `dl | `dt | `em | `embed | `fieldset | `figcaption | `figure | `flex_item | `footer | `form | `fragment | `h1 | `h2 | `h3 | `h4 | `h5 | `h6 | `head | `header | `hgroup | `hr | `html | `i | `iframe | `img | `input | `ins | `kbd | `label | `legend | `li | `link | `main | `map | `mark | `meta | `meter | `nav | `noscript | `object_ | `ol | `optgroup | `option | `output | `p | `param | `picture | `pre | `progress | `q | `rb | `rp | `rt | `rtc | `ruby | `s | `samp | `script | `section | `select | `slot | `small | `source | `span | `strong | `style | `sub | `summary | `sup | `table | `tbody | `td | `template | `text | `textarea | `tfoot | `th | `thead | `time | `title | `tr | `track | `u | `ul | `var | `video | `wbr ] t -> string
val show_doc : html t -> string
val append_to : string -> [< 'a content ] t -> unit
val append_to_body : [< 'a content ] t -> unit