convey
convey copied to clipboard
Write a demo "layout" component
To make it easier to have impressive outputs for custom data types, we should offer some common layout components. These components are similar to what we already have with span; they wrap a list of of child components and render them in a specific style.
To figure out how to implement this, we should pick one or two example layout components and see what we need to do to be able to write them.
One idea for a layout component I had was to wrap some features of prettytable:
out.print(table(
&["title", "date", "status"],
data.iter().map(|x| (x.title, x.data.format("YYYY-MM-DD"), if x.success { "ok" } else { "error" })),
))?;