Open bdarcus opened 1 year ago
In general, prettytable may be useful as a model for how to handle configurable formatting.
But see also how they handle constants.
https://github.com/phsym/prettytable-rs/blob/4d66e6ebddcd52b641369042b68959ad323d9ad0/src/format.rs#L354
.... though it seems lazy_static! is now discouraged, and this new feature recommended instead.
lazy_static!
https://doc.rust-lang.org/std/sync/struct.LazyLock.html
... and also its renderer.
Jotdown has a similar Render trait worth looking at.
Render
https://github.com/hellux/jotdown/blob/0173db178a73d2841aae5656d12f6c0159b285cf/src/lib.rs#L102
In general, prettytable may be useful as a model for how to handle configurable formatting.
But see also how they handle constants.
https://github.com/phsym/prettytable-rs/blob/4d66e6ebddcd52b641369042b68959ad323d9ad0/src/format.rs#L354
.... though it seems
lazy_static!
is now discouraged, and this new feature recommended instead.https://doc.rust-lang.org/std/sync/struct.LazyLock.html
... and also its renderer.
Jotdown has a similar
Render
trait worth looking at.https://github.com/hellux/jotdown/blob/0173db178a73d2841aae5656d12f6c0159b285cf/src/lib.rs#L102