Skip to main content

render_introspection

Function render_introspection 

Source
pub fn render_introspection(item: &dyn Introspectable) -> RenderedIntrospection
Expand description

Render an Introspectable into help-body lines + anchors. The generic shape every :describe-* produces:

{identifier} {kind icon}               ← icon from `kind_icon(kind_label)`

{doc}

{extra_section_heading}                ← anchor: section.anchor
  {extra_section_lines}

{label}: {source.as_link()}  ({source.layer.label()})

An empty doc renders as (no documentation); the sources block is omitted when Introspectable::sources is empty.

Anchor positions point at each section’s heading line. Hosts that don’t need anchors can read result.lines and ignore result.anchors.