Skip to content

Latest commit

 

History

History
24 lines (21 loc) · 468 Bytes

toHTML.md

File metadata and controls

24 lines (21 loc) · 468 Bytes
id title
toHTML
toHTML

Renders a vnode to HTML string. This is particularly useful if you want to generate HTML on the server.

VNode* vnode = h("div",
  Data(
    Attrs {
      {"id", "root"}
      {"style", "color: #000"}
    }
  ),
  Children {
    h("h1", string("Headline")),
    h("p", string("A paragraph")),
  }
);

std::string html = toHTML(vnode);
// html = <div id="root" style="color: #000"><h1>Headline</h1><p>A paragraph</p></div>;