diff --git a/crates/nu-command/src/viewers/table.rs b/crates/nu-command/src/viewers/table.rs index 1bd81690be..bb2523a068 100644 --- a/crates/nu-command/src/viewers/table.rs +++ b/crates/nu-command/src/viewers/table.rs @@ -330,6 +330,12 @@ fn supported_table_modes() -> Vec { Value::test_string("rounded"), Value::test_string("thin"), 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"), ] } diff --git a/crates/nu-table/src/common.rs b/crates/nu-table/src/common.rs index 257c66749c..eac5dab57b 100644 --- a/crates/nu-table/src/common.rs +++ b/crates/nu-table/src/common.rs @@ -157,6 +157,12 @@ pub fn load_theme_from_config(config: &Config) -> TableTheme { "reinforced" => TableTheme::reinforced(), "heavy" => TableTheme::heavy(), "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(), } } diff --git a/crates/nu-table/src/table_theme.rs b/crates/nu-table/src/table_theme.rs index befbe1c46e..efe4aa0253 100644 --- a/crates/nu-table/src/table_theme.rs +++ b/crates/nu-table/src/table_theme.rs @@ -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 { let theme = Style::modern() .remove_left()