render_to_html_as_root

render_to_html_as_root#

penzai.treescope.foldable_representation.foldable_impl.render_to_html_as_root(root_node: 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.