wijjit.rendering.ansi_adapter.cells_to_ansi
- wijjit.rendering.ansi_adapter.cells_to_ansi(cells)[source]
Convert Cell objects to ANSI escape sequence string.
- Parameters:
cells (
listofCell) – List of Cell objects to convert- Returns:
String with ANSI escape sequences
- Return type:
Notes
This function is primarily used for testing and debugging. It converts Cell objects back to ANSI strings. Style changes are optimized to group consecutive cells with identical styling.
Examples
Convert cells to ANSI string:
>>> cell = Cell('A', fg_color=(255, 0, 0), bold=True) >>> ansi = cells_to_ansi([cell]) >>> '\x1b[' in ansi True