console-rs / indicatif

A command line progress reporting library for Rust
MIT License
4.21k stars 238 forks source link

Add minimal examples demonstrating Formatters #600

Closed Chris--B closed 8 months ago

Chris--B commented 8 months 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.