devkit

Development kit - general purpose library
IN THIS PACKAGE
type elem =
| Tag of string * (string * Raw.t) list
| Script of (string * Raw.t) list * string(*

attributes and contents. TODO investigate script contents encoding

*)
| Style of (string * Raw.t) list * string
| Text of Raw.t
| Close of string
type ctx
val init : unit -> ctx
val get_lnum : ctx -> int
val parse : ?ctx:ctx -> ( elem -> unit ) -> string -> unit

Scan string for html tags. NB 1. self-closing tags (e.g. <x/>) will result in two tags generated <x></x> (except for <a/>) 2. unfinished tags at the end of input are ignored

val show_raw : elem -> string
  • returns

    html string for elem

val show_raw' : elem -> string
  • returns

    html string for elem using single quote for attributes

val attrs_include : (string * Raw.t) list -> (string * string) list -> bool
val tag : string -> ?a:(string * string) list -> elem -> bool
val close : string -> elem -> bool
val make_text : ?br:bool -> elem list -> Raw.t

extract text from the list elements