Module Html5_types

module Html5_types : sig..end

HTML5 types with variants. (See also Html5.​M) See also information concerning HTML5 at W3C.


Attribute types.

type cdata = string

Character data

type id = string

A document-unique identifier

type idref = string

A reference to a document-unique identifier

type idrefs = idref list

A space-separated list of references to document-unique identifiers

type name = string

A name with the same character constraints as ID above

type nmtoken = string

A name composed of only name tokens as defined in XML 1.0 See also XML 1.0

type nmtokens = nmtoken list

One or more white space separated NMTOKEN values

Data Types

type character = char

A single character from ISO 10646.

type charset = string

A character encoding, as per RFC2045 (MIME). See also RFC2045

type charsets = charset list

A space-separated list of character encodings, as per RFC2045 (MIME). See also RFC2045

type contenttype = string

A media type, as per RFC2045 (MIME). See also RFC2045

type contenttypes = contenttype list

A comma-separated list of media types, as per RFC2045 (MIME). See also RFC2045

type coords = string list

Comma- separated list of coordinates to use in defining areas.

type datetime = string

Date and time information.

type fpi = string

A character string representing an SGML Formal Public Identifier.

type frametarget = string

Frame name used as destination for results of certain actions.

type languagecode = string

A language code, as per RFC5646. See also RFC5646

type length = [ `Percent of int | `Pixels of int ]

The value may be either in pixels or a percentage of the available horizontal or vertical space. Thus, the value `Percent 50 means half of the available space.

type linktypes = 
  [ `Alternate
  | `Archives
  | `Author
  | `Bookmark
  | `External
  | `First
  | `Help
  | `Icon
  | `Index
  | `Last
  | `License
  | `Next
  | `Nofollow
  | `Noreferrer
  | `Other of string
  | `Pingback
  | `Prefetch
  | `Prev
  | `Search
  | `Sidebar
  | `Stylesheet
  | `Tag
  | `Up ] list

Authors may use the following recognized link types, listed here with their conventional interpretations. A LinkTypes value refers to a space-separated list of link types. White space characters are not permitted within link types. These link types are case-insensitive, i.e., "Alternate" has the same meaning as "alternate".

User agents, search engines, etc. may interpret these link types in a variety of ways. For example, user agents may provide access to linked documents through a navigation bar.

  • `Alternate: Gives alternate representations of the current document.
  • `Archives: Provides a link to a collection of records, documents, or other materials of historical interest.
  • `Author: Gives a link to the current document's author.
  • `Bookmark: Gives the permalink for the nearest ancestor section.
  • `External: Indicates that the referenced document is not part of the same site as the current document.
  • `First: Indicates that the current document is a part of a series, and that the first document in the series is the referenced document.
  • `Help: Provides a link to context-sensitive help.
  • `Icon: Imports an icon to represent the current document.
  • `Index: Gives a link to the document that provides a table of contents or index listing the current document.
  • `Last: Indicates that the current document is a part of a series, and that the last document in the series is the referenced document.
  • `Licence: Indicates that the main content of the current document is covered by the copyright license described by the referenced document.
  • `Next: Indicates that the current document is a part of a series, and that the next document in the series is the referenced document.
  • `Nofollow: Indicates that the current document's original author or publisher does not endorse the referenced document.
  • `Noreferrer: Requires that the user agent not send an HTTP Referer (sic) header if the user follows the hyperlink.
  • `Pingback: Gives the address of the pingback server that handles pingbacks to the current document.
  • `Prefetch: Specifies that the target resource should be preemptively cached.
  • `Prev: Indicates that the current document is a part of a series, and that the previous document in the series is the referenced document.
  • `Search: Gives a link to a resource that can be used to search through the current document and its related pages.
  • `Stylesheet: Imports a stylesheet.
  • `Sidebar: Specifies that the referenced document, if retrieved, is intended to be shown in the browser's sidebar (if it has one).
  • `Tag: Gives a tag (identified by the given address) that applies to the current document.
  • `Up: Provides a link to a document giving the context for the current document.
type mediadesc = 
  [ `All
  | `Aural
  | `Braille
  | `Embossed
  | `Handheld
  | `Print
  | `Projection
  | `Raw_mediadesc of string
  | `Screen
  | `Speech
  | `TTY
  | `TV ] list

The MediaDesc attribute is a comma-separated list of media descriptors. The following is a list of recognized media descriptors:

  • `Screen: For non-paged computer screens.
  • `TTY: For media using a fixed-pitch character grid (like teletypes, terminals, or devices with limited display capabilities).
  • `TV: For TV-type devices (low resolution, limited scrollability).
  • `Projection: For projectors.
  • `Handheld: For handheld devices (small screen, limited bandwidth).
  • `Print: For paged and for documents viewed on screen in print preview mode.
  • `Braille: For braille tactile feedback devices.
  • `Aural: For speech synthesizers.
  • `All: For speech synthesizers.
  • `Raw_mediadesc: For more complex (untyped) media descriptors.
type multilength = [ `Percent of int | `Pixels of int | `Relative of int ]

The value may be a Length or a relative length. A relative length has the form "i*", where "i" is an integer. When allotting space among elements competing for that space, user agents allot pixel and percentage lengths first, then divide up remaining available space among relative lengths. Each relative length receives a portion of the available space that is proportional to the integer preceding the "*". The value "*" is equivalent to "1*". Thus, if 60 pixels of space are available after the user agent allots pixel and percentage space, and the competing relative lengths are "1*", "2*", and "3*", the "1*" will be allotted 10 pixels, the "2*" will be allotted 20 pixels, and the "3*" will be allotted 30 pixels.

type multilengths = multilength list

A comma separated list of items of type MultiLength.

type number = int
type numbers = number list
type float_number = float
type pixels = int

The value is an integer that represents the number of pixels of the canvas (screen, paper). Thus, the value "50" means fifty pixels. For normative information about the definition of a pixel, please consult CSS2. See also CSS2

type script_ = string

Script data can be the content of the "script" element and the value of intrinsic event attributes. User agents must not evaluate script data as HTML markup but instead must pass it on as data to a script engine.

The case-sensitivity of script data depends on the scripting language.

Please note that script data that is element content may not contain character references, but script data that is the value of an attribute may contain them.

type text = string

Arbitrary textual data, likely meant to be human-readable.

Core

type i18n = [ `XML_lang ]
type core = 
  [ `Accesskey
  | `Class
  | `Contenteditable
  | `Contextmenu
  | `Dir
  | `Draggable