Skip to content

Commit

Permalink
Complete revamp and rewrite the crate.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Jul 7, 2023
1 parent 6eda2e5 commit b186eb5
Show file tree
Hide file tree
Showing 22 changed files with 2,084 additions and 1,508 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
target/
**/*.rs.bk
Cargo.lock
/target
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

29 changes: 15 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
[package]
name = "yansi"
version = "0.6.0-dev"
authors = ["Sergio Benitez <sb@sergio.bz>"]
repository = "https://github.com/SergioBenitez/yansi"
documentation = "https://docs.rs/yansi"
description = "A dead simple ANSI terminal color painting library."
keywords = ["ansi", "terminal", "color", "format", "paint"]
readme = "README.md"
license = "MIT/Apache-2.0"
categories = ["command-line-interface"]
version = "0.1.0"
edition = "2021"

[badges]
travis-ci = { repository = "SergioBenitez/yansi", branch = "master" }
[package.metadata.docs.rs]
all-features = true

[dependencies]
[features]
default = ["std"]
detect-tty = ["is-terminal", "std"]
detect-env = ["std"]
std = ["alloc"]
alloc = []

# hidden feature to enable nightly doc cfg
_nightly = []

[dev-dependencies]
serial_test = "0.6"
[dependencies]
is-terminal = { version = "0.4.7", optional = true }
201 changes: 0 additions & 201 deletions LICENSE-APACHE

This file was deleted.

19 changes: 0 additions & 19 deletions LICENSE-MIT

This file was deleted.

46 changes: 1 addition & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,3 @@
# yansi

[![Build Status](https://travis-ci.org/SergioBenitez/yansi.svg?branch=master)](https://travis-ci.org/SergioBenitez/yansi)
[![Current Crates.io Version](https://img.shields.io/crates/v/yansi.svg)](https://crates.io/crates/yansi)
[![Documentation](https://docs.rs/yansi/badge.svg)](https://docs.rs/yansi)

A dead simple ANSI terminal color painting library for Rust.

```rust
use yansi::Paint;

print!("{} light, {} light!", Paint::green("Green"), Paint::red("red").underline());
```

See the [documentation](https://docs.rs/yansi/) for more.

# Why?

Several terminal coloring libraries exist ([`ansi_term`], [`colored`],
[`term_painter`], to name a few), begging the question: why yet another? Here
are a few reasons:

* This library is _much_ simpler: there are three types!
* Unlike [`ansi_term`] or [`colored`], _any_ type implementing `Display`
or `Debug` can be stylized, not only strings.
* Styling can be enabled and disabled globally, on the fly.
* Arbitrary items can be [_masked_] for selective disabling.
* Styling can [_wrap_] any arbitrarily styled item.
* Typically only one type needs to be imported: `Paint`.
* Zero dependencies. It really is simple.
* The name `yansi` is pretty short.

All that being said, this library borrows API ideas from the three libraries as
well as implementation details from [`ansi_term`].

[`ansi_term`]: https://crates.io/crates/ansi_term
[`colored`]: https://crates.io/crates/colored
[`term_painter`]: https://crates.io/crates/term-painter
[_masked_]: https://docs.rs/yansi/#masking
[_wrap_]: https://docs.rs/yansi/#wrapping

## License

`yansi` is licensed under either of the following, at your option:

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
This is an almost finished complete rewrite of yansi.
Loading

0 comments on commit b186eb5

Please sign in to comment.