-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for different output formats (compact, detailed, markdown) (
#375)
- Loading branch information
Showing
16 changed files
with
421 additions
and
119 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use console::Style; | ||
use once_cell::sync::Lazy; | ||
|
||
pub(crate) static NORMAL: Lazy<Style> = Lazy::new(Style::new); | ||
pub(crate) static DIM: Lazy<Style> = Lazy::new(|| Style::new().dim()); | ||
|
||
pub(crate) static GREEN: Lazy<Style> = Lazy::new(|| Style::new().green().bright()); | ||
pub(crate) static BOLD_GREEN: Lazy<Style> = Lazy::new(|| Style::new().green().bold().bright()); | ||
pub(crate) static YELLOW: Lazy<Style> = Lazy::new(|| Style::new().yellow().bright()); | ||
pub(crate) static BOLD_YELLOW: Lazy<Style> = Lazy::new(|| Style::new().yellow().bold().bright()); | ||
pub(crate) static PINK: Lazy<Style> = Lazy::new(|| Style::new().color256(197).bright()); | ||
pub(crate) static BOLD_PINK: Lazy<Style> = Lazy::new(|| Style::new().color256(197).bold().bright()); | ||
|
||
// Write output using predefined colors | ||
macro_rules! color { | ||
($f:ident, $color:ident, $text:tt, $($tts:tt)*) => { | ||
write!($f, "{}", $color.apply_to(format!($text, $($tts)*))) | ||
}; | ||
} | ||
|
||
pub(crate) use color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.