TreescopeSubtreeRenderer#

class treescope.renderers.TreescopeSubtreeRenderer[source]#

Bases: Protocol

Protocol for a (recursive) subtree renderer.

Implementations of this protocol render full subtrees to HTML tags. Handlers take one of these as an argument and use it to render their children.

Methods

__init__(*args, **kwargs)

__call__(node[, path])

Signature for a (recursive) subtree renderer.

__call__(node: Any, path: str | None = None) rendering_parts.RenderableAndLineAnnotations[source]#

Signature for a (recursive) subtree renderer.

Parameters:
  • node – The node to render.

  • path – Optionally, a path to this node, represented as a string that can be used to reach this node from the root (e.g. “.foo.bar[‘baz’]”)

Returns:

A representation of the object as a renderable tree part in the intermediate representation.