CommentColorWhenExpanded#
- class penzai.treescope.foldable_representation.common_styles.CommentColorWhenExpanded[source]#
Bases:
BaseSpanGroup
Renders its child in a color for comments, but only when expanded.
This can be used in combination with another color (usually AbbreviationColor) to show a summary and then transform it into a comment when clicked, e.g. with
AbbreviationColor(CommentColorWhenExpanded(…))
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.
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.
child
Inherited Methods
(expand to view inherited methods)
__init__
(child)foldables_in_this_part
()html_setup_parts
(context, /)render_to_html
(stream, *[, at_beginning_of_line])render_to_text
(stream, *, expanded_parent, ...)