diff --git a/src/html/mod.rs b/src/html/mod.rs index 242037d..d0ba92f 100644 --- a/src/html/mod.rs +++ b/src/html/mod.rs @@ -10,6 +10,28 @@ pub(crate) struct Page { body: Vec>, } +pub(crate) struct PageBuilder { + title: Option, + head: Option>> + body: Option>> +} + +impl PageBuilder { + pub(crate) fn new() -> Self { + Self { + title: None, + head: None, + body: None, + } + } + + pub(crate) fn title(mut self, title: T) + where T: Into + { + self.title = Some(title.into()); + } +} + impl Render for Vec> { fn render(&self) -> String { let mut result = String::new(); @@ -45,6 +67,10 @@ impl Render for Page { } impl Page { + pub(crate) fn builder() -> PageBuilder { + PageBuilder::new() + } + pub(crate) fn new(title: T) -> Self where T: Into,