Expand description
HTML rendering utilities.
This module provides structures and methods for creating and rendering HTML content.
§Examples
§Creating and rendering an HTML Tag
use cot::html::HtmlTag;
let tag = HtmlTag::new("br");
let html = tag.render();
assert_eq!(html.as_str(), "<br />");§Adding Attributes to an HTML Tag
use cot::html::HtmlTag;
let mut tag = HtmlTag::new("input");
tag.attr("type", "text").attr("placeholder", "Enter text");
tag.bool_attr("disabled");
assert_eq!(
tag.render().as_str(),
"<input type=\"text\" placeholder=\"Enter text\" disabled />"
);