package GT

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Viewing values of various types in HTML format.

Combinatorial interface

type er = View.er

Type synonym for viewer function to be referenced as HTMLView.er.

type viewer = er

Type synonym to be referenced unqualified.

val toHTML : viewer -> string

String conversion.

val escape : string -> string

Escapes special HTML symbols ("<", ">", "&", """").

val string : string -> viewer

Escaped string.

val raw : string -> viewer

Raw string.

Viewer constructors for build-in types

val unit : unit -> viewer

unit viewer.

val int : int -> viewer

int viewer.

val float : float -> viewer

float viewer.

val bool : bool -> viewer

bool viewer.

val char : char -> viewer

char viewer.

Sequence constructors

val seq : viewer list -> viewer

List viewer.

val seqa : viewer array -> viewer

Array viewer.

Some predefined HTML-specific viewers

val anchor : string -> viewer -> viewer

anchor ref p outputs p within the anchor ref.

val ref : string -> viewer -> viewer

ref ref p outputs p as hyper-reference to ref.

val named : string -> viewer -> viewer

named name p outputs p as named by name item.

val list : viewer list -> viewer

Outputs unordered list.

val array : viewer array -> viewer

Outputs unordered list.

val fields : (string * viewer) list -> viewer

Outputs a list of named elements.

val br : viewer

Break viewer.

val tag : ?attrs:string -> string -> viewer -> viewer

Tagged viewer: tag name p surrounds p with open and close tags with name name. Optional argument attrs can be given to provide attributes for the tag (for example, tag "table" ~attrs:"align=center" p).

Some conventional HTML tags. Optional argument attrs provides HTML tag attributes

val html : ?attrs:string -> viewer -> viewer
val title : ?attrs:string -> viewer -> viewer
val body : ?attrs:string -> viewer -> viewer
val ul : ?attrs:string -> viewer -> viewer
val ol : ?attrs:string -> viewer -> viewer
val li : ?attrs:string -> viewer -> viewer
val b : ?attrs:string -> viewer -> viewer
val i : ?attrs:string -> viewer -> viewer
val table : ?attrs:string -> viewer -> viewer
val tr : ?attrs:string -> viewer -> viewer
val td : ?attrs:string -> viewer -> viewer
val th : ?attrs:string -> viewer -> viewer
val form : ?attrs:string -> viewer -> viewer
val input : ?attrs:string -> viewer -> viewer

Some conventional HTML inputs. Optional argument attrs provides HTML tag attributes

val checkbox : ?attrs:string -> viewer -> viewer
val button : ?attrs:string -> viewer -> viewer
val text : ?attrs:string -> viewer -> viewer
val textarea : ?attrs:string -> viewer -> viewer
val div : ?attrs:string -> viewer -> viewer
val radio : ?attrs:string -> (viewer * string * string) list -> viewer
val select : ?attrs:string -> (viewer * string * string) list -> viewer

Multi-page wizard generator

module Wizard : sig ... end

Helper module to provide anchors to values

module Anchor (X : sig ... end) : sig ... end

Functor anchor takes one argument which describes type for which values anchors are set and name to distinguish namespaces (if any).

Functorial interface

module type Element = sig ... end

An abstract element to generate HTML from.

module List (T : Element) : Element with type t = T.t list

Functor to provide list to HTML generation.

module Array (T : Element) : Element with type t = T.t array

Functor to provide array to HTML generation.

module Set (S : Stdlib.Set.S) (V : Element with type t = S.elt) : Element with type t = S.t

Functor to provide set to HTML generation. Set items are ordered in according to their <b>string representations</b>.

module Map (M : Stdlib.Map.S) (K : Element with type t = M.key) (V : Element) : Element with type t = V.t M.t

Functor to provide map to HTML generation. Set items are ordered in according to their <b>string representations</b>.

module Hashtbl (M : Stdlib.Hashtbl.S) (K : Element with type t = M.key) (V : Element) : Element with type t = V.t M.t

Functor to provide hash table to HTML generation. Set items are ordered in according to their <b>string representations</b>.

module NamedPair (N : sig ... end) (F : Element) (S : Element) : Element with type t = F.t * S.t

Functor to provide named pair to HTML generation. The first parameter sets component names.

module Pair (F : Element) (S : Element) : Element with type t = F.t * S.t

Functor to provide unnamed pair to HTML generation.

module Raw : Element with type t = string

Module to provide raw string HTML generation.

module String : sig ... end

Module to provide string to HTML generation.

OCaml

Innovation. Community. Security.