8.0 KiB
[ Home | Main Table Of Contents | Table Of Contents | Keyword Index ]
NAME
punkshell_module_textblock - punk textblock functions
Table Of Contents
SYNOPSIS
package require textblock
class::table constructor args
class::table configure args
class::table printmatrix matrix
class::table as_matrix ?cmd?
class::table add_column args
class::table column_count
class::table configure_column index_expression args
class::table header_count
class::table header_height header_index
class::table header_colspans
class::table configure_header
class::table add_row valuelist ?-minheight int_minheight? ?-maxheight int_maxheight? ?-ansibase ansicode?
class::table configure_row index_expression ?-minheight int_minheight? ?-maxheight int_maxheight? ?-ansibase ansicode?
class::table row_count
class::table row_clear
class::table clear
class::table get_column_cells_by_index index_expression
class::table get_column_values_by_index index_expression
class::table debug
class::table column_width index_expression
class::table column_width
class::table width
class::table spangroups
class::table print
class::table print_bodymatrix
DESCRIPTION
Ansi-aware terminal textblock manipulation
Overview
overview of textblock
Concepts
dependencies
packages used by textblock
-
Tcl 8.6-
-
punk::args
-
punk::char
-
punk::ansi
-
punk::lib
-
overtype
-
term::ansi::code::macros
-
textutil
API
Namespace textblock::class
class definitions
-
handler_classes
-
CLASS textblock::class::table
-
METHODS
TODO - document the many options
-
get or set various table-level properties
-
class::table printmatrix matrix
clear all table rows and print a matrix into the table
The rowxcolumn structure must match
-
return a struct::matrix command representing the data portion of the table.
-
return the number of columns
-
class::table configure_column index_expression args
- undocumented
-
return the number of header rows
-
class::table header_height header_index
return the height of a header as the number of content-lines
-
Show the colspans configured for all headers
-
- configure header row-wise
-
class::table add_row valuelist ?-minheight int_minheight? ?-maxheight int_maxheight? ?-ansibase ansicode?
-
class::table configure_row index_expression ?-minheight int_minheight? ?-maxheight int_maxheight? ?-ansibase ansicode?
-
return the number of data rows in the table.
-
Remove all rows without resetting column data.
When adding new rows the number of entries will need to match the existing column count.
-
Remove all row and column data.
If a subsequent call to add_row is made it can contain any number of values.
Further calls to add_row will need to contain the same number of values
as the first call unless default values have been set for the missing columns (review - in flux).
-
class::table get_column_cells_by_index index_expression
Return a dict with keys 'headers' and 'cells' giving column header and data values
-
class::table get_column_values_by_index index_expression
List the cell values of a column from the data area only (no header values)
-
display lots of debug information about how the table is constructed.
-
class::table column_width index_expression
inner width of column ie the available cell-width without borders/separators
-
ordered list of column widths (inner widths)
-
width of the table including borders and separators
calculate width based on assumption frame verticals are 1 screen-column wide
(review - consider possibility of custom unicode double-wide frame?)
-
return a dict keyed by column-index showing advanced span information
(debug tool)
-
Return the table as text suitable for console display
-
output the matrix string corresponding to the body data using the matrix 2string format
this will be a table without borders,headers,title etc and will exclude additional ANSI applied due to table, row or column settings.
If the original cell data itself contains ANSI - the output will still contain those ansi codes.
-
-
KEYWORDS
ansi, colour, console, frame, layout, module, table, terminal, text
COPYRIGHT
Copyright © 2024