basic_parts

basic_parts#

Common building blocks for the treescope intermediate representation.

Classes

BaseBoxWithOutline

An outlined box, which displays in "block" mode when rendered to HTML.

BaseContentlessLeaf

A part whose defaults indicate no renderable content, for subclassing.

BaseSpanGroup

A group that wraps its child in a span, and may apply CSS styles.

BaseTaggedGroup

A group that marks its child as having a tag for layout purposes.

DeferringToChild

Helper base class that defers methods to a child attribute.

EmptyPart

A definitely-empty part, which can be detected and special-cased.

FoldCondition

Renders conditionally depending on whether it's collapsed or expanded.

IndentedChildren

A sequence of children, one per line, and indented.

OnSeparateLines

A sequence of children, one per line, not indented.

RoundtripCondition

Renders conditionally depending on whether it's in roundtrip mode.

ScopedSelectableAnnotation

Modifies its child so that selections outside it don't include it.

Siblings

A sequence of children parts, rendered inline.

SummarizableCondition

Renders conditionally depending on combination of roundtrip/collapsed.

Text

A raw text literal.

VerticalSpace

A vertical space in HTML mode.

WithHoverTooltip

Customized renderer that shows extra info on hover.

Functions

build_full_line_with_annotations(*args)

Concatenates tree parts and appends their line comments at the end.

siblings(*args)

Builds a Siblings part from inline arguments.

siblings_with_annotations(*args[, ...])

Combines siblings that may have annotations, aggregating separately.