[//000000001]: # (punkshell\_module\_textblock \- punk textblock) [//000000002]: # (Generated from file '\_module\_textblock\-0\.1\.3\.tm\.man' by tcllib/doctools with format 'markdown') [//000000003]: # (Copyright © 2024) [//000000004]: # (punkshell\_module\_textblock\(0\) 0\.1\.3 doc "punk textblock")
[ Home | Main Table Of Contents | Table Of Contents | Keyword Index ]
# NAME punkshell\_module\_textblock \- punk textblock functions # Table Of Contents - [Table Of Contents](#toc) - [Synopsis](#synopsis) - [Description](#section1) - [Overview](#section2) - [Concepts](#subsection1) - [dependencies](#subsection2) - [API](#section3) - [Namespace textblock::class](#subsection3) - [Keywords](#keywords) - [Copyright](#copyright) # SYNOPSIS package require textblock [class::table __constructor__ *args*](#1) [class::table __configure__ *args*](#2) [class::table __printmatrix__ *matrix*](#3) [class::table __as\_matrix__ *?cmd?*](#4) [class::table __add\_column__ *args*](#5) [class::table __column\_count__](#6) [class::table __configure\_column__ *index\_expression* *args*](#7) [class::table __header\_count__](#8) [class::table __header\_height__ *header\_index*](#9) [class::table __header\_colspans__](#10) [class::table __configure\_header__](#11) [class::table __add\_row__ *valuelist* ?__\-minheight__ *int\_minheight*? ?__\-maxheight__ *int\_maxheight*? ?__\-ansibase__ *ansicode*?](#12) [class::table __configure\_row__ *index\_expression* ?__\-minheight__ *int\_minheight*? ?__\-maxheight__ *int\_maxheight*? ?__\-ansibase__ *ansicode*?](#13) [class::table __row\_count__](#14) [class::table __row\_clear__](#15) [class::table __clear__](#16) [class::table __get\_column\_cells\_by\_index__ *index\_expression*](#17) [class::table __get\_column\_values\_by\_index__ *index\_expression*](#18) [class::table __debug__](#19) [class::table __column\_width__ *index\_expression*](#20) [class::table __column\_width__](#21) [class::table __width__](#22) [class::table __spangroups__](#23) [class::table __print__](#24) [class::table __print\_bodymatrix__](#25) # 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* 1. CLASS __textblock::class::table__ * class::table __constructor__ *args* *METHODS* TODO \- document the many options * class::table __configure__ *args* 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 * class::table __as\_matrix__ *?cmd?* return a struct::matrix command representing the data portion of the table\. * class::table __add\_column__ *args* * class::table __column\_count__ return the number of columns * class::table __configure\_column__ *index\_expression* *args* \- undocumented * class::table __header\_count__ return the number of header rows * class::table __header\_height__ *header\_index* return the height of a header as the number of content\-lines * class::table __header\_colspans__ Show the colspans configured for all headers * class::table __configure\_header__ \- 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*? * class::table __row\_count__ return the number of data rows in the table\. * class::table __row\_clear__ Remove all rows without resetting column data\. When adding new rows the number of entries will need to match the existing column count\. * class::table __clear__ 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\) * class::table __debug__ 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 * class::table __column\_width__ ordered list of column widths \(inner widths\) * class::table __width__ 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?\) * class::table __spangroups__ return a dict keyed by column\-index showing advanced span information \(debug tool\) * class::table __print__ Return the table as text suitable for console display * class::table __print\_bodymatrix__ 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](\.\./\.\./index\.md\#ansi), [colour](\.\./\.\./index\.md\#colour), [console](\.\./\.\./index\.md\#console), [frame](\.\./\.\./index\.md\#frame), [layout](\.\./\.\./index\.md\#layout), [module](\.\./\.\./index\.md\#module), [table](\.\./\.\./index\.md\#table), [terminal](\.\./\.\./index\.md\#terminal), [text](\.\./\.\./index\.md\#text) # COPYRIGHT Copyright © 2024