Skip to main content

field_table

Function field_table 

Source
pub fn field_table(
    root: &Value,
    include_enabled: bool,
    prefix: Option<&str>,
    defaults: Option<&Value>,
) -> String
Expand description

Renders a single struct’s fields as an interactive config table from that struct’s schema_for! JSON value. Top-level enabled is skipped by default since channel pages document it separately; pass include_enabled = true to keep it. $ref types resolve against the schema’s own $defs. This is the same type/default/description extraction used by generate, so a per-channel field table can never drift from the global config reference.

When prefix is Some (the struct’s dotted config path, e.g. channels.mattermost.<alias>), the table is emitted as raw HTML with each field name as an accordion trigger: clicking a field expands a detail row directly beneath it carrying the per-field gateway-dashboard deep-link, zerocode location, and zeroclaw config set command. The pc-enhance.js installConfigFieldRows handler wires the toggle. When prefix is None, a plain Markdown table is emitted (no accordion).