mirror of
https://github.com/nushell/nushell.git
synced 2025-03-30 10:37:29 +02:00
add 6 more table themes (#10279)
# Description After looking at a users terminal that didn't support UTF-8, I wanted to add some themes that may help them. Here's what they look like. ## psql  ## markdown  ## dots please excuse the different theme  ## restructured  ## ascii_rounded  ## basic_compact  # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> # Tests + Formatting <!-- Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use std testing; testing run-tests --path crates/nu-std"` to run the tests for the standard library > **Note** > from `nushell` you can also use the `toolkit` as follows > ```bash > use toolkit.nu # or use an `env_change` hook to activate it automatically > toolkit check pr > ``` --> # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. -->
This commit is contained in:
parent
fed4233db4
commit
2ffff959fc
@ -330,6 +330,12 @@ fn supported_table_modes() -> Vec<Value> {
|
|||||||
Value::test_string("rounded"),
|
Value::test_string("rounded"),
|
||||||
Value::test_string("thin"),
|
Value::test_string("thin"),
|
||||||
Value::test_string("with_love"),
|
Value::test_string("with_love"),
|
||||||
|
Value::test_string("psql"),
|
||||||
|
Value::test_string("markdown"),
|
||||||
|
Value::test_string("dots"),
|
||||||
|
Value::test_string("restructured"),
|
||||||
|
Value::test_string("ascii_rounded"),
|
||||||
|
Value::test_string("basic_compact"),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +157,12 @@ pub fn load_theme_from_config(config: &Config) -> TableTheme {
|
|||||||
"reinforced" => TableTheme::reinforced(),
|
"reinforced" => TableTheme::reinforced(),
|
||||||
"heavy" => TableTheme::heavy(),
|
"heavy" => TableTheme::heavy(),
|
||||||
"none" => TableTheme::none(),
|
"none" => TableTheme::none(),
|
||||||
|
"psql" => TableTheme::psql(),
|
||||||
|
"markdown" => TableTheme::markdown(),
|
||||||
|
"dots" => TableTheme::dots(),
|
||||||
|
"restructured" => TableTheme::resturctured(),
|
||||||
|
"ascii_rounded" => TableTheme::ascii_rounded(),
|
||||||
|
"basic_compact" => TableTheme::basic_compact(),
|
||||||
_ => TableTheme::rounded(),
|
_ => TableTheme::rounded(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,56 @@ impl TableTheme {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn psql() -> TableTheme {
|
||||||
|
Self {
|
||||||
|
theme: Style::psql().into(),
|
||||||
|
full_theme: Style::psql().into(),
|
||||||
|
has_inner: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn markdown() -> TableTheme {
|
||||||
|
Self {
|
||||||
|
theme: Style::markdown().into(),
|
||||||
|
full_theme: Style::markdown().into(),
|
||||||
|
has_inner: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn dots() -> TableTheme {
|
||||||
|
let theme = Style::dots().remove_horizontal().into();
|
||||||
|
Self {
|
||||||
|
theme,
|
||||||
|
full_theme: Style::dots().into(),
|
||||||
|
has_inner: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn resturctured() -> TableTheme {
|
||||||
|
Self {
|
||||||
|
theme: Style::re_structured_text().into(),
|
||||||
|
full_theme: Style::re_structured_text().into(),
|
||||||
|
has_inner: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn ascii_rounded() -> TableTheme {
|
||||||
|
Self {
|
||||||
|
theme: Style::ascii_rounded().into(),
|
||||||
|
full_theme: Style::ascii_rounded().into(),
|
||||||
|
has_inner: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn basic_compact() -> TableTheme {
|
||||||
|
let theme = Style::ascii().remove_horizontal().into();
|
||||||
|
Self {
|
||||||
|
theme,
|
||||||
|
full_theme: Style::ascii().into(),
|
||||||
|
has_inner: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn compact() -> TableTheme {
|
pub fn compact() -> TableTheme {
|
||||||
let theme = Style::modern()
|
let theme = Style::modern()
|
||||||
.remove_left()
|
.remove_left()
|
||||||
|
Loading…
Reference in New Issue
Block a user