Comments (4)
Can I take this one too 😄
from tvrank.
Yes of course 😃 I think it might make sense to split it into a couple of separate issues and have an overall milestone. However you'd like to do it though it's up to you.
from tvrank.
I need some more clarification on this one. Currently the only colored part is the Rating column, and the colors are added in this part:
let rating_cell = Cell::new(rating_text).with_style(match rating { rating if rating.rating() >= 70 => GREEN, rating if (60..70).contains(&rating.rating()) => YELLOW, _ => RED, });
Is the issue that TvRank should stop doing this if the NO_COLOR variable exists, or is there a way to disable coloring completely in a more general way?
from tvrank.
As a first step, I think you need to handle two things:
- Is the
NO_COLOR
environment variable set? - Is the
--color
command-line argument passed? (You will need to add support for the--color
argument)
The latter takes precedence. Examples:
- If
NO_COLOR
is not set, and--color
is not passed, then still show colors (the default). - If
NO_COLOR
is set but--color
is passed, then still show colors. - If
NO_COLOR
is set and--color
is not passed, then don't show colors.
The places where colors are displayed are the Rating column as you mentioned, and also the column titles that are displayed in bold (I guess this can also be considered coloring) under search::create_table()
:
table.add_row(Row::new(vec![
Cell::new("Primary Title").with_style(Attr::Bold),
Cell::new("Original Title").with_style(Attr::Bold),
Cell::new("Year").with_style(Attr::Bold),
Cell::new("Rating").with_style(Attr::Bold),
Cell::new("Votes").with_style(Attr::Bold),
Cell::new("Runtime").with_style(Attr::Bold),
Cell::new("Genres").with_style(Attr::Bold),
Cell::new("Type").with_style(Attr::Bold),
Cell::new("IMDB ID").with_style(Attr::Bold),
Cell::new("IMDB Link").with_style(Attr::Bold),
]));
from tvrank.
Related Issues (20)
- Print content output to `stdout` and status output to `stderr` HOT 3
- Respect the type of output (e.g. pipe, file, stdout)
- Document the code in the `TVrank` binary
- Add tests for the `TVrank` binary
- Turn project into a workspace HOT 1
- Separate workflows to speed up CI
- Move from `structopt` to `clap` HOT 4
- Searching for "the weather man" or "the godfather" reveals no results HOT 5
- Add tests to ensure that queries with "the" as part of another word continue to work correctly
- Add doctests to the internal `TVrank` library
- `TitleID`'s `try_from` impl should fail when there are trailing non-numeric characters
- The `mark` sub-command should issue a warning when the directory's title/year does not match the given ID
- Share rustup and cargo caches between CI workflow jobs HOT 1
- Improve the CI caching and speed
- Evaluate `tabled` as a potential replacement for printing tables
- Move to `pretty_env_logger`
- TVrank cannot handle the cancellation of database downloads
- Find alternatives to `actions-rs/toolchain` and `actions-rs/cargo`
- Delete database files if error occurs during transfer
- Support custom IMDb database sources
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tvrank.