convey icon indicating copy to clipboard operation
convey copied to clipboard

Write a demo "layout" component

Open killercup opened this issue 7 years ago • 1 comments

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.

killercup avatar Oct 05 '18 19:10 killercup

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" })),
))?;

killercup avatar Oct 07 '18 12:10 killercup