summaryrefslogtreecommitdiffstats
path: root/zellij-utils
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-08-26 15:06:59 +0200
committera-kenji <aks.kenji@protonmail.com>2021-08-26 15:06:59 +0200
commitcd0b0119a022926e659d941f3013b618164e6881 (patch)
tree10575129e6ff3c9da604f8fe622511cbb9987a43 /zellij-utils
parent06e3be6205bdde46b01f21d95180fcb641e42816 (diff)
Split tab-layout into `template` & `tabs` section
* adjust example layouts and move them from `./example` to `./example/layouts` * simplify the deserialization of the layout * layouts are now constructed as follows: ``` --- template: direction: Horizontal parts: - direction: Vertical borderless: true split_size: Fixed: 1 run: plugin: tab-bar - direction: Vertical body: true # <== The body section specifies the position of the # inserted tab - direction: Vertical borderless: true split_size: Fixed: 2 run: plugin: status-bar tabs: - direction: Vertical - direction: Vertical ```
Diffstat (limited to 'zellij-utils')
-rw-r--r--zellij-utils/src/input/layout.rs238
-rw-r--r--zellij-utils/src/input/unit/fixtures/layouts/deeply-nested-tab-layout.yaml2
-rw-r--r--zellij-utils/src/input/unit/fixtures/layouts/no-layout-template-specified.yaml6
-rw-r--r--zellij-utils/src/input/unit/fixtures/layouts/no-tab-section-specified.yaml6
-rw-r--r--zellij-utils/src/input/unit/layout_test.rs383
-rw-r--r--zellij-utils/src/ipc.rs4
-rw-r--r--zellij-utils/src/setup.rs8
7 files changed, 264 insertions, 383 deletions
diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs
index 15c964fe2..a3da6abab 100644
--- a/zellij-utils/src/input/layout.rs
+++ b/zellij-utils/src/input/layout.rs
@@ -20,8 +20,6 @@ use std::path::{Path, PathBuf};
use std::vec::Vec;
use std::{fs::File, io::prelude::*};
-use super::config::{LayoutMissingTabSectionError, LayoutPartAndTabError};
-
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
#[serde(crate = "self::serde")]
pub enum Direction {
@@ -52,8 +50,6 @@ pub struct Layout {
pub direction: Direction,
#[serde(default)]
pub parts: Vec<Layout>,
- #[serde(default)]
- pub tabs: Vec<TabLayout>,
pub split_size: Option<SplitSize>,
pub run: Option<Run>,
#[serde(default)]
@@ -64,9 +60,10 @@ pub struct Layout {
// a yaml configuration file
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
#[serde(crate = "self::serde")]
+#[serde(default)]
pub struct LayoutFromYaml {
- //#[serde(default)]
- pub template: LayoutTemplateFromYaml,
+ #[serde(default)]
+ pub template: LayoutTemplate,
#[serde(default)]
pub borderless: bool,
#[serde(default)]
@@ -84,6 +81,7 @@ impl LayoutFromYaml {
let mut layout = String::new();
layout_file.read_to_string(&mut layout)?;
let layout: LayoutFromYaml = serde_yaml::from_str(&layout)?;
+
Ok(layout)
}
@@ -112,16 +110,6 @@ impl LayoutFromYaml {
))
})
}
-
- pub fn construct_layout_template(&self) -> LayoutTemplate {
- let (pre_tab, post_tab) = self.template.split_template().unwrap();
- LayoutTemplate {
- pre_tab: pre_tab.into(),
- post_tab: Layout::from_vec_template_layout(post_tab),
- tabs: self.tabs.clone(),
- }
- }
-
// Currently still needed but on nightly
// this is already possible:
// HashMap<&'static str, Vec<u8>>
@@ -162,58 +150,43 @@ impl LayoutFromYaml {
// construct the layout
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
#[serde(crate = "self::serde")]
-pub struct LayoutTemplateFromYaml {
+pub struct LayoutTemplate {
pub direction: Direction,
#[serde(default)]
pub borderless: bool,
#[serde(default)]
- pub parts: Vec<LayoutTemplateFromYaml>,
+ pub parts: Vec<LayoutTemplate>,
#[serde(default)]
pub body: bool,
pub split_size: Option<SplitSize>,
pub run: Option<Run>,
}
-impl LayoutTemplateFromYaml {
- // Split the layout into parts that can be reassebled per tab
- // returns the layout pre tab and the parts post tab
- pub fn split_template(
- &self,
- ) -> Result<(LayoutTemplateFromYaml, Vec<LayoutTemplateFromYaml>), LayoutPartAndTabError> {
- let mut main_layout = self.clone();
- let mut pre_tab_layout = self.clone();
- let mut post_tab_layout = vec![];
- let mut post_tab = false;
-
- pre_tab_layout.parts.clear();
-
- if main_layout.body {
- post_tab = true;
+impl LayoutTemplate {
+ // Insert an optional `[TabLayout]` at the correct postion
+ pub fn insert_tab_layout(mut self, tab_layout: Option<TabLayout>) -> Self {
+ if self.body {
+ return tab_layout.unwrap_or_default().into();
}
-
- for part in main_layout.parts.drain(..) {
- let (curr_pre_layout, mut curr_post_layout) = part.split_template()?;
-
- // Leaf
- if !post_tab && !part.body {
- pre_tab_layout.parts.push(curr_pre_layout);
- }
-
- // Node
+ for (i, part) in self.parts.clone().iter().enumerate() {
if part.body {
- post_tab = true;
- // Leaf
- } else if post_tab {
- if curr_post_layout.is_empty() {
- let mut part_no_tab = part.clone();
- part_no_tab.parts.clear();
- post_tab_layout.push(part_no_tab);
- } else {
- post_tab_layout.append(&mut curr_post_layout);
- }
+ self.parts.push(tab_layout.unwrap_or_default().into());
+ self.parts.swap_remove(i);
+ break;
}
+ // recurse
+ let new_part = part.clone().insert_tab_layout(tab_layout.clone());
+ self.parts.push(new_part);
+ self.parts.swap_remove(i);
}
- Ok((pre_tab_layout, post_tab_layout))
+ self
+ }
+
+ fn from_vec_tab_layout(tab_layout: Vec<TabLayout>) -> Vec<Self> {
+ tab_layout
+ .iter()
+ .map(|tab_layout| Self::from(tab_layout.to_owned()))
+ .collect()
}
}
@@ -230,35 +203,6 @@ pub struct TabLayout {
pub run: Option<Run>,
}
-// Main template layout struct, that carries information based on position of
-// tabs in relation to the whole layout.
-#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)]
-#[serde(crate = "self::serde")]
-pub struct LayoutTemplate {
- pub pre_tab: Layout,
- pub post_tab: Vec<Layout>,
- pub tabs: Vec<TabLayout>,
-}
-
-impl LayoutTemplate {
- pub fn construct_tab_layout(&self, tab_layout: Option<TabLayout>) -> Layout {
- if let Some(tab_layout) = tab_layout {
- let mut pre_tab_layout = self.pre_tab.clone();
- let post_tab_layout = &self.post_tab;
- pre_tab_layout.merge_tab_layout(tab_layout);
- pre_tab_layout.merge_layout_parts(post_tab_layout.to_owned());
- pre_tab_layout
- } else {
- let mut pre_tab_layout = self.pre_tab.clone();
- let post_tab_layout = &self.post_tab;
- let default_tab_layout = TabLayout::default();
- pre_tab_layout.merge_tab_layout(default_tab_layout);
- pre_tab_layout.merge_layout_parts(post_tab_layout.to_owned());
- pre_tab_layout
- }
- }
-}
-
impl Layout {
pub fn total_terminal_panes(&self) -> usize {
let mut total_panes = 0;
@@ -301,65 +245,6 @@ impl Layout {
split_space(space, self)
}
- // Split the layout into parts that can be reassebled per tab
- // returns the layout pre tab, the parts post tab and the tab layouts
- pub fn split_main_and_tab_layout(
- &self,
- ) -> Result<(Layout, Vec<Layout>, Vec<TabLayout>), LayoutPartAndTabError> {
- let mut main_layout = self.clone();
- let mut pre_tab_layout = self.clone();
- let mut post_tab_layout = vec![];
- let mut tabs = vec![];
- let mut post_tab = false;
-
- pre_tab_layout.parts.clear();
- pre_tab_layout.tabs.clear();
-
- if !main_layout.tabs.is_empty() {
- tabs.append(&mut main_layout.tabs);
- post_tab = true;
- }
-
- if !main_layout.tabs.is_empty() && !main_layout.parts.is_empty() {
- return Err(LayoutPartAndTabError);
- }
-
- for part in main_layout.parts.drain(..) {
- let (curr_pre_layout, mut curr_post_layout, mut curr_tabs) =
- part.split_main_and_tab_layout()?;
-
- // Leaf
- if !post_tab && part.tabs.is_empty() {
- pre_tab_layout.parts.push(curr_pre_layout);
- }
-
- if !part.tabs.is_empty() && !part.parts.is_empty() {
- return Err(LayoutPartAndTabError);
- }
-
- // Node
- if !part.tabs.is_empty() {
- tabs.append(&mut part.tabs.clone());
- post_tab = true;
- // Node
- } else if !curr_tabs.is_empty() {
- tabs.append(&mut curr_tabs);
- post_tab = true;
- // Leaf
- } else if post_tab {
- if curr_post_layout.is_empty() {
- let mut part_no_tab = part.clone();
- part_no_tab.tabs.clear();
- part_no_tab.parts.clear();
- post_tab_layout.push(part_no_tab);
- } else {
- post_tab_layout.append(&mut curr_post_layout);
- }
- }
- }
- Ok((pre_tab_layout, post_tab_layout, tabs))
- }
-
pub fn merge_tab_layout(&mut self, tab: TabLayout) {
self.parts.push(tab.into());
}
@@ -368,20 +253,6 @@ impl Layout {
self.parts.append(&mut parts);
}
- pub fn construct_layout_template(&self) -> Result<LayoutTemplate, ConfigError> {
- let (pre_tab, post_tab, tabs) = self.split_main_and_tab_layout()?;
-
- if tabs.is_empty() {
- return Err(ConfigError::Layout(LayoutMissingTabSectionError));
- }
-
- Ok(LayoutTemplate {
- pre_tab,
- post_tab,
- tabs,
- })
- }
-
fn from_vec_tab_layout(tab_layout: Vec<TabLayout>) -> Vec<Self> {
tab_layout
.iter()
@@ -389,7 +260,7 @@ impl Layout {
.collect()
}
- fn from_vec_template_layout(layout_template: Vec<LayoutTemplateFromYaml>) -> Vec<Self> {
+ fn from_vec_template_layout(layout_template: Vec<LayoutTemplate>) -> Vec<Self> {
layout_template
.iter()
.map(|layout_template| Layout::from(layout_template.to_owned()))
@@ -555,21 +426,32 @@ impl From<TabLayout> for Layout {
Layout {
direction: tab.direction,
borderless: tab.borderless,
- parts: Layout::from_vec_tab_layout(tab.parts),
- tabs: vec![],
+ parts: Self::from_vec_tab_layout(tab.parts),
split_size: tab.split_size,
run: tab.run,
}
}
}
-impl From<LayoutTemplateFromYaml> for Layout {
- fn from(template: LayoutTemplateFromYaml) -> Self {
+impl From<TabLayout> for LayoutTemplate {
+ fn from(tab: TabLayout) -> Self {
+ Self {
+ direction: tab.direction,
+ borderless: tab.borderless,
+ parts: Self::from_vec_tab_layout(tab.parts),
+ body: false,
+ split_size: tab.split_size,
+ run: tab.run,
+ }
+ }
+}
+
+impl From<LayoutTemplate> for Layout {
+ fn from(template: LayoutTemplate) -> Self {
Layout {
direction: template.direction,
borderless: template.borderless,
- parts: Layout::from_vec_template_layout(template.parts),
- tabs: vec![],
+ parts: Self::from_vec_template_layout(template.parts),
split_size: template.split_size,
run: template.run,
}
@@ -588,6 +470,36 @@ impl Default for TabLayout {
}
}
+impl Default for LayoutTemplate {
+ fn default() -> Self {
+ Self {
+ direction: Direction::Horizontal,
+ body: false,
+ borderless: false,
+ parts: vec![LayoutTemplate {
+ direction: Direction::Horizontal,
+ body: true,
+ borderless: false,
+ split_size: None,
+ run: None,
+ parts: vec![],
+ }],
+ split_size: None,
+ run: None,
+ }
+ }
+}
+
+impl Default for LayoutFromYaml {
+ fn default() -> Self {
+ Self {
+ template: LayoutTemplate::default(),
+ borderless: false,
+ tabs: vec![],
+ }
+ }
+}
+
// The unit test location.
#[cfg(test)]
#[path = "./unit/layout_test.rs"]
diff --git a/zellij-utils/src/input/unit/fixtures/layouts/deeply-nested-tab-layout.yaml b/zellij-utils/src/input/unit/fixtures/layouts/deeply-nested-tab-layout.yaml
index 633a1fae2..6b5993732 100644
--- a/zellij-utils/src/input/unit/fixtures/layouts/deeply-nested-tab-layout.yaml
+++ b/zellij-utils/src/input/unit/fixtures/layouts/deeply-nested-tab-layout.yaml
@@ -22,8 +22,6 @@ template:
split_size:
Percent: 23
- direction: Vertical
- split_size:
- Percent: 77
body: true
split_size:
Percent: 90
diff --git a/zellij-utils/src/input/unit/fixtures/layouts/no-layout-template-specified.yaml b/zellij-utils/src/input/unit/fixtures/layouts/no-layout-template-specified.yaml
new file mode 100644
index 000000000..7794c9120
--- /dev/null
+++ b/zellij-utils/src/input/unit/fixtures/layouts/no-layout-template-specified.yaml
@@ -0,0 +1,6 @@
+---
+tabs:
+ - direction: Vertical
+ parts:
+ - direction: Horizontal
+ - direction: Horizontal
diff --git a/zellij-utils/src/input/unit/fixtures/layouts/no-tab-section-specified.yaml b/zellij-utils/src/input/unit/fixtures/layouts/no-tab-section-specified.yaml
new file mode 100644
index 000000000..8b0f3daf1
--- /dev/null
+++ b/zellij-utils/src/input/unit/fixtures/layouts/no-tab-section-specified.yaml
@@ -0,0 +1,6 @@
+---
+template:
+ direction: Horizontal
+ parts:
+ - direction: Horizontal
+ body: true
diff --git a/zellij-utils/src/input/unit/layout_test.rs b/zellij-utils/src/input/unit/layout_test.rs
index 67b9fe4f8..23c57b3d6 100644
--- a/zellij-utils/src/input/unit/layout_test.rs
+++ b/zellij-utils/src/input/unit/layout_test.rs
@@ -23,44 +23,27 @@ fn default_layout_is_ok() {
fn default_layout_has_one_tab() {
let path = default_layout_dir("default.yaml".into());
let layout = LayoutFromYaml::new(&path);
- let layout_template = layout.as_ref().unwrap().construct_layout_template();
+ let layout_template = layout.as_ref().unwrap();
assert_eq!(layout_template.tabs.len(), 1);
}
#[test]
-fn default_layout_has_one_pre_tab() {
- let path = default_layout_dir("default.yaml".into());
- let layout = LayoutFromYaml::new(&path);
- let layout_template = layout.as_ref().unwrap().construct_layout_template();
- assert_eq!(layout_template.pre_tab.parts.len(), 1);
-}
-
-#[test]
-fn default_layout_has_one_post_tab() {
- let path = default_layout_dir("default.yaml".into());
- let layout = LayoutFromYaml::new(&path);
- let layout_template = layout.as_ref().unwrap().construct_layout_template();
- assert_eq!(layout_template.post_tab.len(), 1);
-}
-
-#[test]
fn default_layout_merged_correctly() {
let path = default_layout_dir("default.yaml".into());
let layout_from_yaml = LayoutFromYaml::new(&path);
- let layout_template = layout_from_yaml
- .as_ref()
- .unwrap()
- .construct_layout_template();
- let tab_layout = layout_template.construct_tab_layout(Some(layout_template.tabs[0].clone()));
+ let layout_template = layout_from_yaml.as_ref().unwrap();
+ let tab_layout = layout_template
+ .template
+ .clone()
+ .insert_tab_layout(Some(layout_template.tabs[0].clone()));
let merged_layout = Layout {
direction: Direction::Horizontal,
borderless: false,
parts: vec![
Layout {
direction: Direction::Vertical,
- borderless: false,
+ borderless: true,
parts: vec![],
- tabs: vec![],
split_size: Some(SplitSize::Fixed(1)),
run: Some(Run::Plugin(Some("tab-bar".into()))),
},
@@ -68,44 +51,37 @@ fn default_layout_merged_correctly() {
direction: Direction::Vertical,
borderless: false,
parts: vec![],
- tabs: vec![],
split_size: None,
run: None,
},
Layout {
direction: Direction::Vertical,
- borderless: false,
+ borderless: true,
parts: vec![],
- tabs: vec![],
split_size: Some(SplitSize::Fixed(2)),
run: Some(Run::Plugin(Some("status-bar".into()))),
},
],
- tabs: vec![],
split_size: None,
run: None,
};
- assert_eq!(merged_layout, tab_layout);
+ assert_eq!(merged_layout, tab_layout.into());
}
#[test]
fn default_layout_new_tab_correct() {
let path = default_layout_dir("default.yaml".into());
let layout_from_yaml = LayoutFromYaml::new(&path);
- let layout_template = layout_from_yaml
- .as_ref()
- .unwrap()
- .construct_layout_template();
- let tab_layout = layout_template.construct_tab_layout(None);
+ let layout_template = layout_from_yaml.as_ref().unwrap();
+ let tab_layout = layout_template.template.clone().insert_tab_layout(None);
let merged_layout = Layout {
direction: Direction::Horizontal,
borderless: false,
parts: vec![
Layout {
direction: Direction::Vertical,
- borderless: false,
+ borderless: true,
parts: vec![],
- tabs: vec![],
split_size: Some(SplitSize::Fixed(1)),
run: Some(Run::Plugin(Some("tab-bar".into()))),
},
@@ -113,24 +89,21 @@ fn default_layout_new_tab_correct() {
direction: Direction::Horizontal,
borderless: false,
parts: vec![],
- tabs: vec![],
split_size: None,
run: None,
},
Layout {
direction: Direction::Vertical,
- borderless: false,
+ borderless: true,
parts: vec![],
- tabs: vec![],
split_size: Some(SplitSize::Fixed(2)),
run: Some(Run::Plugin(Some("status-bar".into()))),
},
],
- tabs: vec![],
split_size: None,
run: None,
};
- assert_eq!(merged_layout, tab_layout);
+ assert_eq!(merged_layout, tab_layout.into());
}
#[test]
@@ -151,33 +124,11 @@ fn default_disable_status_layout_is_ok() {
fn default_disable_status_layout_has_no_tab() {
let path = default_layout_dir("disable-status-bar.yaml".into());
let layout_from_yaml = LayoutFromYaml::new(&path);
- let layout_template = layout_from_yaml
- .as_ref()
- .unwrap()
- .construct_layout_template();
+ let layout_template = layout_from_yaml.as_ref().unwrap();
assert_eq!(layout_template.tabs.len(), 0);
}
#[test]
-fn default_disable_status_layout_has_one_pre_tab() {
- let path = default_layout_dir("disable-status-bar.yaml".into());
- let layout_from_yaml = LayoutFromYaml::new(&path);
- let layout_template = layout_from_yaml
- .as_ref()
- .unwrap()
- .construct_layout_template();
- assert_eq!(layout_template.pre_tab.parts.len(), 1);
-}
-
-#[test]
-fn default_disable_status_layout_has_no_post_tab() {
- let path = default_layout_dir("disable-status-bar.yaml".into());
- let layout = LayoutFromYaml::new(&path);
- let layout_template = layout.as_ref().unwrap().construct_layout_template();
- assert!(layout_template.post_tab.is_empty());
-}
-
-#[test]
fn three_panes_with_tab_is_ok() {
let path = layout_test_dir("three-panes-with-tab.yaml".into());
let layout = LayoutFromYaml::new(&path);
@@ -188,32 +139,19 @@ fn three_panes_with_tab_is_ok() {
fn three_panes_with_tab_has_one_tab() {
let path = layout_test_dir("three-panes-with-tab.yaml".into());
let layout = LayoutFromYaml::new(&path);
- let layout_template = layout.unwrap().construct_layout_template();
+ let layout_template = layout.unwrap();
assert_eq!(layout_template.tabs.len(), 1);
}
#[test]
-fn three_panes_with_tab_no_post_tab() {
- let path = layout_test_dir("three-panes-with-tab.yaml".into());
- let layout = LayoutFromYaml::new(&path);
- let layout_template = layout.unwrap().construct_layout_template();
- assert!(layout_template.post_tab.is_empty());
-}
-
-#[test]
-fn three_panes_with_tab_no_pre_tab() {
- let path = layout_test_dir("three-panes-with-tab.yaml".into());
- let layout = LayoutFromYaml::new(&path);
- let layout_template = layout.unwrap().construct_layout_template();
- assert!(layout_template.pre_tab.parts.is_empty());
-}
-
-#[test]
fn three_panes_with_tab_merged_correctly() {
let path = layout_test_dir("three-panes-with-tab.yaml".into());
let layout = LayoutFromYaml::new(&path);
- let layout_template = layout.as_ref().unwrap().construct_layout_template();
- let tab_layout = layout_template.construct_tab_layout(Some(layout_template.tabs[0].clone()));
+ let layout_template = layout.as_ref().unwrap();
+ let tab_layout = layout_template
+ .template
+ .clone()
+ .insert_tab_layout(Some(layout_template.tabs[0].clone()));
let merged_layout = Layout {
direction: Direction::Horizontal,
borderless: false,
@@ -225,7 +163,6 @@ fn three_panes_with_tab_merged_correctly() {
direction: Direction::Horizontal,
borderless: false,
parts: vec![],
- tabs: vec![],
split_size: Some(SplitSize::Percent(50)),
run: None,
},
@@ -237,7 +174,6 @@ fn three_panes_with_tab_merged_correctly() {
direction: Direction::Vertical,
borderless: false,
parts: vec![],
- tabs: vec![],
split_size: Some(SplitSize::Percent(50)),
run: None,
},
@@ -245,33 +181,29 @@ fn three_panes_with_tab_merged_correctly() {
direction: Direction::Vertical,
borderless: false,
parts: vec![],
- tabs: vec![],
split_size: Some(SplitSize::Percent(50)),
run: None,
},
],
- tabs: vec![],
split_size: None,
run: None,
},
],
- tabs: vec![],
split_size: None,
run: None,
}],
- tabs: vec![],
split_size: None,
run: None,
};
- assert_eq!(merged_layout, tab_layout);
+ assert_eq!(merged_layout, tab_layout.into());
}
#[test]
fn three_panes_with_tab_new_tab_is_correct() {
let path = layout_test_dir("three-panes-with-tab.yaml".into());
let layout = LayoutFromYaml::new(&path);
- let layout_template = layout.as_ref().unwrap().construct_layout_template();
- let tab_layout = layout_template.construct_tab_layout(None);
+ let layout_template = layout.as_ref().unwrap();
+ let tab_layout = layout_template.template.clone().insert_tab_layout(None);
let merged_layout = Layout {
direction: Direction::Horizontal,
borderless: false,
@@ -279,15 +211,13 @@ fn three_panes_with_tab_new_tab_is_correct() {
direction: Direction::Horizontal,
borderless: false,
parts: vec![],
- tabs: vec![],
split_size: None,
run: None,
}],
- tabs: vec![],
split_size: None,
run: None,
};
- assert_eq!(merged_layout, tab_layout);
+ assert_eq!(merged_layout, tab_layout.into());
}
#[test]
@@ -301,32 +231,19 @@ fn three_panes_with_tab_and_default_plugins_is_ok() {
fn three_panes_with_tab_and_default_plugins_has_one_tab() {
let path = layout_test_dir("three-panes-with-tab-and-default-plugins.yaml".into());
let layout = LayoutFromYaml::new(&path);
- let layout_template = layout.unwrap().construct_layout_template();
+ let layout_template = layout.unwrap();
assert_eq!(layout_template.tabs.len(), 1);
}
#[test]
-fn three_panes_with_tab_and_default_plugins_one_post_tab() {
- let path = layout_test_dir("three-panes-with-tab-and-default-plugins.yaml".into());
- let layout = LayoutFromYaml::new(&pat