TableOutput
Inherits Reference < Object
Constants
COLUMN_WIDTH = 16
DIFF_STYLER = ->(cell : Tablo::CellType) do
color = if cell.to_s.starts_with?("-")
:red
else
:green
end
(cell.colorize(color)).to_s
end
HIGHLIGHT_STYLER = ->(cell : Tablo::CellType) do
match = cell.to_s.match(/(.*)\*(.+)\*(.*)/)
if match
"#{match[1]}#{(match[2].colorize(:black)).back(:yellow)}#{match[3]} "
else
cell.to_s
end
end
Adds a yellow background to the text between *text*.
At the end we add to whitespaces to keep the length of the cell
Instance methods
empty?
Sourceheader_content
Sourcerender
Sourcerender_table
Source