OCaml HTML5 parser/serialiser based on Python's JustHTML
1(** Registry for HTML5 element specifications.
2
3 Provides fast lookup of element specs by name. *)
4
5(** The type of an element registry. *)
6type t
7
8(** {1 Creation and Modification} *)
9
10val create : unit -> t
11(** [create ()] creates a new empty element registry. *)
12
13val register : t -> Element_spec.t -> unit
14(** [register registry spec] adds an element specification to the registry.
15
16 If an element with the same name already exists, it is replaced. *)
17
18(** {1 Lookup} *)
19
20val get : t -> string -> Element_spec.t option
21(** [get registry name] looks up an element specification by tag name.
22
23 Returns [None] if the element is not registered. Tag names are
24 case-insensitive. *)
25
26val list_names : t -> string list
27(** [list_names registry] returns a sorted list of all registered element names. *)
28
29val all : t -> Element_spec.t list
30(** [all registry] returns all registered element specifications. *)
31
32(** {1 Default Registry} *)
33
34val default : unit -> t
35(** [default ()] creates a registry pre-populated with all standard HTML5 elements.
36
37 The registry includes elements from:
38 - {!Elements_document} - Document structure and sectioning
39 - {!Elements_text} - Text-level semantics
40 - {!Elements_form} - Forms and input controls
41 - {!Elements_embedded} - Embedded content
42 - {!Elements_table} - Tables
43 - {!Elements_interactive} - Interactive elements *)