package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.6.tbz
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0

doc/b0.std/B0_html/At/index.html

Module B0_html.AtSource

HTML attributes.

See the attribute constructors.

Attributes

Sourcetype name = string

The type for attribute names.

Sourcetype t

The type for attributes.

Sourceval v : name -> string -> t

v n value is an attribute named n with value value. Favour use of attribute constructors whenever possible.

Sourceval void : t

void is v "" "", an attribute that doesn't get rendered. See also is_void.

Sourceval int : name -> int -> t

int n i is v n (string_of_int i).

Sourceval true' : name -> t

true' n is v n "". This sets the boolean attribute n to true. The attribute must be omitted to be false. See also if' and if_some.

Sourceval if' : bool -> t -> t

if' cond at is if cond then at else void.

Sourceval if_some : t option -> t

if_some o is at if o is Some at and void if o is None.

Predicates and comparisons

Sourceval is_void : t -> bool

is_void at is true iff the name of at is empty. These attributes render nothing. See also void.

Sourceval equal : t -> t -> bool

equal at0 at1 is true if both the name and value of at0 and at1 are String.equal.

Sourceval compare : t -> t -> int

compare is a total order on attributes compatible with equal.

Converting and formatting

Sourceval to_pair : t -> string * string

to_pair at is (n, v) the name and value of the attribute.

Sourceval of_pair : (string * string) -> t

of_pair (n, value) is v n value.

Sourceval pp : Format.formatter -> t -> unit

pp ppf at formats at on ppf using HTML syntax. is_void attributes format nothing.

Attribute constructors

See the MDN HTML attribute reference.

Sourcetype 'a cons = 'a -> t

The type for attribute constructors with attribute values of type 'a.

Sourceval accesskey : string cons
Sourceval action : string cons
Sourceval alt : string cons
Sourceval autocomplete : string cons
Sourceval autofocus : t
Sourceval charset : string cons
Sourceval checked : t
Sourceval class' : string cons
Sourceval cols : int cons
Sourceval colspan : int cons
Sourceval content : string cons
Sourceval contenteditable : bool cons
Sourceval datetime : string cons
Sourceval defer : t
Sourceval dir : string cons
Sourceval disabled : t
Sourceval draggable : bool cons
Sourceval download : string cons
Sourceval for' : string cons
Sourceval height : int cons
Sourceval hidden : t
Sourceval href : string cons
Sourceval id : string cons
Sourceval lang : string cons
Sourceval list : string cons
Sourceval media : string cons
Sourceval method' : string cons
Sourceval name : string cons
Sourceval placeholder : string cons
Sourceval popover : string cons
Sourceval popovertarget : string cons
Sourceval popovertargetaction : string cons
Sourceval rel : string cons
Sourceval required : t
Sourceval role : string cons
Sourceval rows : int cons
Sourceval rowspan : int cons
Sourceval selected : t
Sourceval spellcheck : string cons
Sourceval src : string cons
Sourceval style : string cons
Sourceval tabindex : int cons
Sourceval title : string cons
Sourceval type' : string cons
Sourceval value : string cons
Sourceval wrap : string cons
Sourceval width : int cons