mrz1988 / lilies

A cross-platform colored text formatting tool for the command line
MIT License
0 stars 0 forks source link

Implement LilyBlocks #20

Closed mrz1988 closed 5 years ago

mrz1988 commented 5 years ago

12

Introducing LilyBlocks!

LilyBlocks are a 2D representation of strings that behave somewhat similarly to LilyStrings but with some reduced function. They can be created from the standard grow entrypoint. Some key features: normalize(): Adjust block so that all rows are the same width, with justification. Helpful for background colors. resize(): A 2D version of LilyString's resize. Fairly awesome. concat(): A way to add a LilyString to the right of another one. Adding squash=True will just merge the strings, but the default behavior first normalizes the block with a left justification. append(): Add more rows to your LilyBlock.

Project improvements!

LilyString improvements/fixes!

Things that should still be done in another PR:

  1. Allow LilyBlock as a parameter to append()
  2. Allow justification when using concat() and append()
  3. Row-based coloration: Pattern or predicate matching to color the whole row.
  4. More unit tests!