pub struct HtmlBuilder { /* private fields */ }
Expand description
A builder for generating HTML with embedded CSS.
This structure allows users to add components (like containers, text, icons) and configure CSS properties such as font imports and default styling.
Implementations§
Source§impl HtmlBuilder
impl HtmlBuilder
Sourcepub fn get_css_font_import_urls(&self) -> &str
pub fn get_css_font_import_urls(&self) -> &str
Gets the font import URLs for the CSS.
Sourcepub fn css_font_import_urls(self, css_font_import_urls: String) -> Self
pub fn css_font_import_urls(self, css_font_import_urls: String) -> Self
Sets the font import URLs for the CSS.
Sourcepub fn css_disable_default_browser_css(&self) -> &str
pub fn css_disable_default_browser_css(&self) -> &str
Returns a default CSS reset to disable browser default styling.
Sourcepub fn build_style(&self) -> String
pub fn build_style(&self) -> String
Builds the full CSS style, including any custom font imports.
Source§impl HtmlBuilder
impl HtmlBuilder
Sourcepub fn component(self, component: Components) -> Self
pub fn component(self, component: Components) -> Self
Sets the component to be rendered.
Sourcepub fn get_component(&self) -> &Components
pub fn get_component(&self) -> &Components
Gets the current component to be rendered.
Source§impl HtmlBuilder
impl HtmlBuilder
Sourcepub fn render_component(component: &Components) -> String
pub fn render_component(component: &Components) -> String
Converts a given component to HTML.
This function matches the component type and calls the respective
rendering function for Container
, Text
, or Icon
components.
Sourcepub fn build(&self) -> String
pub fn build(&self) -> String
Renders the current component along with the CSS styles as a complete HTML.
Sourcepub fn build_as_html(&self) -> String
pub fn build_as_html(&self) -> String
Generates a complete HTML document, including the head and body sections.
Trait Implementations§
Source§impl Clone for HtmlBuilder
impl Clone for HtmlBuilder
Source§fn clone(&self) -> HtmlBuilder
fn clone(&self) -> HtmlBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more