You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I keep wanting to do two column displays that are a listing of some key + some associated details.
Minimally, I'd like to be able to tell text-column the width of the first column and let it figure out the width for the remaining column(s) from some specified max size.
Even better would be to tell it the widths of all the columns, but allow that width to be variable.
For example, I'm imagining calling something like this, where '*' tells the system to figure it out,
foo: foos should be approached with caution
flibberty gibbet: Flibberty gibbets have been seen in the
area. Do not enter.
fishyfish: tastey, but smelly
a more complicated invocation might be text-columns(200, [17, '*', 50, 22, '*'], "foo", "bar", "baz" , "beedle" "fum")
i'm thinking it'd just divide whatever max - had left over amongst the * columns.
error cases:
specified_widths > max
max - specified widths < num_unspecified_widths (needs at least 1 char per column.. more if a separator is needed)
existing text-columns error cases
Bonus points: allow rational numbers instead of '*' although that'll make the math even funkier because what happens if the rationals + the ints are > max ? what happens if rationals + ints are < max (... just space on the right i guess)?
I keep wanting to do two column displays that are a listing of some key + some associated details.
Minimally, I'd like to be able to tell
text-column
the width of the first column and let it figure out the width for the remaining column(s) from some specified max size.Even better would be to tell it the widths of all the columns, but allow that width to be variable.
For example, I'm imagining calling something like this, where
'*'
tells the system to figure it out,would produce output like this
a more complicated invocation might be
text-columns(200, [17, '*', 50, 22, '*'], "foo", "bar", "baz" , "beedle" "fum")
i'm thinking it'd just divide whatever max - had left over amongst the
*
columns.error cases:
specified_widths > max
max - specified widths < num_unspecified_widths
(needs at least 1 char per column.. more if a separator is needed)text-columns
error casesBonus points: allow rational numbers instead of
'*'
although that'll make the math even funkier because what happens if the rationals + the ints are > max ? what happens if rationals + ints are < max (... just space on the right i guess)?ex.
text-columns(80, [12, 1/3, '*'], "foo", "bar", "baz")
The text was updated successfully, but these errors were encountered: