in_outlined_box

in_outlined_box#

treescope.rendering_parts.in_outlined_box(child: part_interface.RenderableTreePart, css_style: str = 'outline: 1px dashed #aaaaaa;') RenderableTreePart[source]#

Wraps a child into an outlined box.

Outlined boxes ensure that their child appears as a contiguous chunk, instead of having its first line indented, so that it can be fully encapsulated in a box.

When rendered to HTML, this class may or may not insert extra newlines before and after the child, depending on whether this child was already alone on its line. When rendered to text, we always insert extra comments above and below the line.

To allow the box to be collapsed separately, consider wrapping it in a foldable node.

Parameters:
  • child – The child to render.

  • css_style – The CSS style for the box element. By default, renders with a dashed grey outline.

Returns:

A renderable part that renders the child inside a standalone box.