console-rs / indicatif

A command line progress reporting library for Rust
MIT License
4.46k stars 243 forks source link

Add minimal examples demonstrating Formatters #600

Closed Chris--B closed 1 year ago

Chris--B commented 1 year ago

This change adds some doc tests to show off what the formatter looks like. This change adds it for just the byte variants:

I wanted to know what these formatters look like, preferably from the docs. This is the simplest way that comes to mind, but I'm open to doing this differently if there's alternatives. I only did the Byte variants with this. I'm happy to work on the others but want to make sure this direction is accepted first.

Here's what my local rustdoc docs look like after this change:

image

These also double as tests, and cargo test will fail if their behavior changes.