Module Html_types

module Html_types : sig..end

HTML types with variants, goes with Html_sigs.​T. See also information concerning HTML 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 number = int
type numbers = number list
type coords = string list

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

type datetime = string

Date and time information.

type number_or_datetime = [ `Datetime of datetime | `Number of number ]

Either a number or 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/BCP47. See also RFC5646

type linktype = 
  [ `Alternate
  | `Archives
  | `Author
  | `Bookmark
  | `Canonical
  | `External
  | `First
  | `Help
  | `Icon
  | `Index
  | `Last
  | `License
  | `Next
  | `Nofollow
  | `Noreferrer
  | `Other of string
  | `Pingback
  | `Prefetch
  | `Prev
  | `Search
  | `Sidebar
  | `Stylesheet
  | `Tag
  | `Up ]
type linktypes = linktype 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.
  • `Canonical: Gives the preferred location for accessing the current document.
  • `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_token = 
  [ `All
  | `Aural
  | `Braille
  | `Embossed
  | `Handheld
  | `Print
  | `Projection
  | `Raw_mediadesc of string
  | `Screen
  | `Speech
  | `Tty
  | `Tv ]
type mediadesc = mediadesc_token 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 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.

P