Module Incr_dom_keyboard.Grouped_help_text
A Grouped_help_text.t
is similar to a Help_text.t
, but allows the user to organize the commands into groups.
module Group_name : Core_kernel.Identifiable
module View_spec : sig ... end
View_spec
is almost identical toHelp_text.View_spec
, but additionally allows the user to customize how to display group names.
module Command = Help_text.Command
include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
val sexp_of_t : t -> Sexplib0.Sexp.t
val 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.
val 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.
val groups : t -> (Group_name.t * Help_text.t) list
groups
returns the help text groups in a grouped help text.
val of_command_list : (Group_name.t * Command.t) list -> t
of_command_list
,add_command
, andcommands
are analogous to the correspondinggroup
functions above, but deal with single commands instead of help text groups.Commands with the same group name are grouped together.
Also,
add_command
is linear in both the number of groups in the grouped help text and the number of commands already in its group.
val add_command : t -> Group_name.t -> Command.t -> t
val commands : t -> (Group_name.t * Command.t) list
val view : t -> View_spec.t -> Incr_dom_keyboard__.Import.Vdom.Node.t
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.