package GT

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

Module HTMLSource

Viewing values of various types in HTML format.

Combinatorial interface

Sourcetype er = View.er

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

Sourcetype viewer = er

Type synonym to be referenced unqualified.

Sourceval toHTML : viewer -> string

String conversion.

Sourceval escape : string -> string

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

Sourceval string : string -> viewer

Escaped string.

Sourceval raw : string -> viewer

Raw string.

Viewer constructors for build-in types

Sourceval unit : unit -> viewer

unit viewer.

Sourceval int : int -> viewer

int viewer.

Sourceval float : float -> viewer

float viewer.

Sourceval bool : bool -> viewer

bool viewer.

Sourceval char : char -> viewer

char viewer.

Sequence constructors

Sourceval seq : viewer list -> viewer

List viewer.

Sourceval seqa : viewer array -> viewer

Array viewer.

Some predefined HTML-specific viewers

Sourceval anchor : string -> viewer -> viewer

anchor ref p outputs p within the anchor ref.

Sourceval ref : string -> viewer -> viewer

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

Sourceval named : string -> viewer -> viewer

named name p outputs p as named by name item.

Sourceval list : viewer list -> viewer

Outputs unordered list.

Sourceval array : viewer array -> viewer

Outputs unordered list.

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

Outputs a list of named elements.

Sourceval br : viewer

Break viewer.

Sourceval 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

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

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

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

Multi-page wizard generator

Sourcemodule Wizard : sig ... end

Helper module to provide anchors to values

Sourcemodule 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

Sourcemodule type Element = sig ... end

An abstract element to generate HTML from.

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

Functor to provide list to HTML generation.

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

Functor to provide array to HTML generation.

Sourcemodule Set (S : 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>.

Sourcemodule Map (M : 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>.

Sourcemodule Hashtbl (M : 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>.

Sourcemodule 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.

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

Functor to provide unnamed pair to HTML generation.

Sourcemodule Raw : Element with type t = string

Module to provide raw string HTML generation.

Sourcemodule String : sig ... end

Module to provide string to HTML generation.

OCaml

Innovation. Community. Security.