render_to_html_as_root#
- treescope.lowering.render_to_html_as_root(root_node: rendering_parts.RenderableTreePart, roundtrip: bool = False, compressed: bool = False) str [source]#
Renders a root node to HTML.
This handles collecting styles and JS definitions and inserting the root HTML element.
- Parameters:
root_node – The root node to render.
roundtrip – Whether to render in roundtrip mode.
compressed – Whether to compress the HTML for display.
- Returns:
HTML source for the rendered node.