Skip to main content

render

Function render 

Source
pub fn render(content: impl IntoHtml) -> Html
Expand description

Renders any IntoHtml value to an Html string.

This function creates an Html buffer and renders the content into it. Typically used with the html! macro, but accepts any type implementing IntoHtml.

ยงExamples

use plait::{html, render};

let html = render(html! {
    div(class: "container") {
        "Hello, World!"
    }
});

assert_eq!(html, "<div class=\"container\">Hello, World!</div>");