SummarizableCondition

SummarizableCondition#

class penzai.treescope.foldable_representation.basic_parts.SummarizableCondition[source]#

Bases: RenderableTreePart

Renders conditionally depending on combination of roundtrip/collapsed.

The idea is that, when collapsed and not in roundtrip mode, it’s sometimes convenient to summarize a compound node with a simpler non-roundtrippable representation.

Variables:
  • summary (RenderableTreePart) – Contents to render when collapsed and not in roundtrip mode.

  • detail (RenderableTreePart) – Contents to render when either expanded or in roundtrip mode.

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__([summary, detail])

foldables_in_this_part()

html_setup_parts(context)

render_to_html(stream, *[, at_beginning_of_line])

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

Attributes

collapsed_width

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

detail

newlines_in_expanded_parent

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

summary

tags_in_this_part

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