StringCopyButton

Contents

StringCopyButton#

class penzai.treescope.foldable_representation.foldable_impl.StringCopyButton[source]#

Bases: RenderableTreePart

Builds a button that, when clicked, copies the given path.

This does nothing in text rendering mode, and only appears when its parent is expanded.

Variables:
  • copy_string (str) – String to copy when clicked

  • annotation (str) – Annotation to show when the button is hovered over.

Inherited Attributes

collapsed_width

The length of this rendering if collapsed in one line, in characters.

newlines_in_expanded_parent

The number of newlines in this rendering if in an expanded parent.

tags_in_this_part

Returns a set of "tag" objects contained in this part.

Methods

__init__(copy_string[, annotation])

foldables_in_this_part()

html_setup_parts(setup_context)

render_to_html(stream, *[, at_beginning_of_line])

render_to_text(stream, *, expanded_parent, ...)

Attributes

annotation

collapsed_width

The length of this rendering if collapsed in one line, in characters.

newlines_in_expanded_parent

The number of newlines in this rendering if in an expanded parent.

tags_in_this_part

Returns a set of "tag" objects contained in this part.

copy_string