jsonschema_diff.table_render

Clean, modular implementation of rich-based legend tables (v2).

Changes v2

  • Robust renderable detection – supports returning any Rich renderable (Text, Panel, Table, etc.) directly from a column‑processor.

  • ANSI bleed fixed: we never coerce unknown objects to str; if value isn’t recognised we call repr() (safe, no control codes).

  • Lists can mix str and Rich renderables – all rendered in a nested grid with rules between blocks.

  • Helper ColumnConfig.wrap=False to suppress cell padding when renderable already has its own framing (e.g. Panel).

  • Ratio now respected (outer Table(expand=True, width=table_width)), still no max_width.

Attributes

Classes

ColumnConfig

Cell

Display‑ready cell.

LegendRenderer

Facade to build a table from legend classes.

Functions

make_standard_renderer(→ LegendRenderer)

Module Contents

StrOrRenderable[source]
Processor[source]
class ColumnConfig[source]
name: str[source]
header: str | None = None[source]
ratio: float | None = None[source]
justify: str = 'left'[source]
no_wrap: bool = False[source]
wrap: bool = True[source]
processor: Processor | None = None[source]
header_text() str[source]
class Cell[source]

Display‑ready cell.

value: rich.console.RenderableType[source]
pad: bool = True[source]
renderable() rich.console.RenderableType[source]
class LegendRenderer(
columns: Sequence[ColumnConfig],
*,
box_style: rich.box.Box = box.SQUARE_DOUBLE_HEAD,
header_style: str = 'bold',
table_width: int | None = None,
show_outer_lines: bool = True,
default_overflow: str = 'fold',
)[source]

Facade to build a table from legend classes.

columns[source]
box_style[source]
header_style = 'bold'[source]
table_width = None[source]
show_outer_lines = True[source]
default_overflow = 'fold'[source]
rich_render(
legend_classes: Iterable[type[jsonschema_diff.core.parameter_base.Compare]],
) Table[source]
render(
legend_classes: Iterable[type[jsonschema_diff.core.parameter_base.Compare]],
) str[source]
make_standard_renderer(
*,
example_processor: Processor | None = None,
table_width: int | None = None,
) LegendRenderer[source]