feat(render): add comfy-table dependency and table border style
This commit is contained in:
Generated
+40
@@ -80,6 +80,15 @@ dependencies = [
|
||||
"rayon",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ansi-str"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "060de1453b69f46304b28274f382132f4e72c55637cf362920926a70d090890d"
|
||||
dependencies = [
|
||||
"ansitok",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ansi_colours"
|
||||
version = "1.2.3"
|
||||
@@ -89,6 +98,16 @@ dependencies = [
|
||||
"rgb",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ansitok"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0a8acea8c2f1c60f0a92a8cd26bf96ca97db56f10bbcab238bbe0cceba659ee"
|
||||
dependencies = [
|
||||
"nom 7.1.3",
|
||||
"vte",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anstream"
|
||||
version = "1.0.0"
|
||||
@@ -219,6 +238,12 @@ dependencies = [
|
||||
"password-hash",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.7.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"
|
||||
|
||||
[[package]]
|
||||
name = "async-compression"
|
||||
version = "0.4.42"
|
||||
@@ -1287,6 +1312,19 @@ dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "comfy-table"
|
||||
version = "7.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "958c5d6ecf1f214b4c2bbbbf6ab9523a864bd136dcf71a7e8904799acfe1ad47"
|
||||
dependencies = [
|
||||
"ansi-str",
|
||||
"console",
|
||||
"crossterm",
|
||||
"unicode-segmentation",
|
||||
"unicode-width",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "compression-codecs"
|
||||
version = "0.4.38"
|
||||
@@ -1435,6 +1473,7 @@ dependencies = [
|
||||
"clap_complete",
|
||||
"clap_complete_nushell",
|
||||
"colored",
|
||||
"comfy-table",
|
||||
"crossterm",
|
||||
"dirs",
|
||||
"duct",
|
||||
@@ -6657,6 +6696,7 @@ version = "0.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"memchr",
|
||||
]
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ exclude = [".github", "CONTRIBUTING.md"]
|
||||
anyhow = "1.0.69"
|
||||
bytes = "1.4.0"
|
||||
clap = { version = "4.5.40", features = ["cargo", "derive", "wrap_help"] }
|
||||
comfy-table = { version = "7.2.2", features = ["custom_styling"] }
|
||||
dirs = "6.0.0"
|
||||
dunce = "1.0.5"
|
||||
futures-util = "0.3.29"
|
||||
|
||||
@@ -621,6 +621,8 @@ pub struct MarkdownStyles {
|
||||
link_url: Color,
|
||||
strikethrough: Color,
|
||||
hrule: Color,
|
||||
#[allow(dead_code)]
|
||||
table_border: Color,
|
||||
}
|
||||
|
||||
impl MarkdownStyles {
|
||||
@@ -671,6 +673,12 @@ impl MarkdownStyles {
|
||||
let strikethrough =
|
||||
resolve_scope_style(theme, "markup.deleted", &["invalid"], truecolor);
|
||||
let hrule = resolve_scope_style(theme, "comment", &["punctuation"], truecolor);
|
||||
let table_border = resolve_scope_style(
|
||||
theme,
|
||||
"punctuation.definition.table.markdown",
|
||||
&["punctuation", "meta.separator"],
|
||||
truecolor,
|
||||
);
|
||||
|
||||
Self {
|
||||
heading: (
|
||||
@@ -687,6 +695,7 @@ impl MarkdownStyles {
|
||||
link_url: link_url.fg.unwrap_or(Color::Blue),
|
||||
strikethrough: strikethrough.fg.unwrap_or(Color::DarkGrey),
|
||||
hrule: hrule.fg.unwrap_or(Color::DarkGrey),
|
||||
table_border: table_border.fg.unwrap_or(Color::DarkGrey),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,6 +712,7 @@ impl MarkdownStyles {
|
||||
link_url: Color::Reset,
|
||||
strikethrough: Color::Reset,
|
||||
hrule: Color::Reset,
|
||||
table_border: Color::Reset,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -928,6 +938,7 @@ std::error::Error>> {
|
||||
assert_eq!(styles.link_url, Color::Reset);
|
||||
assert_eq!(styles.strikethrough, Color::Reset);
|
||||
assert_eq!(styles.hrule, Color::Reset);
|
||||
assert_eq!(styles.table_border, Color::Reset);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -945,6 +956,7 @@ std::error::Error>> {
|
||||
assert_ne!(styles.link_url, Color::Reset);
|
||||
assert_ne!(styles.strikethrough, Color::Reset);
|
||||
assert_ne!(styles.hrule, Color::Reset);
|
||||
assert_ne!(styles.table_border, Color::Reset);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1032,6 +1044,7 @@ std::error::Error>> {
|
||||
link_url: Color::Magenta,
|
||||
strikethrough: Color::DarkGrey,
|
||||
hrule: Color::DarkGrey,
|
||||
table_border: Color::DarkGrey,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1385,5 +1398,6 @@ std::error::Error>> {
|
||||
assert_eq!(styles.link_url, rgb(0x00, 0xcc, 0xff));
|
||||
assert_eq!(styles.strikethrough, rgb(0xff, 0x00, 0x00));
|
||||
assert_eq!(styles.hrule, rgb(0x88, 0x88, 0x88));
|
||||
assert_eq!(styles.table_border, rgb(0x77, 0x77, 0x77));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user