nakai

Nakai has several “builders” that can be used.

Functions

pub fn to_inline_string(tree: Node) -> String

Renders only the provided HTML, exactly as provided (disables <head> deduplication, etc.), into a String. Useful for generating snippets instead of whole pages.

Examples

html.div_text([], "hello, lucy!")
|> nakai.to_inline_string()
pub fn to_inline_string_builder(tree: Node) -> StringBuilder

Renders only the provided HTML, exactly as provided (disables <head> deduplication, etc.), into a StringBuilder. Useful for generating snippets instead of whole pages.

Examples

html.div_text([], "hello, lucy!")
|> nakai.to_inline_string_builder()
pub fn to_string(tree: Node) -> String

Renders a full HTML document from the given tree, into a String.

Examples

html.div_text([], "hello, lucy!")
|> nakai.to_string()
pub fn to_string_builder(tree: Node) -> StringBuilder

Renders a full HTML document from the given tree, into a StringBuilder.

Examples

html.div_text([], "hello, lucy!")
|> nakai.to_string_builder()
Search Document