Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.form

The canonical per-form DISPLAY contract — ONE source of truth for the fields a channel reads to render an executed form, live (via the gateway) and restored (via the DB).

Why this exists: the SAME field set used to be hand-listed in independent allowlists across the loop, persistence, gateway, progress, and restored display paths. Now every layer projects the WHOLE set through ->display (outbound) / <-wire (inbound), so a new display field is a ONE-line change to display-keys and form-roundtrip-test fails if a boundary stops carrying it.

Transformed fields (:stdout/:error bounded, :silent/:duration_ms renamed) stay as explicit gateway overrides — they are not carried verbatim, so they are NOT in this set.

The canonical per-form DISPLAY contract — ONE source of truth for the fields a
channel reads to render an executed form, live (via the gateway) and restored
(via the DB).

Why this exists: the SAME field set used to be hand-listed in independent
allowlists across the loop, persistence, gateway, progress, and restored display
paths. Now every layer projects the WHOLE set through `->display` (outbound) /
`<-wire` (inbound), so a new display field is a ONE-line change to
`display-keys` and `form-roundtrip-test` fails if a boundary stops carrying it.

Transformed fields (`:stdout`/`:error` bounded, `:silent`/`:duration_ms`
renamed) stay as explicit gateway overrides — they are not carried verbatim, so
they are NOT in this set.
raw docstring

->displayclj

(->display m)

Project the canonical display fields off a source map (loop chunk/block, a restored row) — the ONE projection every form builder + the gateway uses instead of hand-listing keys. Drops nils so a merge never stamps empty keys.

Project the canonical display fields off a source map (loop chunk/block, a
restored row) — the ONE projection every form builder + the gateway uses
instead of hand-listing keys. Drops nils so a merge never stamps empty keys.
sourceraw docstring

<-wireclj

(<-wire event)

Read the canonical display fields back off a gateway WIRE event into a form, using the literal wire spelling declared beside each engine key in display-fields. The single inbound projection channels use — the mirror of ->display.

Read the canonical display fields back off a gateway WIRE event into a form,
using the literal wire spelling declared beside each engine key in
`display-fields`. The single inbound projection channels use — the mirror of
`->display`.
sourceraw docstring

display-keysclj

The canonical engine keys projected by ->display and recovered by <-wire.

The canonical engine keys projected by `->display` and recovered by `<-wire`.
sourceraw docstring

result-cardclj

(result-card {:keys [op result-summary result-render]})

Canonical result CARD descriptor — the ONE place the card / collapse decision is made, so the TUI and web AGREE on summary/collapsible instead of each re-deriving it from the raw form. Given an executed form map (or one of the canonical MINI-FORMS a python block carries in :cards, one per printed result), returns:

{:op grep — the printed value's OWN op, verbatim data it carried out of the sandbox, nil for the block's own output. A channel titles the card from this or from nothing; no display NAME is minted here :summary 12 results — the HEADLINE (:result-summary), nil when the value carried no tally :body …markdown… — the detail body (:result-render), nil when there is nothing under the headline :collapsible? true} — true ⇔ there's a body to fold under the summary (a chevron/<details>)

nil when the form has neither headline nor body — there is no card, and the channel renders whatever the form itself carries.

Canonical result CARD descriptor — the ONE place the card / collapse decision is
made, so the TUI and web AGREE on summary/collapsible instead of each
re-deriving it from the raw form. Given an executed form map (or one of the
canonical MINI-FORMS a python block carries in `:cards`, one per printed
result), returns:

  {:op           `grep`             — the printed value's OWN op, verbatim
                                       data it carried out of the sandbox, nil
                                       for the block's own output. A channel
                                       titles the card from this or from
                                       nothing; no display NAME is minted here
   :summary      12 results          — the HEADLINE (`:result-summary`), nil
                                       when the value carried no tally
   :body         …markdown…          — the detail body (`:result-render`), nil
                                       when there is nothing under the headline
   :collapsible? true}               — true ⇔ there's a body to fold under
                                       the summary (a chevron/`<details>`)

`nil` when the form has neither headline nor body — there is no card, and the
channel renders whatever the form itself carries.
sourceraw docstring

result-cardsclj

(result-cards form)

The card descriptor(s) a form renders — the ONE place a channel asks "what cards does this form show?" so the TUI and web never re-derive it differently.

A python block that print()ed several results carries a :cards vector of canonical mini-forms; each becomes its OWN card via result-card. Any other form yields its single result-card (or none). Always a vector — channels just iterate. Empty when the form printed nothing and returned nothing.

The card descriptor(s) a form renders — the ONE place a channel asks "what
cards does this form show?" so the TUI and web never re-derive it differently.

A python block that print()ed several results carries a `:cards` vector of
canonical mini-forms; each becomes its OWN card via `result-card`. Any other
form yields its single `result-card` (or none). Always a vector — channels just
iterate. Empty when the form printed nothing and returned nothing.
sourceraw docstring

with-display-codeclj

(with-display-code form)

Attach the canonical cached ruff rendering of a form's Python source. Channels render :display-code verbatim; local callers without it may use the same formatter. Nested result cards are normalized recursively.

An AUTHORED :display-code is never overwritten: a form that already carries the source a channel must paint — paired with its :display-language — keeps it verbatim.

Attach the canonical cached ruff rendering of a form's Python source.
Channels render `:display-code` verbatim; local callers without it may use
the same formatter. Nested result cards are normalized recursively.

An AUTHORED `:display-code` is never overwritten: a form that already carries
the source a channel must paint — paired with its `:display-language` — keeps
it verbatim.
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