Skip to content

Code entry

CodeEntry wraps content in <pre class="or-code"><code>…</code></pre> so payloads, snippets, and config blobs stay monospace and scannable on a show page. Dicts and lists are pretty-printed as JSON; strings render as-is (escaped).

Use it when operators need to inspect structured data without leaving the record view. Shared entry chrome (label above the block by default) still applies — see the overview. Pair with .grammar(...) for host highlighters and .copyable() when the payload should be one click from the clipboard.

app/orbit/resources/post_resource.py
from almasix.orbit.infolists import CodeEntry
CodeEntry.make("payload").label("Payload")

Orbit Code entry basic (light)

Orbit Code entry basic (dark)

.grammar("python") sets data-language for host highlighters. .copyable() adds the shared clipboard control.

app/orbit/resources/post_resource.py
CodeEntry.make("source").label("Source").grammar("python").copyable()

Orbit Code entry grammar (light)

Orbit Code entry grammar (dark)

Dicts and lists pretty-print as JSON inside the same <pre><code> wrapper. Pass a mapping on the record (or fill state) and the entry does the rest.

app/orbit/resources/post_resource.py
CodeEntry.make("payload").label("Webhook payload")

Orbit Code entry JSON (light)

Orbit Code entry JSON (dark)

Method Notes
.grammar data-language for syntax highlighters
.copyable / .copy_message / .copy_message_duration Clipboard
Shared chrome Label, helper, hint — see overview