package virtual_dom

  1. Overview
  2. Docs
OCaml bindings for the virtual-dom library

Install

Dune Dependency

Authors

Maintainers

Sources

virtual_dom-v0.16.0.tar.gz
sha256=0c6f07894dce56db88d46b3aa4f2cad1a84aeaf0009560a285492f9f2959d565

doc/virtual_dom.keyboard/Vdom_keyboard/Grouped_help_text/index.html

Module Vdom_keyboard.Grouped_help_textSource

A Grouped_help_text.t is similar to a Help_text.t, but allows the user to organize the commands into groups.

Sourcemodule Group_name : Core.Identifiable
Sourcemodule View_spec : sig ... end

View_spec is almost identical to Help_text.View_spec, but additionally allows the user to customize how to display group names.

Sourcemodule Command = Help_text.Command
Sourcetype t
include Sexplib0.Sexpable.S with type t := t
Sourceval t_of_sexp : Sexplib0.Sexp.t -> t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
include Ppx_compare_lib.Comparable.S with type t := t
Sourceval compare : t Base__Ppx_compare_lib.compare
Sourceval empty : t
Sourceval is_empty : t -> bool

In the *_exn functions below, the group name is assumed to be unique for each help text group, and an exception is raised if duplicate group names are encountered.

Sourceval of_group_list_exn : (Group_name.t * Help_text.t) list -> t

of_group_list_exn converts a list of help text groups into a grouped help text.

Sourceval add_group_exn : t -> Group_name.t -> Help_text.t -> t

add_group_exn adds a new group to a grouped help text. This is linear in the number of groups already in the grouped help text.

Sourceval groups : t -> (Group_name.t * Help_text.t) list

groups returns the help text groups in a grouped help text.

Sourceval of_command_list : ?custom_group_order:Group_name.t list -> (Group_name.t * Command.t) list -> t

of_command_list, add_command, and commands are analogous to the corresponding group functions above, but deal with single commands instead of help text groups.

Commands with the same group name are grouped together.

By default, group order is determined by the order in which the groups first appear in the command list. However, if custom_group_order is given, it will be used to determine the group order instead. Any groups that appear in custom_group_order but not in the command list will be omitted. Any groups that appear in the command list but not in custom_group_order will be added to the end of custom_group_order, in the order in which they first appear in the command list.

add_command is linear in both the number of groups in the grouped help text and the number of commands already in its group.

Sourceval add_command : t -> Group_name.t -> Command.t -> t
Sourceval commands : t -> (Group_name.t * Command.t) list

view displays a help text table with one row per command, organized into groups. Each group has a row containing the group name preceding the rows corresponding to the group's commands.

OCaml

Innovation. Community. Security.