package odig

  1. Overview
  2. Docs

HTML generation.

Generation sequences

type 'a seq

The type for sequences.

val empty : 'a seq

An empty sequence.

val (++) : 'a seq -> 'a seq -> 'a seq

s ++ s' is sequence s' concatenated to s.

HTML generation

type att

The type for attributes.

type attv

The type for attribute values.

type t

The type for elements or character data.

val attv : string -> attv seq

attv v is an attribute value v.

val att : string -> attv seq -> att seq

att a v is an attribute a with value v.

val data : string -> t seq

data d is character data d.

val el : string -> ?atts:att seq -> t seq -> t seq

el e ~atts c is an element e with attribute atts and content c.

Derived attributes

val href : string -> att seq

href l is an href attribute with value l.

val id : string -> att seq

id i is an id attribute with value i.

val class_ : string -> att seq

class_ c is a class attribute c.

Derived elements

val a : ?atts:att seq -> t seq -> t seq
val div : ?atts:att seq -> t seq -> t seq
val meta : ?atts:att seq -> t seq -> t seq
val nav : ?atts:att seq -> t seq -> t seq
val code : ?atts:att seq -> t seq -> t seq
val ul : ?atts:att seq -> t seq -> t seq
val ol : ?atts:att seq -> t seq -> t seq
val li : ?atts:att seq -> t seq -> t seq
val dl : ?atts:att seq -> t seq -> t seq
val dt : ?atts:att seq -> t seq -> t seq
val dd : ?atts:att seq -> t seq -> t seq
val p : ?atts:att seq -> t seq -> t seq
val h1 : ?atts:att seq -> t seq -> t seq
val h2 : ?atts:att seq -> t seq -> t seq
val span : ?atts:att seq -> t seq -> t seq
val body : ?atts:att seq -> t seq -> t seq
val html : ?atts:att seq -> t seq -> t seq

Output

val buffer_add : ?doc_type:bool -> Buffer.t -> t seq -> unit

buffer_add ~doc_type b h adds the sequence h to b. If doc_type is true (default) an HTML doctype declaration is prepended.

val to_string : ?doc_type:bool -> t seq -> string

to_string is like buffer_add but returns directly a string.

val output : ?doc_type:bool -> Pervasives.out_channel -> t seq -> unit

output is like buffer_add but outputs directly on a channel.