build_one_line_tree_node

build_one_line_tree_node#

treescope.rendering_parts.build_one_line_tree_node(line: RenderableAndLineAnnotations | RenderableTreePart | str, path: str | None = None, background_color: str | None = None, background_pattern: str | None = None) RenderableAndLineAnnotations[source]#

Builds a single-line tree node with path buttons.

Parameters:
  • line – Contents of the line.

  • path – Keypath to this node from the root. If provided, copy-path buttons will be added.

  • background_color – Optional background and border color for this node.

  • background_pattern – Optional background pattern as a CSS “image”. If provided, background_color must also be provided, and will be used as the border for the pattern.

Returns:

A new renderable part, possibly with a copy button annotation, for use in part of a rendered treescope tree.