Skip to main content

Module schema_markdown

Module schema_markdown 

Source

Functions§

channel_streaming_matrix
Build the channel streaming-capability table by walking the channels section of the Config schema. Capability is derived from each channel struct’s fields, never hand-listed:
field_table
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.
field_table_for_path
Navigate the full Config schema (schema_for!(Config)) to the section at path (dotted, e.g. channels.matrix, providers.models, acp) and render that section’s fields via field_table. Map nodes (Rust HashMap<String, T>, rendered by schemars with additionalProperties) are transparently descended into their value type, and an <alias> placeholder is inserted into the displayed config prefix at each crossing so the per-field deep-links and config set commands carry the right path (channels.matrix -> channels.matrix.<alias>).
field_table_for_path_excluding
Like field_table_for_path but omits every field whose name is in exclude. Lets a directive render a shared base table once and then only the per-section extras, instead of repeating the common fields for every sibling section. Returns an empty string (not an error) when nothing remains after exclusion, so callers can render a “no extra fields” note.
generate
Generates a markdown config reference by walking the schemars JSON Schema value in memory. No intermediate JSON file, no external tools.
section_field_names
The set of field names a section path resolves to (after descending any map to its value type). Used to compute the shared base field set across many sibling sections (e.g. every model-provider slot) so a directive can render the common fields once and only the per-section extras per entry.