Liking cljdoc? Tell your friends :D

charm.components.help

Help component for displaying key bindings.

Usage: (def bindings [{:key "j/k" :desc "up/down"} {:key "q" :desc "quit"}]) (def my-help (help bindings))

;; In view function: (help-view my-help)

Help component for displaying key bindings.

Usage:
  (def bindings [{:key "j/k" :desc "up/down"}
                 {:key "q" :desc "quit"}])
  (def my-help (help bindings))

  ;; In view function:
  (help-view my-help)
raw docstring

add-bindingclj

(add-binding hlp key desc)

Add a binding.

Add a binding.
sourceraw docstring

bindingsclj

(bindings hlp)

Get the bindings.

Get the bindings.
sourceraw docstring

from-pairsclj

(from-pairs & args)

Create bindings from pairs of [key desc] or interleaved key desc args.

Examples: (from-pairs ["j/k" "up/down"] ["q" "quit"]) (from-pairs "j/k" "up/down" "q" "quit")

Create bindings from pairs of [key desc] or interleaved key desc args.

Examples:
  (from-pairs ["j/k" "up/down"] ["q" "quit"])
  (from-pairs "j/k" "up/down" "q" "quit")
sourceraw docstring

helpclj

(help bindings
      &
      {:keys [width separator show-all key-style desc-style separator-style
              ellipsis id]
       :or {width 0
            separator " • "
            show-all false
            ellipsis "…"
            id (rand-int 1000000)}})

Create a help component.

Bindings is a sequence of maps with :key and :desc keys, or a sequence of [key desc] pairs.

Options: :width - Maximum width (0 = unlimited) :separator - Separator between bindings (default " • ") :show-all - Show full help instead of short (default false) :key-style - Style for key text :desc-style - Style for description text :separator-style - Style for separator :ellipsis - Ellipsis when truncated (default "…") :id - Unique ID

Create a help component.

Bindings is a sequence of maps with :key and :desc keys, or a sequence
of [key desc] pairs.

Options:
  :width          - Maximum width (0 = unlimited)
  :separator      - Separator between bindings (default " • ")
  :show-all       - Show full help instead of short (default false)
  :key-style      - Style for key text
  :desc-style     - Style for description text
  :separator-style - Style for separator
  :ellipsis       - Ellipsis when truncated (default "…")
  :id             - Unique ID
sourceraw docstring

help-initclj

(help-init hlp)

Initialize help, returns [help cmd].

Initialize help, returns [help cmd].
sourceraw docstring

help-updateclj

(help-update hlp _msg)

Update help state. Help components don't typically handle messages directly - use toggle-show-all for ? key handling in your update fn. Returns [help nil].

Update help state. Help components don't typically handle messages
directly - use toggle-show-all for ? key handling in your update fn.
Returns [help nil].
sourceraw docstring

help-viewclj

(help-view hlp)

Render the help to a string.

Render the help to a string.
sourceraw docstring

set-bindingsclj

(set-bindings hlp bs)

Set the bindings.

Set the bindings.
sourceraw docstring

set-show-allclj

(set-show-all hlp show?)

Set whether to show full help.

Set whether to show full help.
sourceraw docstring

set-widthclj

(set-width hlp w)

Set the width constraint.

Set the width constraint.
sourceraw docstring

show-all?clj

(show-all? hlp)

Check if showing full help.

Check if showing full help.
sourceraw docstring

toggle-show-allclj

(toggle-show-all hlp)

Toggle between short and full help.

Toggle between short and full help.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close