package require punk
package require patternpunk
pipealias block_padleft .= {list $input [string repeat " " $indent]} |/0,padding/1> linelist |> .= {lmap v $data {val "$padding$v"}} |> list_as_lines linelist |> .= {lmap v $data {overtype::right $padding $v}} |> list_as_lines punk . logo] 50"
puts stdout "[block_padleft [>punk . logo] 50]"
package require overtype
set out ""
foreach ln [.= block_padleft [>punk . logo ] 2 |> linelist] bgline [.= block_padleft [>punk . logo] 100 |> linelist] {
append out [overtype::left $bgline [a+ green bold]$ln[a+]]\n
}
puts stdout "$out"
proc block_width {block} {
if {![llength $block]} {
return [string length $block]
}
tcl::mathfunc::max {*}[lmap v [linelist $block] {string length $v}]
}
pipealias block_join_width .= {list $lhs [string repeat " " $w1] $rhs [string repeat " " $w2]} {|
/2,col1/1,col2/3
>} linelist {|
data2
>} .=lhs> linelist {|
>} .= {lmap v $data w $data2 {val "[overtype::left $col1 $v][overtype::left $col2 $w]"}} {|
>} list_as_lines } linelist {|
data2
>} .=lhs> linelist {|
>} .= {lmap v $data w $data2 {val "[overtype::left $col1 $v][overtype::left $col2 $w]"}} {|
>} list_as_lines } linelist {|
data2
>} .=lhs> linelist {|
>} .= {lmap v $data w $data2 {val "[overtype::right $col1 $v][overtype::right $col2 $w]"}} {|
>} list_as_lines