pub fn render_section_block_with_overrides(
title: &str,
body: &str,
frame_style: SectionFrameStyle,
unicode: bool,
width: Option<usize>,
render: SectionRenderContext<'_>,
tokens: SectionStyleTokens,
) -> StringExpand description
Renders one titled section body with the requested frame and style tokens.
The returned text is newline-free at the end so callers can compose several sections without trimming renderer output.
ยงExamples
use osp_cli::ui::{
SectionFrameStyle, SectionRenderContext, SectionStyleTokens, StyleOverrides,
StyleToken, render_section_block_with_overrides,
};
let theme = osp_cli::ui::resolve_theme("plain");
let rendered = render_section_block_with_overrides(
"Errors",
"- bad",
SectionFrameStyle::TopBottom,
false,
Some(18),
SectionRenderContext {
color: false,
theme: &theme,
style_overrides: &StyleOverrides::default(),
},
SectionStyleTokens::same(StyleToken::MessageError),
);
assert!(rendered.contains("Errors"));
assert!(rendered.contains("- bad"));